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 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 nameTrait method
plan.submitPlanner::submit_plan
plan.acquire_cohortPlanner::acquire_cohort
plan.heartbeatPlanner::heartbeat
plan.mark_statusPlanner::mark_status
plan.statusPlanner::status
plan.force_releasePlanner::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§

PlanServer
MCP server façade exposing a BasicCpmPlanner over 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 Tool definitions advertised in list_tools.