← Back to Integrations

CLI Agents

Connect Claude Code, OpenAI Codex, Gemini CLI, and other MCP-aware command-line agents directly to your index.

CLI agents operate headless, but still require structural intelligence when modifying your project. Connecting SourcePrep locally allows them to execute semantic searches and assess blast radiuses without leaving the command line. Claude Code is the primary target; Codex and Gemini CLI use the same MCP server.

Integration Setup

Select your Terminal AI agent below. Update the respective configuration file with the provided JSON block to register SourcePrep as an MCP tool. Ensure the SourcePrep daemon is running (prep serve) before starting a chat session in the terminal.

claude — my-project

What an MCP-aware CLI agent looks like calling prep_search mid-session.

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. Same JSON works for Claude Desktop — drop it into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%/Claude/ (Windows) under "mcpServers" instead of "servers".

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.

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).