MCP

Let compatible agents prepare context before they act.

The MCP server gives agents one primary tool, prepare_context, which returns a risk header and prompt-ready handoff without making developers copy packets by hand.

Run the stdio server.

Use the MCP entrypoint from the repository during development, or from the package once published.

CONTEXT_DELTA_WORKSPACE=/absolute/path/to/repo \
node packages/mcp-server/bin/context-delta-mcp.js

Available tools.

  • prepare_context is the normal first call. It builds or refreshes context, infers the task when needed, and returns a handoff plus Context ready ยท risk=....
  • check_context_setup explains whether the requested CLI, MCP, VS Code, or all-integrations target is ready in the workspace.
  • review_context_drift checks after edits whether current git changes moved outside the latest packet.
  • packet builds or returns raw packet JSON for audit and debugging.
  • compact returns a short preview for small prompts.
  • insights explains risk, warnings, and readiness.
  • diff compares current and previous packets.
  • handoff returns prompt-ready Markdown or JSON.
  • eval, approval, and replay support reviewable packet-quality workflows.
  • summary, report, scan, and metrics support review and observability.

Client config shape.

Run npm run setup -- --target mcp to check agent-integration readiness. Run npm run doctor -- --mcp to print the current checkout's command and workspace path.

{
  "mcpServers": {
    "context-delta": {
      "command": "node",
      "args": [
        "packages/mcp-server/bin/context-delta-mcp.js"
      ],
      "env": {
        "CONTEXT_DELTA_WORKSPACE": "/absolute/path/to/repo"
      }
    }
  }
}

When a host cannot call MCP tools directly, use the VS Code prepare-and-copy action as the fallback.

Local-first safety.

The server runs locally against the workspace. Packet assembly and storage stay local by default; sharing packet text with an agent host is explicit and user-controlled.