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:
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
| Tool | Does | Arguments |
|---|---|---|
| doctor_check | Validate a repo; returns the JSON report. | path (req), mode, changed[], now, tier |
| doctor_spec | Return the pinned canon — inject to make the agent aware of Specline. | — |
| doctor_rules | Return the rule catalog the agent will be checked against. | — |
How an agent uses it
- On opening a Specline repo, the agent calls
doctor_specto load the methodology anddoctor_rulesto learn what it'll be graded on. - While shaping a spec with you, it calls
doctor_checkinauthormode, naming the files it touched — and self-corrects from each finding'srule_id+fix_hint. - Before handoff, one
doctor_checkingatemode 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.