Cursor MCP launches Gortex from home directory, causing entry-point handshake failure
Problem definition
When Cursor uses the Gortex MCP integration, the process can start with current working directory set to the user home (~/) instead of the opened project root. This causes Gortex MCP startup to fail at the strict entry-point handshake.
Observed logs (from Cursor MCP):
2026-05-07 17:10:06.303 [info] [V2 FSM] connection:connect_start: conn=idle,auth=unknown -> conn=connecting,auth=unknown
2026-05-07 17:10:06.303 [error] [gortex] MCP handshake failed: not a Gortex entry point: /Users/adrian is neither a workspace root (containing .gortex/workspace.toml) nor a project root (containing .gortex/). There is no walk-up. Run `gortex init` here to bind this directory as a single-project root, or create .gortex/workspace.toml to bind it as a workspace root
Error: not a Gortex entry point: /Users/adrian is neither a workspace root (containing .gortex/workspace.toml) nor a project root (containing .gortex/). There is no walk-up. Run `gortex init` here to bind this directory as a single-project root, or create .gortex/workspace.toml to bind it as a workspace root
undefined
Probable root cause
gortex installcurrently writes a global Cursor MCP config at~/.cursor/mcp.json.- The default MCP entry uses
gortex mcp --index . --watch. - When Cursor starts this global entry without project-scoped cwd,
.resolves to~/. - Proxy/handshake code currently derives session cwd from
os.Getwd(), so daemon routing also inherits this wrong cwd. - Gortex correctly rejects startup because
~/is not a valid Gortex entry point.
Suggested implementations
-
Prefer project-local MCP for Cursor
- Do not write
~/.cursor/mcp.jsonby default (or for Cursor specifically). - Keep
.cursor/mcp.jsonas the primary integration path viagortex init.
- Do not write
-
Make global Cursor MCP daemon-only if retained
- For global installs, use
gortex mcp --proxy(or equivalent daemon-only mode) instead of--index .. - Avoid any cwd-relative index target in global config.
- For global installs, use
-
Harden cwd detection in proxy handshake
- Prefer editor-provided workspace env vars (e.g.
CURSOR_WORKSPACE) overos.Getwd()when available. - Fallback to
os.Getwd()only when no workspace signal exists.
- Prefer editor-provided workspace env vars (e.g.
-
Improve install UX/docs
- Document that global Cursor MCP with
--index .can bind to home cwd and fail strict handshake. - Recommend daemon + per-project MCP as default multi-repo setup.
- Document that global Cursor MCP with
Expected behavior
- Opening a project in Cursor should not fail MCP startup due to home-directory cwd.
- Gortex MCP should consistently resolve repo context from the active project workspace, or proxy through daemon without cwd-relative indexing.
Gortex is installed via homebrew through the curl install script. Cursor is running as the IDE not the console. One thing I found out later is that there are 2 MCPs installed when opening a project like labrador, for example. One is the global MCP and the other one is the MCP from the project. Both are configured the same way, but the global one usually wins precedence unless it's manually disabled and the project one enabled. The project one works without any issue. I've started just working off one project tracking all the other related ones and adding them to a workspace. Before I was also trying to run the MCP from my ~/Projects directory which is where I have all the repos.