Skip to content

KAN-193/bring-mcp-to-full-feature-parity-with-cli-tui-via-kanbanoperations-trait#165

Merged
fulsomenko merged 25 commits intodevelopfrom
KAN-193/bring-mcp-to-full-feature-parity-with-cli-tui-via-kanbanoperations-trait
Feb 2, 2026
Merged

KAN-193/bring-mcp-to-full-feature-parity-with-cli-tui-via-kanbanoperations-trait#165
fulsomenko merged 25 commits intodevelopfrom
KAN-193/bring-mcp-to-full-feature-parity-with-cli-tui-via-kanbanoperations-trait

Conversation

@fulsomenko
Copy link
Owner

@fulsomenko fulsomenko commented Feb 2, 2026

Bring MCP server to full feature parity with CLI/TUI by implementing the KanbanOperations trait directly.

What

MCP server now exposes all 37 operations matching the KanbanOperations trait (up from 14), with all tool handlers routing through the trait — no bypasses.

Why

Adding a method to KanbanOperations now causes a compile error in kanban-mcp until implemented, ensuring CLI/TUI/MCP stay in sync automatically.

How

McpContext wraps SyncExecutor and implements KanbanOperations. Each MCP tool handler uses tokio::task::spawn_blocking with std::sync::Mutex to call sync trait methods without blocking the async runtime. Two macros (spawn_op!/spawn_op_ref!) eliminate per-tool boilerplate.

Changes

MCP server rewrite

  • Replace async CliExecutor with sync SyncExecutor using std::process::Command
  • Add McpContext implementing all 37 KanbanOperations methods
  • Remove McpTools trait, replaced by KanbanOperations from kanban-domain
  • Rewrite KanbanMcpServer with spawn_blocking macros bridging sync trait to async MCP handlers
  • Add 23 new MCP tools: board update, column get/update/reorder, card restore/archive list, sprint CRUD, card-sprint assignment, bulk operations, branch name/git checkout, export/import
  • Add kanban-domain, kanban-core, uuid, chrono, tempfile dependencies

Trait parity fixes

  • Remove create_card_full bypass — tool_create_card now uses the trait's two-step create_card + update_card pattern
  • Remove update_sprint_full bypass — tool_update_sprint now constructs a SprintUpdate and routes through the trait's update_sprint
  • 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, clear_points generated an invalid CLI arg)

CLI additions

  • Add --name, --start-date, --end-date, --clear-start-date, --clear-end-date to sprint update
  • Add --clear-wip-limit to column update

TUI cleanup

  • Remove 4 dead pre-animation functions from card_handlers.rs (delete_card, restore_selected_cards, permanent_delete_selected_cards, permanent_delete_card_at)

Nix build

  • Build default.nix from local source tree instead of pinned GitHub commit so kanban and kanban-mcp stay in sync
  • Add KANBAN_BIN env var support to integration tests and provide it via nativeCheckInputs so tests pass in the Nix sandbox

Testing

  • 32 unit tests for MCP helpers, parsers, and ArgsBuilder
  • 13 integration tests exercising McpContext through the real kanban CLI binary
  • All 456 workspace tests pass, cargo clippy clean, nix build clean

@fulsomenko fulsomenko self-assigned this Feb 2, 2026
@fulsomenko fulsomenko changed the title Kan 193/bring mcp to full feature parity with cli tui via kanbanoperations trait KAN-193/bring-mcp-to-full-feature-parity-with-cli-tui-via-kanbanoperations-trait Feb 2, 2026
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.
@fulsomenko fulsomenko force-pushed the KAN-193/bring-mcp-to-full-feature-parity-with-cli-tui-via-kanbanoperations-trait branch from 9f5c258 to ec2e892 Compare February 2, 2026 16:35
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.
@fulsomenko fulsomenko merged commit 1872307 into develop Feb 2, 2026
7 checks passed
@fulsomenko fulsomenko deleted the KAN-193/bring-mcp-to-full-feature-parity-with-cli-tui-via-kanbanoperations-trait branch February 2, 2026 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant