Specline canon 2.3.0-draft Handbook For agents ↗
Doctor · MCP

MCP server

The MCP server exposes doctor as tools an agent calls natively — so a planning agent can pull the methodology and check its own work mid-session, without you pasting anything or it shelling out to a CLI. Same engine, same output contract; only the transport changes.

Register it (once, user scope)

With Claude Code, register it at user scope so it's available in every repo you open:

shell
claude mcp add --scope user doctor -- \
  node /abs/path/to/cli/src/mcp/index.ts

Use your actual absolute path to cli/src/mcp/index.ts. Verify with claude mcp get doctor — it should report ✔ Connected. The server is dependency-free stdio JSON-RPC; no install needed.

The three tools

ToolDoesArguments
doctor_checkValidate a repo; returns the JSON report.path (req), mode, changed[], now, tier
doctor_specReturn the pinned canon — inject to make the agent aware of Specline.
doctor_rulesReturn the rule catalog the agent will be checked against.

How an agent uses it

  1. On opening a Specline repo, the agent calls doctor_spec to load the methodology and doctor_rules to learn what it'll be graded on.
  2. While shaping a spec with you, it calls doctor_check in author mode, naming the files it touched — and self-corrects from each finding's rule_id + fix_hint.
  3. Before handoff, one doctor_check in gate mode confirms zero errors.

This is the web/CLI twin made native: the same canon that /spec.md serves over HTTP, the agent gets through doctor_spec inside the repo.

Without MCP

An agent with shell access (like Claude Code) can already run the CLI directly — specline doctor --mode author --format json and parse the result. The MCP server just makes it a first-class tool the agent discovers automatically, in any client.