Use prddd from an agent
An agent with shell access can run the same prd commands as a person. An MCP client launches the server as a local process and communicates over stdio. Remote MCP connections are unavailable. Each server stays bound to the Git repository selected at startup. Start a separate server for each repository.
Connect a client
Replace /absolute/path/to/repo with the checkout you want the agent to work in. For Claude Code, run this from the project where you want the server configured.
claude mcp add prd -- prd mcp --repo /absolute/path/to/repoFor a client with a JSON configuration, add an entry like this and restart its MCP connection.
{
"mcpServers": {
"prd": {
"command": "prd",
"args": ["mcp", "--repo", "/absolute/path/to/repo"]
}
}
}Take a PRD through review
Initialize the checkout with
initorprd init. Ask the person to write their requirements in.cairn/prd.md.Run
idsorprd idsto assign IDs to the requirements, then startplanorprd plan.Relay each
needs-decisionresult to the person. A statement review contains the proposed wording and target section. The spec review contains sections and their PRD coverage. The task review contains the stack, judgments and ordering changes. Return the person's answer withplan_continue, using the decision ID from that review. Only pass--yeswhen the person explicitly asks for it.Use
lintorprd lintto find missing coverage and invalid links. Usestatusorprd statusto read progress. WhenneedsHumannames a task, relay the action to its reviewer. Only a person runsprd approve.
Work with the plan
Use plan_accept when the person accepts edits to a single spec section. Use judge for model judgments and stats for outcome and cost records. Use link to point a reviewer to the right task or section. Attach evidence with note_add and close a resolved note with note_resolve. Open the reader with serve_start. Calling serve_stop closes the server started by this MCP process.
Available tools
| Tool | CLI command | Effects | Description |
|---|---|---|---|
init | prd init | local-write | Initialize the shared repository workspace. Writes files in .cairn/. |
ids | prd ids | local-write | Check or assign stable document section IDs. Writes files in .cairn/. |
lint | prd lint | read | Check the plan and return its findings. Reads only. |
plan | prd plan | local-write, model-cost | Prepare a plan and return its next review decision. Writes files in .cairn/. Calls a model, which can cost money or subscription allowance. |
plan_continue | prd plan --continue | local-write, model-cost | Apply the answer to a pending planning decision. Writes files in .cairn/. Calls a model, which can cost money or subscription allowance. |
plan_accept | prd plan --accept | local-write | Accept a spec section’s current PRD inputs. Writes files in .cairn/. |
status | prd status | read | Read task status and outstanding human gates. Reads only. |
judge | prd judge | local-write, model-cost | Judge the current PRD, spec and tasks. Writes files in .cairn/. Calls a model, which can cost money or subscription allowance. |
stats | prd stats --json | read | Read verified task outcomes and routing decisions. Reads only. |
link | prd link | read | Resolve an ordered viewer link in this repository. Reads only. |
note_add | prd note add | local-write, model-cost | Store an anchored note or review finding and label it if a judge is configured. Writes files in .cairn/. Calls a model, which can cost money or subscription allowance. |
note_resolve | prd note resolve | local-write | Mark an existing note resolved. Writes files in .cairn/. |
serve_start | prd serve | read | Start the repository viewer and return its address. Reads only. |
serve_stop | prd serve | read | Stop the viewer started by this MCP process. Reads only. |
Recover a call
| Result | Next action |
|---|---|
not-a-repository | Restart the server with the path to the intended Git checkout. |
already-initialized | Open the existing PRD and use its workspace. |
not-initialized | Call init in the intended checkout. |
invalid-input | Correct the named field using the tool's input schema. |
stale-decision | Call plan again and give the new review to the person. |
decision-used or unknown-decision | Read the current plan before requesting another decision. |
| Cancelled MCP request | Call status before retrying. Its interruption warning names the operation and the files it changed. |
missing-ids | Run ids on the edited files, then repeat the check. |
unknown-task, invalid-link | Read the current task and section IDs with status, then correct the task, anchor or order of the link arguments. |
missing-file, malformed-file, unreadable-file, file-error | Inspect the path and line in the error. Restore or repair the file and check its permissions before retrying. |
judge-flagged | Relay the flagged judgments to the person reviewing the plan. |
manifest-refused, respec-refused, part-refused, accept-refused, planner-refused | Planning refused the request as given. Follow the returned hint, change the option or section it names, and call plan again. |
plan-failed, judge-failed, stats-failed, note-failed | Inspect the returned hint, affected files and configuration. Verify the plan, history or note identifier before rerunning that operation. |
port-in-use, serve-failed | Check the viewer configuration. Use a free PRDDD_PRESENCE_PORT or ask the owner of the existing listener to stop it. |
internal, cancelled | Inspect changed and the current status before retrying. |
| Lint findings | Open the reported file and line, fix the requirement or its mapping, and run lint again. |