Commit 1872307
authored
KAN-193/bring-mcp-to-full-feature-parity-with-cli-tui-via-kanbanoperations-trait (#165)
* feat: add kanban-domain, kanban-core, uuid, chrono, tempfile deps to kanban-mcp
* feat: replace async CliExecutor with sync SyncExecutor
Use std::process::Command instead of tokio::process::Command so
KanbanOperations can be implemented directly. Errors now return
KanbanError/KanbanResult instead of McpError. Adds execute_raw_stdout
for export and built-in retry count constant.
* feat: add McpContext implementing KanbanOperations trait
McpContext wraps SyncExecutor and implements all 37 KanbanOperations
methods, delegating each to the kanban CLI. Includes ArgsBuilder helper,
ListResponse/DeletedResponse parsing types, and special handling for
export (raw stdout) and import (tempfile).
* feat: remove McpTools trait, replaced by KanbanOperations from kanban-domain
* feat: rewrite MCP server with 37 tools via KanbanOperations trait
Replace McpTools-based architecture with direct KanbanOperations
implementation for compile-time feature parity. KanbanMcpServer now
holds Arc<Mutex<McpContext>> with spawn_blocking macros bridging
sync KanbanOperations to async MCP handlers.
23 new tools: update_board, get/update/reorder_column, restore_card,
list_archived_cards, assign/unassign_card_to_sprint, get_card_branch_name,
get_card_git_checkout, bulk_archive/move/assign_sprint, full sprint CRUD
(create/list/get/update/activate/complete/cancel/delete), export/import.
* feat: add --clear-wip-limit flag to CLI column update
The ColumnUpdate domain struct supports FieldUpdate::Clear for wip_limit
but the CLI had no way to trigger it. Add --clear-wip-limit flag to
ColumnUpdateArgs and handle it in the column update handler.
* feat: add sprint update fields to CLI (name, dates, clear flags)
SprintUpdate domain struct has name_index, start_date, end_date fields
that were not exposed via CLI. Add --name, --start-date, --end-date,
--clear-start-date, --clear-end-date to SprintUpdateArgs. The handler
resolves --name to a name_index via board.add_sprint_name_at_used_index
and parses dates from YYYY-MM-DD or RFC 3339 format.
* fix: error handling in MCP executor
Map CLI "not found" errors to KanbanError::NotFound instead of Internal
so callers can distinguish missing entities from real errors. Also fall
back to parsing stderr (first line) when stdout is empty, since the CLI
writes error JSON to stderr on failure.
* feat: bring MCP context to full parity with CLI
- Remove fragile string matching in execute_get, rely on NotFound error
- Add SprintUpdateFullParams and CreateCardFullParams param structs
- Add update_sprint_full passing all fields through to CLI subprocess
- Add create_card_full for atomic single-call card creation
- Add with_kanban_path builder for configurable binary path
- Handle FieldUpdate::Clear for wip_limit in update_column
- Pass start_date/end_date through in update_sprint trait impl
* feat: update MCP server tools for full CLI parity
- Fix mutex poisoning: replace .unwrap() with error mapping in
spawn_op!/spawn_op_ref! macros
- Make context/executor modules pub for integration tests
- Replace two-step create+update in tool_create_card with atomic
create_card_full single CLI call
- Extend UpdateSprintRequest with name, start/end dates, clear flags
- Extend UpdateColumnRequest with clear_wip_limit
- Update tool handlers to use new param structs
* test: add unit tests for MCP helpers and ArgsBuilder
32 tests covering:
- parse_uuid: valid, invalid, empty
- parse_priority: all variants, case insensitivity, invalid
- parse_status: all variants, hyphen/underscore normalization, invalid
- parse_datetime: RFC 3339, date-only, invalid
- parse_uuids_csv: single, multiple, spaces, invalid in list
- to_call_tool_result/to_call_tool_result_json: serialization
- ArgsBuilder: new, add_opt, add_opt_num, add_flag, add_field_str, chaining
* test: add integration tests for MCP round-trips
13 tests exercising McpContext through the real kanban CLI binary:
- Board CRUD + get nonexistent returns None
- Column create, list, update, reorder
- Card create, get, move, archive, restore
- Card create_full with all optional fields
- Sprint create, list, activate, complete, cancel
- Sprint update_full with name and dates
- Card-sprint assign/unassign
- Bulk archive, bulk move
- Export/import round-trip
Uses locally-built binary via with_kanban_path to test against
current code rather than the installed system binary.
* chore: cargo fmt
* chore: add changeset
* fix: remove MCP trait parity bypasses and broken clear flags
Remove create_card_full and update_sprint_full bypass methods that
circumvented the KanbanOperations trait. tool_create_card now uses the
trait's two-step create+update pattern. tool_update_sprint constructs
a SprintUpdate and routes through the trait.
Add name: Option<String> to SprintUpdate so MCP can pass --name
without computing name_index.
Remove broken clear_description and clear_points flags from
UpdateCardRequest — clear_description was silently dropped and
clear_points generated an invalid CLI arg.
* refactor: remove 4 dead pre-animation functions from TUI card_handlers
Remove delete_card, restore_selected_cards, permanent_delete_selected_cards,
and permanent_delete_card_at. These were replaced by animation-based
equivalents and all had #[allow(dead_code)].
* chore: update changeset
* fix: build kanban from source in Nix and support KANBAN_BIN in tests
Build default.nix from local source tree instead of a pinned GitHub
commit so kanban and kanban-mcp stay in sync during development.
Add KANBAN_BIN env var support to integration tests and provide it
via nativeCheckInputs in the kanban-mcp Nix build so tests can find
the CLI binary in the Nix sandbox.
* docs: add MCP server to README quick start
* fix: add Display impls for CardPriority/CardStatus, replace fragile Debug formatting
* fix: use parking_lot::Mutex to prevent poisoning, map errors to proper MCP types
* fix: add 30s timeout to CLI subprocess, fix multiline stderr parsing
* refactor: move sprint name→index conversion into UpdateSprint command
* feat: extend create_card with optional fields, remove two-phase creation
Add CreateCardOptions struct to pass description, priority, points, and
due_date at card creation time. This eliminates the two-phase
create+update pattern previously used by CLI and MCP handlers.
* chore: cargo fmt1 parent 5daffa5 commit 1872307
File tree
25 files changed
+2283
-656
lines changed- .changeset
- crates
- kanban-cli/src
- handlers
- kanban-domain/src
- commands
- kanban-mcp
- src
- tests
- kanban-tui
- src
- handlers
- tests
25 files changed
+2283
-656
lines changedLines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
72 | 80 | | |
73 | 81 | | |
74 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| 144 | + | |
| 145 | + | |
144 | 146 | | |
145 | 147 | | |
146 | 148 | | |
| |||
343 | 345 | | |
344 | 346 | | |
345 | 347 | | |
| 348 | + | |
| 349 | + | |
346 | 350 | | |
347 | 351 | | |
348 | 352 | | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
349 | 361 | | |
350 | 362 | | |
351 | 363 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
| 279 | + | |
279 | 280 | | |
280 | 281 | | |
281 | 282 | | |
| |||
288 | 289 | | |
289 | 290 | | |
290 | 291 | | |
| 292 | + | |
291 | 293 | | |
292 | 294 | | |
293 | 295 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
| 5 | + | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
| 12 | + | |
| 13 | + | |
25 | 14 | | |
26 | 15 | | |
27 | 16 | | |
| |||
135 | 124 | | |
136 | 125 | | |
137 | 126 | | |
138 | | - | |
| 127 | + | |
139 | 128 | | |
140 | 129 | | |
141 | 130 | | |
142 | 131 | | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
150 | 138 | | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
| 139 | + | |
| 140 | + | |
165 | 141 | | |
166 | 142 | | |
167 | 143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
55 | 58 | | |
56 | 59 | | |
57 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
6 | 23 | | |
7 | 24 | | |
8 | 25 | | |
| |||
54 | 71 | | |
55 | 72 | | |
56 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
57 | 92 | | |
| 93 | + | |
58 | 94 | | |
59 | 95 | | |
60 | 96 | | |
| |||
65 | 101 | | |
66 | 102 | | |
67 | 103 | | |
68 | | - | |
69 | | - | |
| 104 | + | |
| 105 | + | |
70 | 106 | | |
71 | 107 | | |
72 | 108 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
26 | 49 | | |
27 | 50 | | |
28 | 51 | | |
| |||
331 | 354 | | |
332 | 355 | | |
333 | 356 | | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
334 | 365 | | |
335 | 366 | | |
336 | 367 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
56 | 88 | | |
57 | 89 | | |
58 | 90 | | |
| |||
0 commit comments