Body:
Problem
MCP servers that need to know the workspace root (e.g. codegraph, filesystem server, git server) cannot auto-detect the current project. Every tool call must manually include a projectPath parameter, or the MCP config must hardcode --path — which breaks multi-project workflows.
Steps to reproduce
Configure config.json with a codegraph MCP server:
"mcp": ["codegraph=codegraph serve --mcp"]
Start Reasonix in a project that has .codegraph/ initialized.
Ask the agent to run codegraph_codegraph_status (without explicit projectPath).
Actual behavior
Error: Tool execution failed: CodeGraph not initialized for this project.
Run 'codegraph init' first.
The error persists even after restarting Reasonix.
Expected behavior
The codegraph MCP server should auto-detect the project from rootUri, just as it does when manually sending an MCP initialize with rootUri set.
Root cause
Reasonix does not include rootUri (or workspaceFolders) in the MCP initialize request. The codegraph MCP server's handleInitialize falls back to process.cwd(), which is not the project directory — causing findNearestCodeGraphRoot to fail.
Proof — manually spawning the same server with rootUri works perfectly:
// Send initialize WITH rootUri → works
{ method: "initialize", params: { rootUri: "file:///D:/Projects/..." } }
// → codegraph_status returns 197 files ✓
// Send initialize WITHOUT rootUri + wrong cwd → fails
{ method: "initialize", params: {} }
// → "CodeGraph not initialized" ✗
Suggested fix
In the MCP client implementation, pass workspaceDir (from config.json) as rootUri in the initialize request:
{
"method": "initialize",
"params": {
"protocolVersion": "2024-11-05",
"rootUri": "file:///D:/Projects/aiProject/SimpleBaseProject",
"capabilities": { ... },
"clientInfo": { ... }
}
}
Alternatively, set the MCP subprocess cwd to workspaceDir as a fallback.
Impact
Affects all MCP servers that rely on rootUri for workspace context (codegraph, filesystem, git, etc.). Currently the only workaround is passing path parameters manually on every call or hardcoding paths per project.
Body:
Problem
MCP servers that need to know the workspace root (e.g. codegraph, filesystem server, git server) cannot auto-detect the current project. Every tool call must manually include a projectPath parameter, or the MCP config must hardcode --path — which breaks multi-project workflows.
Steps to reproduce
Configure config.json with a codegraph MCP server:
"mcp": ["codegraph=codegraph serve --mcp"]
Start Reasonix in a project that has .codegraph/ initialized.
Ask the agent to run codegraph_codegraph_status (without explicit projectPath).
Actual behavior
Error: Tool execution failed: CodeGraph not initialized for this project.
Run 'codegraph init' first.
The error persists even after restarting Reasonix.
Expected behavior
The codegraph MCP server should auto-detect the project from rootUri, just as it does when manually sending an MCP initialize with rootUri set.
Root cause
Reasonix does not include rootUri (or workspaceFolders) in the MCP initialize request. The codegraph MCP server's handleInitialize falls back to process.cwd(), which is not the project directory — causing findNearestCodeGraphRoot to fail.
Proof — manually spawning the same server with rootUri works perfectly:
// Send initialize WITH rootUri → works
{ method: "initialize", params: { rootUri: "file:///D:/Projects/..." } }
// → codegraph_status returns 197 files ✓
// Send initialize WITHOUT rootUri + wrong cwd → fails
{ method: "initialize", params: {} }
// → "CodeGraph not initialized" ✗
Suggested fix
In the MCP client implementation, pass workspaceDir (from config.json) as rootUri in the initialize request:
{
"method": "initialize",
"params": {
"protocolVersion": "2024-11-05",
"rootUri": "file:///D:/Projects/aiProject/SimpleBaseProject",
"capabilities": { ... },
"clientInfo": { ... }
}
}
Alternatively, set the MCP subprocess cwd to workspaceDir as a fallback.
Impact
Affects all MCP servers that rely on rootUri for workspace context (codegraph, filesystem, git, etc.). Currently the only workaround is passing path parameters manually on every call or hardcoding paths per project.