@@ -30,6 +30,28 @@ constraint on which folder a session may claim, never a way to pick one — see
3030** Expected:** Cursor connects via stdio (` npx mcp-remote ` ), not a direct HTTP URL.
3131On first connect, McpMux may show ** Name this machine** — approve it.
3232
33+ ## 1b. Install the workspace hook
34+
35+ On the same result screen, click ** Install workspace hook** . That writes
36+ ` ~/.cursor/hooks/mcpmux-workspace-context.js ` and merges one ` preToolUse ` entry
37+ into ` ~/.cursor/hooks.json ` (backup: ` hooks.json.mcpmux-bak ` ). Unrelated hooks
38+ (including WakaTime) stay. If ` hooks.json ` is JSONC, the installer refuses and
39+ shows a copyable entry.
40+
41+ The hook injects ` _mcpmux_context ` on ` MCP:mcpmux_* ` calls when
42+ ` workspace_roots ` has exactly one path. The gateway uses that root for that
43+ ` tools/call ` only and never writes ` pinned ` or ` window_pins ` .
44+
45+ ** Expected:** gateway logs
46+ ` call_tool exact workspace context source=cursor_pre_tool_use ` with the
47+ agent's root and ` tool_use_id ` . Two concurrent agents on one ` mcp-session-id `
48+ should resolve to different bindings. ` tools/list ` stays the six core meta
49+ tools when the shared session is still ambiguous.
50+
51+ Cloud Agents do not load ` ~/.cursor/hooks.json ` . They stay on the rootless /
52+ ` mcpmux_set_workspace_root ` path. See
53+ [ ` cursor-agent-hooks-workspace-hint.md ` ] ( ../planning/cursor-agent-hooks-workspace-hint.md#cloud-agents-researched-aug-21 ) .
54+
3355## 2. Two-window routing
3456
35571 . Open folder A in one Cursor window, folder B in another.
0 commit comments