MCP Setup

Connect SourcePrep to your AI editor in under a minute. Pick your tool, copy the config, and restart.

SourcePrep's MCP server gives your AI assistant semantic code search, structural context (modules, hub files, import graph), and dependency impact analysis. All tools are read-only and run locally.

Prerequisites

  1. Install SourcePrep: pip install prep
  2. Start the daemon: prep serve
  3. Add your project: prep add /path/to/repo
  4. Build the index: prep build

Or generate your config with: prep mcp-config --ide claude-code

Claude Code

.claude/mcp.json (Project root (project-scoped) or ~/.claude/settings.json (global))

{
  "servers": {
    "prep": {
      "command": "prep",
      "args": [
        "mcp"
      ]
    }
  }
}

Add "permissions": { "allow": ["mcp__prep"] } to settings.json to auto-approve all SourcePrep tools. Or run: claude mcp add prep -- prep mcp

Cursor

.cursor/mcp.json (Project root or ~/.cursor/)

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

Enable auto-run in Settings > Features > MCP.

Windsurf

~/.codeium/windsurf/mcp_config.json (Global config (applies to all projects))

{
  "mcpServers": {
    "prep": {
      "command": "prep",
      "args": [
        "mcp"
      ],
      "disabled": false
    }
  }
}

GitHub Copilot

.vscode/mcp.json (Project root)

{
  "servers": {
    "prep": {
      "command": "prep",
      "args": [
        "mcp"
      ]
    }
  }
}

Note: Uses "servers" key, NOT "mcpServers".

Gemini CLI

~/.gemini/settings.json (Global config)

{
  "mcpServers": {
    "prep": {
      "command": "prep",
      "args": [
        "mcp"
      ],
      "trust": true
    }
  }
}

"trust": true auto-approves tool calls. Safe for SourcePrep (read-only tools).

Claude Code

claude_desktop_config.json (~/Library/Application Support/Claude/ (macOS) or %APPDATA%/Claude/ (Windows))

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

Zed

~/.config/zed/settings.json (Global or project .zed/settings.json)

{
  "context_servers": {
    "prep": {
      "command": "prep",
      "args": [
        "mcp"
      ]
    }
  }
}

Zed uses "context_servers", not "mcpServers".

Cline

cline_mcp_settings.json (Open Cline sidebar > MCP Servers > Configure)

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

OpenAI Codex

MCP config or AGENTS.md (Codex reads AGENTS.md natively)

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

Codex also reads AGENTS.md — SourcePrep can auto-generate this file.

Config Key Cheat Sheet

ToolConfig FileServer Key
Claude Code.claude/mcp.jsonservers
Cursor.cursor/mcp.jsonmcpServers
Windsurf~/.codeium/windsurf/mcp_config.jsonmcpServers
GitHub Copilot.vscode/mcp.jsonservers
Gemini CLI~/.gemini/settings.jsonmcpServers
Claude Codeclaude_desktop_config.jsonmcpServers
Zed~/.config/zed/settings.jsoncontext_servers
Clinecline_mcp_settings.jsonmcpServers
OpenAI CodexMCP config or AGENTS.mdmcpServers

Troubleshooting

"command not found" or server won't start

MCP hosts spawn prep as a child process without your shell's PATH. Use the absolute path:

"command": "/path/to/.venv/bin/prep"

SourcePrep daemon must be running

The MCP server connects to the daemon at http://127.0.0.1:8400. Start it with prep serve.

Multiple projects

SourcePrep auto-detects which project you're in from the workspace root. To pin a specific project: "args": ["mcp", "--project", "YOUR_PROJECT_ID"]