在cursor出现因为stdio类型的MCP没有传递正确的当前项目目录地址,而出现.git目录寻址错误
我在cursor内使用最新的memorix时,总是出错,cursor MCP的报错日志如下:
2026-04-10 18:12:38.562 [info] [V2] Handling CreateClient action
2026-04-10 18:12:38.562 [info] [V2 FSM] connection:connect_start: conn=idle,auth=unknown -> conn=connecting,auth=unknown
2026-04-10 18:12:39.735 [error] [memorix] Starting with cwd: C:\Users\pc
[memorix] Unable to establish a reliable git-backed project context.
[memorix] Memorix now refuses to silently fall back to untracked/* in stdio mode.
[memorix] ❌ No git project could be resolved from the current workspace. Open the repo root, pass --cwd, or use an MCP client that sends workspace roots.
undefined
2026-04-10 18:12:39.835 [warning] Connection failed: MCP error -32000: Connection closed
2026-04-10 18:12:39.838 [warning] [V2 FSM] connection:connect_failure: conn=connecting,auth=unknown -> conn=failed,auth=unknown
2026-04-10 18:12:39.839 [info] CreateClient completed, connected: false, statusType: error
2026-04-10 18:22:16.074 [info] [V2] Handling CreateClient action
2026-04-10 18:22:16.074 [info] [V2 FSM] connection:connect_start: conn=idle,auth=unknown -> conn=connecting,auth=unknown
2026-04-10 18:22:18.600 [error] [memorix] Starting with cwd: C:\Users\pc
[memorix] Unable to establish a reliable git-backed project context.
[memorix] Memorix now refuses to silently fall back to untracked/* in stdio mode.
[memorix] ❌ No git project could be resolved from the current workspace. Open the repo root, pass --cwd, or use an MCP client that sends workspace roots.
undefined
2026-04-10 18:22:19.031 [warning] Connection failed: MCP error -32000: Connection closed
2026-04-10 18:22:19.031 [warning] [V2 FSM] connection:connect_failure: conn=connecting,auth=unknown -> conn=failed,auth=unknown
2026-04-10 18:22:19.031 [info] CreateClient completed, connected: false, statusType: error
2026-04-10 22:33:34.423 [info] [V2] Handling DeleteClient action, reason: config_server_removed
主要是 No git project could be resolved from the current workspace. Open the repo root, pass --cwd, or use an MCP client that sends workspace roots. 这一部分,让我很疑惑,岂不是我们的 memorix MCP,都要以项目局部MCP的形式来提供 --cwd 参数么?我很怀疑是memorix当前的寻址逻辑有问题了。之前没问题的,不知道升级到第几个版本出现这些情况的。
我用opus是这样反馈的:
memorix 配置在全局的 ~/.cursor/mcp.json 中,Cursor 启动 stdio 类型的 MCP 服务器时,进程的工作目录固定为用户主目录 C:\Users\pc,而不是当前打开的项目目录。memorix v1.0.6 在 stdio 模式下强制要求能解析到 git 仓库,从 C:\Users\pc 显然找不到 .git,所以直接拒绝启动。
这不是 memorix 的 bug,而是 Cursor 启动全局 MCP 进程时不传递 workspace root 的已知行为限制。
是不是cursor才会出现这样的问题呢?其他AI客户端也遇到过类似的问题么?
我现在的全局cursor MCP是这样配置MCP的:
{
"memorix": {
"command": "memorix",
"args": ["serve"]
}
}
这个配置现在过时了么?
Thanks for reporting this. We’ve confirmed this is a real project-binding/path-resolution issue in the stdio MCP flow, and we plan to address it in the upcoming v1.0.7 release line. We’ll fix it together with the current project-context/control-plane hardening work so stdio clients bind the correct project more reliably.
我这边有着类似的问题,使用一些比较小众的ide的时候,在更新1.0.6之前都是可以正常使用的,更新之后就显示MCP error -32000: Connection closed
Fixed in v1.0.7 memorix serve now enters deferred-binding mode instead of process.exit(1) when no git project is detected from cwd. The server starts normally, registers all MCP tools, and automatically binds the project via MCP roots protocol (Cursor sends workspace roots) or via memorix_session_start with projectRoot. For non-git directories, use \memorix serve --allow-untracked\ to enable untracked/ fallback. This fixes both global MCP configs (cwd = user home) and small IDEs that don't pass workspace roots.