Expand description
MCP tool surface for the open-source CPM planner.
PlanServer wraps an Arc<BasicCpmPlanner> and exposes the six
Planner trait methods as MCP tools so any MCP-speaking agent
(Claude Code, Cursor, custom orchestrator, or the §33 LLM executor)
can drive the planner over the standard MCP protocol.
§Tool surface
| Tool name | Trait method |
|---|---|
plan.submit | Planner::submit_plan |
plan.acquire_cohort | Planner::acquire_cohort |
plan.heartbeat | Planner::heartbeat |
plan.mark_status | Planner::mark_status |
plan.status | Planner::status |
plan.force_release | Planner::force_release |
§Error mapping
PlannerError variants are surfaced as MCP internal_error
responses whose message is the variant’s Display output. The
variant prefixes (LOCK_HELD:, LOCK_NOT_HELD:, LOCK_EXPIRED:,
OVERLAP_DETECTED:, MISSING_PREREQUISITE:, PLAN_NOT_FOUND:,
DELIVERABLE_NOT_FOUND:, INVALID_GRAPH:, BACKEND_ERROR:) are
stable machine-parseable signals — see core::plan for the contract.
Malformed arguments yield invalid_params with the serde error.
§Testing pattern
PlanServer::dispatch_call is the transport-free entry point used
by integration tests, mirroring the pattern in
mcp-flowgate-mcp-server. The ServerHandler::call_tool impl is a
thin wrapper that wraps the result in CallToolResult::structured.
Structs§
- Plan
Server - MCP server façade exposing a
BasicCpmPlannerover six tools.
Constants§
- PLAN_
TOOL_ NAMES - All six MCP tool names exposed by
PlanServer, in declaration order. - TOOL_
ACQUIRE_ COHORT - TOOL_
FORCE_ RELEASE - TOOL_
HEARTBEAT - TOOL_
MARK_ STATUS - TOOL_
STATUS - TOOL_
SUBMIT - SPEC §33 PA4 — tool names. Dot notation
plan.<verb>matches the convention used elsewhere in the workspace (flowgate.query,flowgate.command).
Functions§
- plan_
tool_ definitions - Build the six
Tooldefinitions advertised inlist_tools.