Skip to content

# Code-Review-Graph MCP Issue with Windsurf #209

@efwerqgqebh53bhq4

Description

@efwerqgqebh53bhq4

Problem Description

The MCP server for code-review-graph does not work correctly with Windsurf IDE. The server hangs/loads indefinitely and reads an incorrect graph (JavaScript/TypeScript) instead of the project's Flutter/Dart graph.

Environment

Issue Details

Symptoms

  1. MCP server hangs or loads infinitely when called
  2. When it responds, it reads an incorrect graph:
    • Shows 45,637 nodes (JavaScript/TypeScript)
    • Should show 476 nodes (Dart/Flutter project)
  3. Languages detected: javascript, typescript (incorrect)
  4. Should detect: dart, kotlin, swift, c, cpp

Root Cause Analysis

Based on code-review-graph source code analysis:

  1. MCP Server Configuration: The MCP server uses auto-detection of the current directory to find the repository root
  2. Repository Resolution: Without explicit --repo parameter, the server walks up directories looking for .git
  3. Graph Storage: Each repository has its own graph database at .code-review-graph/graph.db
  4. Multi-Repo System: code-review-graph has a multi-repository registry, but the MCP server doesn't use it by default

Attempted Solutions

Solution 1: Add --repo Parameter to MCP Config

"code-review-graph": {
  "args": [
    "code-review-graph",
    "serve",
    "--repo",
    "C:\\Users\\.....................anonymous" (but point to the project folder)
  ],
  "command": "uvx",
  "disabled": false
}

Result: Still reads incorrect graph. MCP server requires restart to load new config, but problem persists.

Solution 2: Point to .code-review-graph Directory

"code-review-graph": {
  "args": [
    "code-review-graph",
    "serve",
    "--repo",
    "C:\\Users\\.......anonymous.......\\.code-review-graph"
  ],
  "command": "uvx",
  "disabled": false
}

Result: Directory doesn't exist. MCP requires a valid git repository (with .git) to function.

Solution 3: Multi-Repository Registry

python -m code_review_graph register .
python -m code_review_graph build

Result: CLI works perfectly (476 nodes, 916 edges), but MCP server still reads incorrect global graph.

Working Solution

CLI Direct Usage (Recommended)

The CLI direct usage works perfectly and is reliable:

# Register repository
python -m code_review_graph register .

# Build initial graph
python -m code_review_graph build

# Update graph after changes
python -m code_review_graph update

# View statistics
python -m code_review_graph status

# Detect change impact (for code review)
python -m code_review_graph detect-changes

# Generate visualization
python -m code_review_graph visualize

# Generate wiki documentation
python -m code_review_graph wiki

Current MCP Configuration

"code-review-graph": {
  "args": [
    "code-review-graph",
    "serve"
  ],
  "command": "uvx",
  "disabled": true
}

Status: MCP server disabled. Use CLI direct instead.

Graph Statistics (Working CLI)

Nodes: 476
Edges: 916
Files: 99
Languages: kotlin, swift, c, dart, cpp
Last updated: 2026-04-10T15:06:53
Built on branch: master
Built at commit: 673e0b548e7e

Recommendations

  1. For AI Assistant: When code analysis is needed, ask the user to run CLI commands and use the output
  2. For Development: Use CLI direct commands in git hooks or pre-commit scripts
  3. Future Work: Consider using Memory MCP for domain-specific knowledge graph (users, courses, sessions, exercises) instead of code graph

References

Date

2026-04-10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions