Skip to content

Commit bda7e04

Browse files
committed
docs(cursor-bridge): Phase 3 — Docs consolidation
Autonomous decisions: - Added global bridge as recommended path at top of workspace-header-routing.md — per-repo install stays as fallback sections A–B below - Linked manual regression doc from remote-access.mdx local Cursor subsection Signed-off-by: crimsonsunset <jsangio1@gmail.com>
1 parent e48885c commit bda7e04

4 files changed

Lines changed: 99 additions & 1 deletion

File tree

docs/guide/remote-access.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ By default, McpMux serves MCP on **loopback only** (`http://localhost:45818/mcp`
1515

1616
Local and remote MCP share the same gateway process. Remote clients use your **Public gateway URL**; local clients can keep using `localhost`.
1717

18+
### Local Cursor: global bridge vs direct HTTP
19+
20+
On the same machine, Cursor can connect via a **global** `~/.cursor/mcp.json` entry
21+
that spawns `npx mcp-remote` with `${workspaceFolder}` in the bridge args — no
22+
per-repo config files. Generate the snippet from **Connections → Global Cursor
23+
setup** in the desktop app. See
24+
[Cursor workspace bridge (manual test)](/docs/manual/cursor-workspace-bridge) for
25+
verification steps. The per-repo header install (Workspaces → Connect apps) remains
26+
the fallback when `npx` is unavailable.
27+
1828
## Recommended Layout
1929

2030
Use **two hostnames** — one for MCP traffic, one for the admin UI:
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
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.

docs/manual/workspace-header-routing.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,22 @@ state toggle, and the install panel (see _Automated tests_ at the end). The
1212
steps below verify the end-to-end behavior that automation can't — a real
1313
client connecting through the gateway.
1414

15+
## Recommended: global Cursor bridge (no per-repo files)
16+
17+
For Cursor on the same machine as McpMux, prefer the **global bridge** over
18+
per-repo `.cursor/mcp.json` installs:
19+
20+
1. **Connections → Global Cursor setup** — generate and copy the
21+
`~/.cursor/mcp.json` snippet (uses `npx mcp-remote` with
22+
`${workspaceFolder}` in bridge args).
23+
2. Paste into `~/.cursor/mcp.json`, reload MCP in Cursor.
24+
3. Follow the regression steps in
25+
[`cursor-workspace-bridge.md`](./cursor-workspace-bridge.md).
26+
27+
This avoids maintaining a `.cursor/mcp.json` + `.gitignore` entry in every
28+
repo. The per-repo install path below (sections A–B) remains a supported
29+
fallback when you cannot use `npx`/`mcp-remote`.
30+
1531
## Prerequisites
1632

1733
- `pnpm dev` (desktop app + gateway) running.

docs/planning/cursor-workspace-routing-bridge.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Cursor Workspace Routing via Global `mcp-remote` Bridge
22

33
**Last Updated:** Jul 20, 2026
4-
**Status:** Phase 1 complete — GO for Phase 2
4+
**Status:** Complete (Phases 1–3 on `dev-rebased`)
55
**Branch:** `dev-rebased`
66

77
### Phase 1 spike results (Jul 20, 2026)

0 commit comments

Comments
 (0)