RepoPilot

MCP for agents

Expose RepoPilot tools to Cursor, Claude Desktop, or any MCP client over stdio.

What MCP provides

The MCP server lets coding agents search your indexed repository, trace dependencies, run impact analysis, and ask questions — without leaving the editor. Tools call the same REST API the dashboard uses.

Run the MCP server

# Build API first
yarn --cwd api build

# Set repo context in api/.env (pick one):
MCP_REPO_SLUG=owner/repo
# MCP_REPOSITORY_ID=<uuid-from-dashboard-url>

# Optional auth when API requires it:
# MCP_API_KEY=<shared-secret>

yarn --cwd api mcp

Cursor configuration

Add to Cursor MCP settings (stdio transport):

{
  "mcpServers": {
    "repopilot": {
      "command": "node",
      "args": ["/path/to/repoPilot/api/dist/mcp/server.js"],
      "env": {
        "DATABASE_URL": "postgresql://...",
        "MCP_REPO_SLUG": "owner/repo"
      }
    }
  }
}

Or use the interactive setup panel below — it generates config snippets with your repository ID prefilled when signed in.

Interactive setup

MCP server config

{
  "mcpServers": {
    "repopilot": {
      "command": "yarn",
      "args": [
        "workspace",
        "@repopilot/api",
        "mcp"
      ],
      "env": {
        "DATABASE_URL": "<same as api/.env DATABASE_URL>",
        "MCP_REPO_SLUG": "owner/repo"
      }
    }
  }
}

Run from your RepoPilot monorepo root. Works with Cursor, Claude Desktop, and other MCP clients that accept the same JSON shape.

Setup

  1. Index the repository

    RepoPilot MCP reads from your indexed Postgres data. Open a repo in the dashboard and wait until indexing finishes before connecting an agent.

  2. Add the MCP server to Cursor

    In your RepoPilot checkout, copy .cursor/mcp.json.example to .cursor/mcp.json (or merge the repopilot block into Cursor Settings → MCP).

  3. Set environment variables

    Point DATABASE_URL at the same Neon database as api/.env. Set MCP_REPOSITORY_ID (from the dashboard URL) or MCP_REPO_SLUG (owner/repo). Optionally set MCP_API_KEY and pass apiKey in tool calls.

  4. Reload MCP in your editor

    Restart Cursor or run “MCP: Reload servers”. You should see repopilot with search, impact, dependency, history, ask, and context tools.

Available tools

  • search_codebase
    Lexical + semantic code search with citations
    search_codebase({ query: "auth middleware", repositoryId: "REPO_ID" })
  • find_impact
    Blast radius for a file change
    find_impact({ filePath: "src/auth.ts", repositoryId: "REPO_ID" })
  • trace_dependencies
    Module dependency traversal from a file
    trace_dependencies({ filePath: "src/auth.ts", repositoryId: "REPO_ID" })
  • search_history
    Git history search across indexed commits
    search_history({ query: "migrate auth", repositoryId: "REPO_ID" })
  • ask_repository
    Natural-language Q&A with evidence
    ask_repository({ query: "How does login work?", repositoryId: "REPO_ID" })
  • get_context_pack
    Structured context bundle for agent tasks
    get_context_pack({ filePath: "src/auth.ts", question: "what breaks if this changes?", repositoryId: "REPO_ID" })

Prefer the standalone page? Open /mcp →

Available tools

  • Search code chunks (lexical + semantic)
  • Query module and symbol dependencies
  • Impact analysis for a file path
  • Ask questions with file/line citations
  • Read architecture graph summaries

Ensure the repository is fully indexed before using MCP tools. Run Getting started steps or ./scripts/index-repo.sh first.