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
- MCP server hangs or loads infinitely when called
- When it responds, it reads an incorrect graph:
- Shows 45,637 nodes (JavaScript/TypeScript)
- Should show 476 nodes (Dart/Flutter project)
- Languages detected: javascript, typescript (incorrect)
- Should detect: dart, kotlin, swift, c, cpp
Root Cause Analysis
Based on code-review-graph source code analysis:
- MCP Server Configuration: The MCP server uses auto-detection of the current directory to find the repository root
- Repository Resolution: Without explicit
--repo parameter, the server walks up directories looking for .git
- Graph Storage: Each repository has its own graph database at
.code-review-graph/graph.db
- 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
- For AI Assistant: When code analysis is needed, ask the user to run CLI commands and use the output
- For Development: Use CLI direct commands in git hooks or pre-commit scripts
- Future Work: Consider using Memory MCP for domain-specific knowledge graph (users, courses, sessions, exercises) instead of code graph
References
Date
2026-04-10
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
uvx code-review-graph serveIssue Details
Symptoms
Root Cause Analysis
Based on code-review-graph source code analysis:
--repoparameter, the server walks up directories looking for.git.code-review-graph/graph.dbAttempted Solutions
Solution 1: Add
--repoParameter to MCP ConfigResult: Still reads incorrect graph. MCP server requires restart to load new config, but problem persists.
Solution 2: Point to
.code-review-graphDirectoryResult: 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 buildResult: 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:
Current MCP Configuration
Status: MCP server disabled. Use CLI direct instead.
Graph Statistics (Working CLI)
Recommendations
References
Date
2026-04-10