fix(install): write cwd to MCP server entry so clients find graph.db#352
Open
Devilthelegend wants to merge 2 commits into
Open
fix(install): write cwd to MCP server entry so clients find graph.db#352Devilthelegend wants to merge 2 commits into
Devilthelegend wants to merge 2 commits into
Conversation
3129c37 to
dc0ed89
Compare
dc0ed89 to
f35887f
Compare
Fixes tirth8205#325 MCP clients (Cursor, Claude Code, Windsurf, etc.) spawn the server process from their own working directory, not the project root. Without a cwd field, uvx/uv/poetry launches code-review-graph serve in the wrong directory and cannot locate .code-review-graph/graph.db. Fix: pass repo_root into _build_server_entry() and write cwd: str(repo_root) into every platform's server entry. Also fix test_install_codex_config to dynamically check command/args via _detect_serve_command() instead of hardcoded strings.
f35887f to
cfa68d8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #325
MCP clients (Cursor, Claude Code, Windsurf, etc.) spawn the server process from their own
working directory, not the project root. Without a
cwdfield,uvx/uv/poetrylaunchescode-review-graph servein the wrong directory and cannot locate.code-review-graph/graph.db.Root Cause
_build_server_entry()built the MCP server entry without acwdfield, so every platformconfig written by
code-review-graph installwas missing it.Changes
code_review_graph/skills.pyrepo_root: Pathparameter to_build_server_entry()"cwd": str(repo_root)into every platform's server entry(Claude Code, Cursor, Windsurf, Kiro, OpenCode, Qwen, Zed, Continue, Codex)
install_platform_configs()to passrepo_roottests/test_skills.pyassert entry["cwd"] == str(tmp_path)assertions to all platform install teststest_install_codex_configto dynamically checkcommand/argsvia_detect_serve_command()instead of hardcoded stringsResult
After this fix,
.mcp.jsonwill contain:{ "mcpServers": { "code-review-graph": { "command": "uvx", "args": ["code-review-graph", "serve"], "type": "stdio", "cwd": "/my/project" } } }Tests
67/67 tests passing.