Skip to main content

Module server

Module server 

Source
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 nameTrait method
plan.submitPlanner::submit_plan / Planner::sync_plan
plan.acquire_cohortPlanner::acquire_cohort
plan.heartbeatPlanner::heartbeat
plan.mark_statusPlanner::mark_status
plan.statusPlanner::status
plan.getPlanner::get_plan
plan.force_releasePlanner::force_release
plan.acceptPlanner::accept
plan.lintcrate::lint::lint
plan.schedulecrate::resource_schedule::resource_schedule
plan.simulatecrate::simulate::simulate
plan.syncPlanner::sync_plan
plan.listPlanner::list_plans
plan.exportPlanner::export_plan
plan.revisePlanner::revise_plan
plan.forkPlanner::fork_plan
plan.selectPlanner::select_variant
plan.archivePlanner::archive
plan.comparePlanner::compare_plans
plan.baselinePlanner::baseline
plan.evPlanner::ev
plan.snapshotPlanner::snapshot
plan.reviewcrate::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§

PlanServer
MCP server façade exposing a BasicCpmPlanner over twenty-three tools.

Constants§

MAX_CONCURRENT_REVIEWS
Most plan.review calls 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 Tool definitions advertised in list_tools (one per PLAN_TOOL_NAMES entry).