# How to Set Up code-review-graph with Cursor, Claude Code, and VS Code

> Easily set up code-review-graph with Cursor, Claude Code, and VS Code using a single install command. Auto-detects AI tools and creates local code graphs for efficient queries.

- Repository: [Tirth Kanani/code-review-graph](https://github.com/tirth8205/code-review-graph)
- Tags: how-to-guide
- Published: 2026-08-09

---

**You configure code-review-graph by running a single install command that auto-detects your AI coding tools and writes Model Context Protocol (MCP) JSON files, enabling each editor to query a local code graph instead of scanning entire repositories.**

The `code-review-graph` repository provides a graph-based code review system that integrates with popular AI coding assistants through standardized MCP configurations. Setting up the tool for different editors requires installing platform-specific configuration files that expose graph-aware commands to your AI assistant. This guide covers the exact file paths, CLI commands, and verification steps needed to connect Cursor, Claude Code, and VS Code to your local code graph.

## How the Auto-Detection Installer Works

When you run `code-review-graph install`, the CLI automatically detects which AI coding tools are present on your machine and writes the appropriate MCP configuration files. According to the repository source code, the installer performs three core operations: it detects installed platforms, writes tool-specific MCP JSON files to standard configuration locations, and optionally installs native hook scripts or skills where supported.

If you prefer to configure only a specific platform, the `--platform` flag restricts the installation to a single tool while leaving other configurations untouched. This modular approach ensures you can incrementally adopt the graph review system across different editors without conflicts.

## Platform-Specific Configuration Paths

Each AI coding tool reads MCP configuration from a specific location defined in the README Quick Start section (lines 71-88) and the USAGE guide (lines 24-43). The following table shows exactly where `code-review-graph` writes its configuration for each supported platform:

| Platform | MCP Config Location | Additional Files |
|----------|---------------------|------------------|
| **Cursor** | `~/.cursor/mcp.json` | None required |
| **Claude Code** | [`.mcp.json`](https://github.com/tirth8205/code-review-graph/blob/main/.mcp.json) (project root) | [`.claude/settings.json`](https://github.com/tirth8205/code-review-graph/blob/main/.claude/settings.json) and skills under `.claude/skills/` |
| **VS Code (GitHub Copilot)** | [`.vscode/mcp.json`](https://github.com/tirth8205/code-review-graph/blob/main/.vscode/mcp.json) | Copilot-specific skill files under `.vscode/` |

All three configurations follow the same JSON schema and expose identical **graph-aware commands** including `detect_changes_tool`, `get_review_context_tool`, and `query_graph_tool`.

## Step-by-Step Setup for Each AI Tool

### Cursor Setup

Cursor requires only the MCP configuration file to communicate with the graph server. The installer writes to `~/.cursor/mcp.json` and requires no additional hooks or skills.

```bash

# Install only Cursor configuration

code-review-graph install --platform cursor

# Verify the configuration

cat ~/.cursor/mcp.json

```

After installation, restart Cursor. The AI assistant will automatically query the local graph when you request code reviews, receiving token-efficient context instead of full file scans.

### Claude Code Setup

Claude Code uses a dual-configuration system. The installer writes both a project-level [`.mcp.json`](https://github.com/tirth8205/code-review-graph/blob/main/.mcp.json) file and editor-specific settings to [`.claude/settings.json`](https://github.com/tirth8205/code-review-graph/blob/main/.claude/settings.json), with additional skills placed under `.claude/skills/`.

```bash

# Install only Claude Code configuration

code-review-graph install --platform claude-code

# Verify both configuration files

cat .mcp.json
cat .claude/settings.json

```

Open the Claude Code chat and ask "Review my recent changes". The client reads [`.mcp.json`](https://github.com/tirth8205/code-review-graph/blob/main/.mcp.json) and forwards the request to the local `code-review-graph serve` process, which returns minimal, relevant context derived from the graph structure.

### VS Code with GitHub Copilot Setup

For VS Code using GitHub Copilot, the installer writes to [`.vscode/mcp.json`](https://github.com/tirth8205/code-review-graph/blob/main/.vscode/mcp.json) and places Copilot-specific skill files in the `.vscode/` directory.

```bash

# Install only VS Code/Copilot configuration

code-review-graph install --platform copilot

# Verify the configuration

cat .vscode/mcp.json

```

Invoke Copilot with a prompt like "Show me the impact of this PR". Copilot reads the MCP configuration and queries the graph server implemented in [`code_review_graph/tools/query.py`](https://github.com/tirth8205/code-review-graph/blob/main/code_review_graph/tools/query.py) to receive contextual review data.

## Building and Serving the Code Graph

Before any AI tool can query the graph, you must build it using Tree-sitter parsers. This process creates a SQLite database stored under `.code-review-graph/` in your project root.

```bash

# Build the graph (run once, or re-run when code changes significantly)

code-review-graph build

# Start the MCP server (runs continuously to serve AI tool requests)

code-review-graph serve

```

The `code-review-graph serve` command starts a local process that handles MCP requests from all configured editors. Because the graph is built once and stored locally, each AI coding tool—whether Cursor, Claude Code, or VS Code—receives the same structured data without re-parsing the repository.

## Verifying Your Configuration

Regardless of which AI coding tool you use, the generated MCP JSON follows a consistent schema. Verify your setup by examining the configuration file for your platform:

```bash

# Claude Code

cat .mcp.json

# Cursor  

cat ~/.cursor/mcp.json

# VS Code

cat .vscode/mcp.json

```

Each file contains a similar command block:

```json
{
  "command": "code-review-graph",
  "args": ["serve", "--tools", "query_graph_tool,detect_changes_tool,get_review_context_tool"]
}

```

This configuration tells the AI assistant how to invoke the local graph server and which tools are available for code review operations.

## Summary

- **Run `code-review-graph install`** to auto-detect and configure all supported AI coding tools, or use `--platform cursor`, `--platform claude-code`, or `--platform copilot` for specific setups.
- **Configuration locations vary by tool**: Cursor uses `~/.cursor/mcp.json`, Claude Code uses [`.mcp.json`](https://github.com/tirth8205/code-review-graph/blob/main/.mcp.json) plus [`.claude/settings.json`](https://github.com/tirth8205/code-review-graph/blob/main/.claude/settings.json), and VS Code uses [`.vscode/mcp.json`](https://github.com/tirth8205/code-review-graph/blob/main/.vscode/mcp.json).
- **Build the graph first** with `code-review-graph build` before serving; the SQLite graph stored in `.code-review-graph/` powers all AI assistant queries.
- **All platforms share the same MCP schema** and access identical tools like `query_graph_tool` defined in [`code_review_graph/tools/query.py`](https://github.com/tirth8205/code-review-graph/blob/main/code_review_graph/tools/query.py), ensuring consistent behavior across editors.

## Frequently Asked Questions

### What is the Model Context Protocol (MCP) in code-review-graph?

The Model Context Protocol is a JSON-based configuration standard that allows AI coding tools to communicate with local servers. In `code-review-graph`, MCP files tell Cursor, Claude Code, and VS Code how to invoke the `code-review-graph serve` process and which graph-query tools are available, enabling the AI to request specific code context rather than scanning entire files.

### Can I use code-review-graph with multiple AI editors simultaneously?

Yes. The SQLite graph built by `code-review-graph build` is tool-agnostic, and the `serve` process can handle concurrent requests from multiple MCP clients. You can install configurations for Cursor, Claude Code, and VS Code in the same project, and all three tools will query the same local graph database without conflicts.

### Where does code-review-graph store the parsed code graph?

The graph is stored as a SQLite database under the `.code-review-graph/` directory in your project root. This database is generated by Tree-sitter parsers when you run `code-review-graph build`, and the `code-review-graph serve` process reads from this database to answer queries from your AI coding tools.

### How do I update the graph when my codebase changes?

Run `code-review-graph build` again to re-parse modified files and update the SQLite graph. For active development, you can use `code-review-graph watch` (if available in your version) to automatically rebuild the graph when files change, ensuring your AI coding tools always query current code structure.