Skip to content

MCP server ​

Baton ships a Model Context Protocol server (@baton/mcp) that exposes the core operations as MCP tools over stdio, so any MCP-capable harness can capture, validate, and resume handoffs without shelling out to the CLI.

Running it ​

bash
baton-mcp

or directly from a checkout:

bash
node packages/mcp/dist/server.js

The server is stateless per connection and operates on the project at the current working directory (resolved the same way the CLI resolves it).

Tools ​

ToolPurpose
handoff_initInitialize .baton/ for a project
handoff_captureCreate a draft handoff from structured fields
handoff_validateRun the policy engine, return per-check results
handoff_readyPromote a validated draft to ready
handoff_resumeRender the resume brief
handoff_listList handoffs
handoff_detectFeed adapter events / signals, get a suggestion
handoff_statusProject + session status snapshot
handoff_metricsEvent log summary

Tool results follow the same policy semantics as the CLI: a failed validation is a structured policy-error result (never a thrown exception), so agents can branch on the payload.

Parity ​

The MCP layer is a thin translation layer over @baton/core — the same functions the CLI calls. Contract tests in packages/mcp/tests/ assert that tool results match CLI behavior for the same inputs.

Released under the MIT License.