Skip to content

Using creep from an agent

Luis edited this page Dec 2, 2026 · 4 revisions

Using creep from an agent (MCP)

Important

Versions. creep mcp is on main since #32 (PR #323, ADR 0027) and ships with v0.3; v0.2.0 does not have it (creep help lists mcp when yours does). Install a release as in Install and verify. If this page and ADR 0027 disagree, the ADR wins.

creep mcp lets a coding agent (Claude Code, an IDE agent, any MCP client) call creep as a tool over the Model Context Protocol, on stdio only. creep opens no socket for it: the agent starts creep mcp as a child process and talks over its stdin and stdout.

1. Prepare once, from the CLI

The MCP server never prompts, so do these once from a terminal, from the repository root, with the model the agent's scans will use (Quickstart):

creep doctor   # the model works, the tool canary passes
creep scan     # grants consent to the endpoint, calibrates the model, creates the state key

Until a CLI scan has done this, the MCP scan tool refuses: it never asks for consent (stdin carries the protocol), never runs a calibration and never creates the state key.

2. Register the server

Start it from the repository root. In an MCP client config:

{
  "mcpServers": {
    "creep": { "command": "creep", "args": ["mcp"] }
  }
}

With Claude Code, from the repository root:

claude mcp add creep -- creep mcp                    # for you, in this project
claude mcp add --scope project creep -- creep mcp    # shared with the team in .mcp.json

The client starts the server in its working directory, and that directory is the repository creep scans: findings and why read its .creep/report.json, so keep json in report.formats (it is there by default). Global flags such as --config <path> go in args next to mcp. To check the server by hand, run creep mcp in a terminal: it waits for JSON-RPC on stdin and exits when stdin closes (Ctrl-D; Ctrl-Z then Enter on Windows).

creep mcp refuses --mode nightly, --record and --recalibrate, and the per-command rules refuse --changed, --stability, --baseline and --baseline-write.

3. Tools

Tool Arguments Returns
scan changed: 1 to 1000 repository-relative paths, as git diff --name-only prints them a pr-mode scan of only those files (as --changed): exit code, outcome, report path, findings, how many were not evaluated, and the log (cut at 8 KiB)
findings optional status filter; offset and limit (1 to 200) the last report's findings (.creep/report.json), a page at a time
why id of a finding its evidence (line ranges), stability and note, as creep why

Each finding has id, class, status, path, line and, when set, confidence, reason, partial, suppressed. Statuses and exit codes are those of the CLI (Verification statuses): an exit code 4 means the scan is incomplete, not clean.

A refused call comes back as a tool error the agent can read, not a crash: for example findings: no scan report in this directory (run creep scan with json in report.formats) before any scan, or a scan refusal until step 1 has been done.

A typical agent loop: after editing, call scan with the files it changed, then why for each probable finding, and show the evidence to its user.

4. What the agent cannot do

The agent may itself be prompt-injected (by the code it reads, a web page, an issue), so creep treats every argument as untrusted:

  • Read-only. No tool edits source or applies a fix, writes outside .creep/, starts a container, runs a PoC or an optional scanner, or reaches the network. Sandbox verification and nightly mode stay CLI-only.
  • Bounded input. Paths are checked like --changed and report.ValidPath: no absolute path, drive letter, backslash, .. or NUL; finding IDs are checked before anything is read; one message is at most 1 MiB. One scan runs at a time; a second call is refused, not queued.
  • No new authority. The agent cannot choose the endpoint, grant consent, raise budget.* limits or change the gate. It can spend your model budget: each scan call is a pr-mode scan of its files under your limits.
  • Escaped output. Every path and error it gets back has control, bidi and other non-printable characters escaped; repository text is still readable and is data, never instructions.

creep proposes no fixes today. When it does, a fix will come back only as a unified diff for the agent to show you, never applied by creep.

Clone this wiki locally