|
| 1 | +# Manual test — global Cursor bridge via `mcp-remote` |
| 2 | + |
| 3 | +Regression check for the global `~/.cursor/mcp.json` bridge (see |
| 4 | +[`cursor-workspace-routing-bridge` planning doc](../planning/cursor-workspace-routing-bridge.md)). |
| 5 | + |
| 6 | +This path replaces per-repo `.cursor/mcp.json` header installs for Cursor by |
| 7 | +routing through `npx mcp-remote` with `${workspaceFolder}` in the bridge args. |
| 8 | + |
| 9 | +## Prerequisites |
| 10 | + |
| 11 | +- `pnpm dev:admin` (or production McpMux) with gateway on `localhost:45818`. |
| 12 | +- Node.js / `npx` available (for `mcp-remote`). |
| 13 | +- Two real workspace folders mapped to **different** FeatureSets in |
| 14 | + **Workspaces** (e.g. `~/proj/alpha` and `~/proj/beta`). |
| 15 | +- Cursor installed. |
| 16 | + |
| 17 | +## 1. Generate the global config |
| 18 | + |
| 19 | +1. Open **Connections** in McpMux. |
| 20 | +2. In **Global Cursor setup (no per-repo files)**, click **Generate global config**. |
| 21 | +3. Copy the snippet and paste it into `~/.cursor/mcp.json` (replace any existing |
| 22 | + `mcpmux` entry, or merge if you have other servers). |
| 23 | +4. Reload MCP in Cursor (**Settings → MCP → refresh**). |
| 24 | + |
| 25 | +**Expected:** Cursor connects via stdio (`npx mcp-remote`), not a direct HTTP URL. |
| 26 | +On first connect, McpMux may show **Name this machine** — approve it. |
| 27 | + |
| 28 | +## 2. Two-window routing |
| 29 | + |
| 30 | +1. Open folder A in one Cursor window, folder B in another. |
| 31 | +2. In each window, list mcpmux tools (or invoke `@mux`). |
| 32 | + |
| 33 | +**Expected:** |
| 34 | + |
| 35 | +- Window A sees only FeatureSet tools bound to folder A. |
| 36 | +- Window B sees only FeatureSet tools bound to folder B. |
| 37 | +- No cross-contamination (the bug when Cursor reports the wrong `roots`). |
| 38 | + |
| 39 | +## 3. Log verification |
| 40 | + |
| 41 | +Check the McpMux log (macOS: |
| 42 | +`~/Library/Application Support/com.mcpmux.desktop/logs/mcpmux.<date>.log`): |
| 43 | + |
| 44 | +- `[SessionRoots] pinned explicit workspace root from X-Mcpmux-Workspace header` |
| 45 | + with the correct path per session. |
| 46 | +- `[FeatureSetResolver] resolved via WorkspaceBinding workspace_root=…` matching |
| 47 | + each window's folder. |
| 48 | + |
| 49 | +## 4. Bridge flags sanity check |
| 50 | + |
| 51 | +Confirm the generated config includes: |
| 52 | + |
| 53 | +- `--allow-http` (gateway is loopback HTTP, not TLS). |
| 54 | +- `--header` with **no space** after the colon: |
| 55 | + `X-Mcpmux-Workspace:${workspaceFolder}`. |
| 56 | +- `Authorization:Bearer ${MCPMUX_API_KEY}` with the key in `env.MCPMUX_API_KEY`. |
| 57 | + |
| 58 | +To verify `mcp-remote` accepts these flags outside Cursor: |
| 59 | + |
| 60 | +```bash |
| 61 | +npx -y mcp-remote http://127.0.0.1:45818/mcp --allow-http \ |
| 62 | + --header "X-Mcpmux-Workspace:/path/to/folder" \ |
| 63 | + --header "Authorization:Bearer mcpk_…" |
| 64 | +``` |
| 65 | + |
| 66 | +The process should stay up and the gateway should log an incoming MCP session. |
| 67 | + |
| 68 | +## Fallback |
| 69 | + |
| 70 | +If `${workspaceFolder}` does not resolve correctly in your Cursor version, use the |
| 71 | +per-repo install path documented in |
| 72 | +[`workspace-header-routing.md`](./workspace-header-routing.md) section B. |
0 commit comments