Expand description
zenith mcp — a token-efficient MCP server over stdio.
Speaks JSON-RPC 2.0 line-delimited on stdin/stdout (the MCP stdio transport)
and exposes the zenith command surface as MCP tools. It is hand-rolled on
serde_json (already a dependency) rather than pulling an async MCP SDK, so
the binary stays small.
Design (not a thin CLI wrapper):
- every tool returns a trimmed structured object (
structuredContentplus a compact-JSON text mirror), never raw human stdout; - all node/op/surface schema detail is fetched on demand via the single
zenith_schemameta-tool (progressive disclosure); - large or binary artifacts are returned as
resourceslinks backed by the content-addressed session store, never inlined; - documents are addressable by
doc-id, and the scratch/candidate/promote/ finalize workspace loop is drivable end-to-end.
Logs go to stderr; stdout is reserved for the JSON-RPC framing.
Functions§
- handle_
message - Handle one JSON-RPC message. Returns
Some(response)for requests andNonefor notifications (and for messages that need no reply). - run
- Run the stdio MCP server until stdin closes. Always returns success.
- run_
http - Fallback when the binary was built without the
httpfeature: report and fail.