KAN-193/bring-mcp-to-full-feature-parity-with-cli-tui-via-kanbanoperations-trait#165
Merged
fulsomenko merged 25 commits intodevelopfrom Feb 2, 2026
Conversation
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.
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).
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.
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.
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.
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.
- 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
- 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
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
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.
9f5c258 to
ec2e892
Compare
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.
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)].
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bring MCP server to full feature parity with CLI/TUI by implementing the
KanbanOperationstrait directly.What
MCP server now exposes all 37 operations matching the
KanbanOperationstrait (up from 14), with all tool handlers routing through the trait — no bypasses.Why
Adding a method to
KanbanOperationsnow causes a compile error inkanban-mcpuntil implemented, ensuring CLI/TUI/MCP stay in sync automatically.How
McpContextwrapsSyncExecutorand implementsKanbanOperations. Each MCP tool handler usestokio::task::spawn_blockingwithstd::sync::Mutexto call sync trait methods without blocking the async runtime. Two macros (spawn_op!/spawn_op_ref!) eliminate per-tool boilerplate.Changes
MCP server rewrite
CliExecutorwith syncSyncExecutorusingstd::process::CommandMcpContextimplementing all 37KanbanOperationsmethodsMcpToolstrait, replaced byKanbanOperationsfromkanban-domainKanbanMcpServerwithspawn_blockingmacros bridging sync trait to async MCP handlerskanban-domain,kanban-core,uuid,chrono,tempfiledependenciesTrait parity fixes
create_card_fullbypass —tool_create_cardnow uses the trait's two-stepcreate_card+update_cardpatternupdate_sprint_fullbypass —tool_update_sprintnow constructs aSprintUpdateand routes through the trait'supdate_sprintname: Option<String>toSprintUpdateso MCP can pass--namewithout computingname_indexclear_descriptionandclear_pointsflags fromUpdateCardRequest(clear_descriptionwas silently dropped,clear_pointsgenerated an invalid CLI arg)CLI additions
--name,--start-date,--end-date,--clear-start-date,--clear-end-dateto sprint update--clear-wip-limitto column updateTUI cleanup
card_handlers.rs(delete_card,restore_selected_cards,permanent_delete_selected_cards,permanent_delete_card_at)Nix build
default.nixfrom local source tree instead of pinned GitHub commit sokanbanandkanban-mcpstay in syncKANBAN_BINenv var support to integration tests and provide it vianativeCheckInputsso tests pass in the Nix sandboxTesting
ArgsBuilderMcpContextthrough the realkanbanCLI binarycargo clippyclean,nix buildclean