MCP stdio server (ported surface)
mesa-mcp is the MCP entry for tools already ported onto the modu ... --json adapter. It speaks
JSON-RPC 2.0 over stdio, one document per line (MCP stdio transport). stdout is protocol-only;
diagnostics go to stderr.
The full legacy MCP under legacy/ remains the reference until parity; this entry deliberately
exposes only the ported tools, so it never silently loses capabilities.
Environment
| variable | meaning |
|---|---|
MESA_MODU_BIN / MODU_BIN | base CLI binary (default modu) |
MODU_PROJECT_DIR | project cwd for base calls (default process.cwd()) |
MESA_LICENSE_FILE | Pro license; when set, mesa-mcp verifies it at startup and exits on invalid |
Tools
Read-only / work items: contract_info, get_skill, catalog_list, catalog_get_material, catalog_computed,
gap_list, gap_report, work_list, work_attention, work_start, work_show, validate.
Read-only project/resource: list_specs, get_spec, model_get, list_data_resources,
describe_resource, get_authoring_guide, get_skill, contract_info.
Licensed additions: approval_definitions, approval_list, approval_submit, approval_decide,
approval_delegations, datasource_health, project_create (apply-gated), plus datasource_upsert.
Project lifecycle: project_serve (starts modu hub on a loopback port after a /healthz probe;
requires the workbench shell), project_status, project_stop, project_build (base modu build with
an explicit --dist; Pro does not build vite assets itself).
Proposal review: change_list, change_show, change_verify (verify only; change apply/rollback
stay human-confirmed CLI actions and are intentionally not MCP tools).
Pro-owned context memory: context_list, context_read, context_write — the only direct project
writes delegate to base modu memory(2026-12-04 收敛;旧 <project>/.modu/mcp/context/<key>.json 只读兜底).
Writes (base CLI remains the only .modu/ writer):
proposal_submit— write a ChangeSet proposal without applying it (never gated;change applystays human-confirmed).requirement_submit—.modu/proposals/requirements/+ audit.spec_apply— PageSpec validation then.modu/specs/<id>.json.logic_apply— replace one logic key with bundle validation.menu_replace— validated whole-menu replacement.datasource_upsert— validated datasource upsert.
Write payloads travel over stdin (--file -), never in argv. Config-write tools are disabled by
default (APPLY_DISABLED); start with MESA_MCP_ALLOW_APPLY=1 (or pass allowApply: true to
createServer) after the operator confirms. proposal_submit, requirement_submit and change_verify are not gated because they write
proposals/verification records, not active config. tools/call returns
{content:[{type:"text",text}], isError}; a base failure is a tool error, not a JSON-RPC error.
Unknown tools/methods are JSON-RPC errors (-32602 / -32601).
Parity checklist (still on legacy/)
--allow-applyproposal auto-apply (separate from the config-write gate).- spec/proposal review flows and
--allow-applygating. - skill packaging.
Port one tool at a time: replace the legacy body with a call to src/tools/*, add a fake-binary
test, then update this list. Do not delete legacy/ until every tool has a replacement test.
源文件 · mesa-pro/docs/mcp-port.md