How to Configure the MCP Server for AI Coding Platforms (Cursor, Claude Code, Windsurf)
Configure the MCP server for AI coding platforms by running crg install --platform <name> or manually editing the platform-specific JSON configuration files defined in code_review_graph/skills.py.
The Code Review Graph project provides native integration with Cursor, Claude Code, and Windsurf through a standardized MCP (Meta-Coding Protocol) server configuration. Each platform stores its MCP settings in a specific JSON file that the AI client reads on startup. This guide covers both automated installation via CLI and manual configuration, with reference to the actual source implementation in tirth8205/code-review-graph.
Platform-Specific Configuration Locations
All supported platforms are defined in the PLATFORMS dictionary in code_review_graph/skills.py. This mapping determines where each AI client expects its MCP configuration:
| Platform | Config File Path | JSON Key | Detection Logic |
|---|---|---|---|
| Cursor | <repo-root>/.cursor/mcp.json |
mcpServers |
~/.cursor exists |
| Claude Code | <repo-root>/.mcp.json |
mcpServers |
always true |
| Windsurf | ~/.codeium/windsurf/mcp_config.json |
mcpServers |
~/.codeium/windsurf exists |
The detect lambda for each platform prevents accidental configuration on systems where the AI client isn't installed. Claude Code uses always true because it has no fixed installation directory to check.
MCP Server Configuration Format
The MCP configuration follows a simple JSON schema that registers one or more MCP servers with the AI platform:
{
"mcpServers": [
{
"url": "http://127.0.0.1:8000/mcp/",
"type": "fastmcp"
}
]
}
Both Cursor and Claude Code use object format, meaning the configuration is a standard JSON object. The mcpServers array can contain multiple server entries if you're running multiple MCP services.
Automated Installation with crg install
The crg install command in code_review_graph/main.py provides the fastest way to configure any supported platform.
Basic Usage
# Install for Cursor (requires ~/.cursor to exist)
crg install --platform cursor
# Install for Claude Code (works in any repository)
crg install --platform claude
# Install for Windsurf (requires ~/.codeium/windsurf to exist)
crg install --platform windsurf
What the Installer Does
- Resolves the configuration path via
skills.PLATFORMS[<name>]["config_path"](repo_root) - Calls
install_platform_config()incode_review_graph/main.pyto generate the MCP entry - Writes JSON under the platform-specific key while preserving existing user data
The installer's safety guarantee is implemented in install_platform_config() — it only adds the mcpServers entry if missing, never overwriting custom configurations.
Generated Claude Code Configuration
After running crg install --platform claude, your repository root contains .mcp.json:
{
"mcpServers": [
{
"url": "http://127.0.0.1:8000/mcp/",
"type": "fastmcp"
}
]
}
Manual Configuration Methods
Programmatic Configuration (Python)
Access platform metadata directly from code_review_graph/skills.py for custom installation workflows:
from pathlib import Path
import json
from code_review_graph.skills import PLATFORMS
repo_root = Path.cwd()
# Get Cursor's configuration path
cursor_cfg = PLATFORMS["cursor"]["config_path"](repo_root)
# Define the MCP server entry
mcp_entry = {
"url": "http://127.0.0.1:8000/mcp/",
"type": "fastmcp"
}
# Write configuration with safety checks
if not cursor_cfg.exists():
cursor_cfg.parent.mkdir(parents=True, exist_ok=True)
with cursor_cfg.open("w") as f:
json.dump({PLATFORMS["cursor"]["key"]: [mcp_entry]}, f, indent=2)
The PLATFORMS["cursor"]["key"] resolves to "mcpServers", ensuring consistency with the platform's expected schema.
Manual File Editing for Windsurf
Windsurf stores its configuration in the user's home directory rather than the repository:
# Open the configuration file
open "$HOME/.codeium/windsurf/mcp_config.json"
Add or modify the mcpServers array using the same schema:
{
"mcpServers": [
{
"url": "http://127.0.0.1:8000/mcp/",
"type": "fastmcp"
}
]
}
If the file doesn't exist, create the parent directory first: mkdir -p ~/.codeium/windsurf.
Extending Platform Support
To add a new AI coding platform, modify the PLATFORMS dictionary in code_review_graph/skills.py:
PLATFORMS = {
# ... existing entries ...
"newplatform": {
"name": "New Platform",
"config_path": lambda repo_root: Path.home() / ".newplatform" / "mcp.json",
"key": "mcpServers",
"format": "object",
"detect": lambda: (Path.home() / ".newplatform").exists(),
},
}
The required fields match the structure used by Cursor, Claude Code, and Windsurf: human-readable name, path-resolving config_path, JSON key, file format, and detect predicate.
Key Implementation Files
Understanding these source files helps with debugging and extending MCP configuration:
code_review_graph/skills.py— DefinesPLATFORMSmapping with paths, keys, and detection logic for all AI platformscode_review_graph/main.py— Containsinstall_platform_config()helper used bycrg installCLI commandcode_review_graph/prompts.py— MCP prompt templates that AI platforms use when querying the graphcode_review_graph/tools/analysis_tools.py— MCP-wrapped analysis utilities exposed to configured platforms
Summary
crg install --platform <name>automates MCP configuration for Cursor, Claude Code, and Windsurf- Platform detection prevents configuration on systems without the AI client installed
- All paths and keys are centralized in
PLATFORMSdictionary incode_review_graph/skills.py - The installer preserves existing configurations — it only adds missing
mcpServersentries - Manual configuration uses standard JSON with
urlandtypefields under the platform-specific key - Extending support requires only adding a new entry to
PLATFORMSwith path, key, format, and detect logic
Frequently Asked Questions
What is the MCP server URL for Code Review Graph?
The default MCP server runs at http://127.0.0.1:8000/mcp/ with "type": "fastmcp". This is automatically configured by crg install or the install_platform_config() helper in code_review_graph/main.py.
Why does Windsurf use a different configuration path than Cursor and Claude Code?
According to code_review_graph/skills.py, Windsurf follows Codeium's convention of storing configuration in ~/.codeium/windsurf/mcp_config.json rather than the repository root. This is determined by the platform's upstream design — the PLATFORMS["windsurf"]["config_path"] lambda resolves to the home directory, not the repo root.
Does crg install overwrite my existing MCP configuration?
No. The install_platform_config() function in code_review_graph/main.py specifically checks for existing mcpServers entries and only adds the Code Review Graph server if it's not already present. Your existing servers remain untouched.
Can I use multiple AI platforms simultaneously with the same Code Review Graph instance?
Yes. Run crg install for each platform you use, or manually configure each platform's JSON file. All will point to the same MCP server URL (http://127.0.0.1:8000/mcp/), allowing any configured AI client to access the graph analysis tools defined in code_review_graph/tools/analysis_tools.py.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →