Expand description
MCP tool surface for the open-source CPM planner.
PlanServer wraps an Arc<BasicCpmPlanner> and exposes the
Planner trait methods plus the read-only analysis and portfolio tools
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 / Planner::sync_plan |
plan.acquire_cohort | Planner::acquire_cohort |
plan.heartbeat | Planner::heartbeat |
plan.mark_status | Planner::mark_status |
plan.status | Planner::status |
plan.get | Planner::get_plan |
plan.force_release | Planner::force_release |
plan.accept | Planner::accept |
plan.lint | crate::lint::lint |
plan.schedule | crate::resource_schedule::resource_schedule |
plan.simulate | crate::simulate::simulate |
plan.sync | Planner::sync_plan |
plan.list | Planner::list_plans |
plan.export | Planner::export_plan |
plan.revise | Planner::revise_plan |
plan.fork | Planner::fork_plan |
plan.select | Planner::select_variant |
plan.archive | Planner::archive |
plan.compare | Planner::compare_plans |
plan.baseline | Planner::baseline |
plan.ev | Planner::ev |
plan.snapshot | Planner::snapshot |
plan.review | crate::review::review |
§Plan review
plan.review’s judge is fixed when the server is built:
PlanServer::with_llm_config takes the result of
LlmConfig::from_env (read once, at startup) and
PlanServer::with_judge injects any JudgmentModel (tests). With no
key, or an unusable configuration, the server still starts and the tool
reports review_unavailable with a reason naming the setting. Each
review runs on the blocking pool (it simulates the plan once per
proposal) and records a plan.review audit event carrying the
prompt_hash, model, endpoint host, status and question count — never
the key or the prompt.
§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:, LAPSE_LIMIT:, PREREQUISITES_INCOMPLETE:, INVALID_GRAPH:,
INVALID_CAPACITIES:, VARIANT_NOT_SELECTED:, ARCHIVE_REFUSED:,
INVALID_PATH:, INVALID_ACTUALS:, NOT_BASELINED:, 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
praxec-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 twenty-three tools.
Constants§
- MAX_
CONCURRENT_ REVIEWS - Most
plan.reviewcalls running at once; further calls wait for a slot. Each review is one billed OpenRouter request plus up to 65 simulates. - PLAN_
TOOL_ NAMES - All twenty-three MCP tool names exposed by
PlanServer, in declaration order. - TOOL_
ACCEPT - TOOL_
ACQUIRE_ COHORT - TOOL_
ARCHIVE - TOOL_
BASELINE - TOOL_
COMPARE - TOOL_EV
- TOOL_
EXPORT - TOOL_
FORCE_ RELEASE - TOOL_
FORK - TOOL_
GET - TOOL_
HEARTBEAT - TOOL_
LINT - TOOL_
LIST - TOOL_
MARK_ STATUS - TOOL_
REVIEW - TOOL_
REVISE - TOOL_
SCHEDULE - TOOL_
SELECT - TOOL_
SIMULATE - TOOL_
SNAPSHOT - TOOL_
STATUS - TOOL_
SUBMIT - SPEC §33 PA4 — tool names. Dot notation
plan.<verb>matches the convention used elsewhere in the workspace (praxec.query,praxec.command). - TOOL_
SYNC
Functions§
- plan_
tool_ definitions - Build the
Tooldefinitions advertised inlist_tools(one perPLAN_TOOL_NAMESentry).