prdddDocsOpen viewer ↗

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/repo

For 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

  1. Initialize the checkout with init or prd init. Ask the person to write their requirements in .cairn/prd.md.

  2. Run ids or prd ids to assign IDs to the requirements, then start plan or prd plan.

  3. Relay each needs-decision result 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 with plan_continue, using the decision ID from that review. Only pass --yes when the person explicitly asks for it.

  4. Use lint or prd lint to find missing coverage and invalid links. Use status or prd status to read progress. When needsHuman names a task, relay the action to its reviewer. Only a person runs prd 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

ToolCLI commandEffectsDescription
initprd initlocal-writeInitialize the shared repository workspace. Writes files in .cairn/.
idsprd idslocal-writeCheck or assign stable document section IDs. Writes files in .cairn/.
lintprd lintreadCheck the plan and return its findings. Reads only.
planprd planlocal-write, model-costPrepare a plan and return its next review decision. Writes files in .cairn/. Calls a model, which can cost money or subscription allowance.
plan_continueprd plan --continuelocal-write, model-costApply the answer to a pending planning decision. Writes files in .cairn/. Calls a model, which can cost money or subscription allowance.
plan_acceptprd plan --acceptlocal-writeAccept a spec section’s current PRD inputs. Writes files in .cairn/.
statusprd statusreadRead task status and outstanding human gates. Reads only.
judgeprd judgelocal-write, model-costJudge the current PRD, spec and tasks. Writes files in .cairn/. Calls a model, which can cost money or subscription allowance.
statsprd stats --jsonreadRead verified task outcomes and routing decisions. Reads only.
linkprd linkreadResolve an ordered viewer link in this repository. Reads only.
note_addprd note addlocal-write, model-costStore 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_resolveprd note resolvelocal-writeMark an existing note resolved. Writes files in .cairn/.
serve_startprd servereadStart the repository viewer and return its address. Reads only.
serve_stopprd servereadStop the viewer started by this MCP process. Reads only.

Open the tool reference

Recover a call

ResultNext action
not-a-repositoryRestart the server with the path to the intended Git checkout.
already-initializedOpen the existing PRD and use its workspace.
not-initializedCall init in the intended checkout.
invalid-inputCorrect the named field using the tool's input schema.
stale-decisionCall plan again and give the new review to the person.
decision-used or unknown-decisionRead the current plan before requesting another decision.
Cancelled MCP requestCall status before retrying. Its interruption warning names the operation and the files it changed.
missing-idsRun ids on the edited files, then repeat the check.
unknown-task, invalid-linkRead 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-errorInspect the path and line in the error. Restore or repair the file and check its permissions before retrying.
judge-flaggedRelay the flagged judgments to the person reviewing the plan.
manifest-refused, respec-refused, part-refused, accept-refused, planner-refusedPlanning 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-failedInspect the returned hint, affected files and configuration. Verify the plan, history or note identifier before rerunning that operation.
port-in-use, serve-failedCheck the viewer configuration. Use a free PRDDD_PRESENCE_PORT or ask the owner of the existing listener to stop it.
internal, cancelledInspect changed and the current status before retrying.
Lint findingsOpen the reported file and line, fix the requirement or its mapping, and run lint again.