From c9eabee3ffb8b147a2abf65af5b31788fdc6a7de Mon Sep 17 00:00:00 2001 From: rr-develop Date: Sat, 5 Dec 2026 13:02:32 +0100 Subject: [PATCH 1/6] install: windsurf client writes the Devin user MCP file Devin Desktop documents its user MCP file at ~/.config/devin/mcp_config.json, and the Devin CLI reads the same file. The Windsurf path the installer used (~/.codeium/windsurf/mcp_config.json) is still imported by the CLI until it is removed, so existing installs keep working. The Windows location is inferred from the CLI's %APPDATA%\devin configuration directory. Co-Authored-By: Claude Haiku 5.5 Signed-off-by: rr-develop --- docs/features/integrations/mcp-clients.md | 15 +++++++++------ server/identity/app/token_clients.py | 9 ++++++--- tests/unit/test_cli_install.py | 13 +++++++++++++ 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/docs/features/integrations/mcp-clients.md b/docs/features/integrations/mcp-clients.md index c36a2f91185..7ec1f4bbfca 100644 --- a/docs/features/integrations/mcp-clients.md +++ b/docs/features/integrations/mcp-clients.md @@ -118,7 +118,7 @@ that only reads can use a `viewer` token; see | `cursor` | `~/.cursor/mcp.json` | `mcpServers` | `url` + `headers` | | `vscode` | `~/.config/Code/User/mcp.json` (default Stable profile; `settings.json` is left alone); [use with Copilot](vscode.md#editor-profile-entry) | `servers` | `url` + `headers` + `type: "http"` | | `cline` | `~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json` | `mcpServers` | `npx mcp-remote` bridge | -| `windsurf` | `~/.codeium/windsurf/mcp_config.json` | `mcpServers` | `url` + `headers` | +| `windsurf` | `~/.config/devin/mcp_config.json` (Windows: `%APPDATA%\devin\mcp_config.json`) | `mcpServers` | `url` + `headers` | | `zed` | `~/.config/zed/settings.json` | `context_servers` | `url` + `headers` | | `gemini` | `~/.gemini/settings.json` | `mcpServers` | `httpUrl` + `headers` (Gemini CLI reads streamable HTTP from `httpUrl`) | | `opencode` | `~/.config/opencode/opencode.json`, or `opencode.jsonc` when that is the file there (`$OPENCODE_CONFIG_DIR` or `$XDG_CONFIG_HOME/opencode` when set) | `mcp.servers` | `type: "remote"` + `url` + `headers` | @@ -343,11 +343,14 @@ assuming a hand-written entry is accepted by every version. `enabled` in Muse's means configured, not connected. Devin CLI's [native configuration](https://docs.devin.ai/cli/extensibility/mcp/configuration) -uses the dedicated user file in the table. The tested CLI also reads -`~/.codeium/windsurf/mcp_config.json` through its default -[Windsurf import](https://docs.devin.ai/cli/reference/configuration/read-config-from). -`loom install --client windsurf` writes that imported file; disabling -`read_config_from.windsurf` removes that route from Devin. The CLI check wrote a native +and the Devin Desktop [MCP page](https://docs.devin.ai/desktop/cascade/mcp) both name the +user file in the table, so `loom install --client windsurf` writes that file. Installs made +before this change wrote `~/.codeium/windsurf/mcp_config.json`; the CLI still imports that file +by default through its [Windsurf import](https://docs.devin.ai/cli/reference/configuration/read-config-from), +so the old entry stays until it is removed or `read_config_from.windsurf` is set to `false`. +Devin Desktop's [FAQ](https://docs.devin.ai/desktop/devin-desktop-faq) lists +`~/.codeium/mcp_config.json` as the MCP config instead; Desktop itself was not run, so the +Desktop path rests on the MCP page. The CLI check wrote a native entry and listed distinct disabled entries from both files; it did not connect to Loom. Current [Devin Local documentation](https://docs.devin.ai/desktop/devin-local/customizations) describes shared CLI configuration discovery; Desktop itself was not run. diff --git a/server/identity/app/token_clients.py b/server/identity/app/token_clients.py index 088feb14b05..fb86ce62901 100644 --- a/server/identity/app/token_clients.py +++ b/server/identity/app/token_clients.py @@ -49,10 +49,13 @@ "linux": "~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json", # noqa: E501 "win32": "%APPDATA%\\Code\\User\\globalStorage\\saoudrizwan.claude-dev\\settings\\cline_mcp_settings.json", # noqa: E501 }, + # Windsurf is now Devin Desktop; its user MCP file is ~/.config/devin/mcp_config.json + # (docs.devin.ai/desktop/cascade/mcp, scope "User"). The Devin CLI reads the same file. + # The Windows location is inferred from the CLI's %APPDATA%\devin config directory. "windsurf": { - "darwin": "~/.codeium/windsurf/mcp_config.json", - "linux": "~/.codeium/windsurf/mcp_config.json", - "win32": "%USERPROFILE%\\.codeium\\windsurf\\mcp_config.json", + "darwin": "~/.config/devin/mcp_config.json", + "linux": "~/.config/devin/mcp_config.json", + "win32": "%APPDATA%\\devin\\mcp_config.json", }, "zed": { "darwin": "~/.config/zed/settings.json", diff --git a/tests/unit/test_cli_install.py b/tests/unit/test_cli_install.py index e5afd6c11ba..72ee29ab8f1 100644 --- a/tests/unit/test_cli_install.py +++ b/tests/unit/test_cli_install.py @@ -1788,3 +1788,16 @@ def test_install_with_no_client_wires_opencode_when_its_config_dir_exists( assert cli._cmd_install(p.parse_args(["--token", "T", "--server-url", "https://h"])) == 0 written = json.loads((tmp_path / "config" / "opencode" / "opencode.json").read_text()) assert written["mcp"]["servers"]["loom"] == _opencode_entry("T") + + +@pytest.mark.parametrize("platform", ["linux", "darwin"]) +def test_windsurf_install_targets_the_devin_user_file( + tmp_path, monkeypatch: pytest.MonkeyPatch, platform: str +) -> None: + """Windsurf is now Devin Desktop, whose user MCP file is ~/.config/devin/mcp_config.json + (docs.devin.ai/desktop/cascade/mcp); the old ~/.codeium/windsurf path is not read by it.""" + monkeypatch.setenv("HOME", str(tmp_path)) + monkeypatch.setattr(sys, "platform", platform) + assert ( + cli._resolve_install_path("windsurf") == tmp_path / ".config" / "devin" / "mcp_config.json" + ) From 2476f8d90872f36a0322697cf9c3d088793aec20 Mon Sep 17 00:00:00 2001 From: rr-develop Date: Sun, 6 Dec 2026 00:26:52 +0100 Subject: [PATCH 2/6] install: keep the legacy Windsurf file while only it exists Windsurf's user MCP file moved to ~/.config/devin/mcp_config.json. An install still wrote only the new path, which broke people on the legacy editor whose config is ~/.codeium/windsurf/mcp_config.json. Use the legacy file while the new one does not exist and the old one does. Co-Authored-By: Claude Haiku 5.5 Signed-off-by: rr-develop --- server/cli/install.py | 27 ++++++++++++++++++++++----- tests/unit/test_cli_install.py | 17 +++++++++++++++++ 2 files changed, 39 insertions(+), 5 deletions(-) diff --git a/server/cli/install.py b/server/cli/install.py index f9754fa90f5..23ab2df62e7 100644 --- a/server/cli/install.py +++ b/server/cli/install.py @@ -51,6 +51,22 @@ } +# Config files a client used before it moved. Used only while the new file does not exist +# and the old one does, so an install keeps writing where the legacy editor reads. +_LEGACY_INSTALL_CLIENTS: dict[str, dict[str, str]] = { + "windsurf": { + "darwin": "~/.codeium/windsurf/mcp_config.json", + "linux": "~/.codeium/windsurf/mcp_config.json", + "win32": "%USERPROFILE%\\.codeium\\windsurf\\mcp_config.json", + }, +} + + +def _expand_config_path(raw: str) -> Path: + # Expand both ~ (home) and %ENV% (Windows) forms regardless of host OS. + return Path(os.path.expandvars(os.path.expanduser(raw))) + + def _resolve_install_path(client: str) -> Path: """Map (client, current OS) → expanded config file path.""" if client == "opencode": @@ -59,11 +75,12 @@ def _resolve_install_path(client: str) -> Path: osname = sys.platform # Unknown platforms fall back to the linux convention. key = "darwin" if osname == "darwin" else "win32" if osname == "win32" else "linux" - raw = spec[key] - # Expand both ~ (home) and %ENV% (Windows) forms regardless of host OS. - raw = os.path.expanduser(raw) - raw = os.path.expandvars(raw) - return Path(raw) + path = _expand_config_path(spec[key]) + if client in _LEGACY_INSTALL_CLIENTS and not path.exists(): + legacy = _expand_config_path(_LEGACY_INSTALL_CLIENTS[client][key]) + if legacy.exists(): + return legacy + return path # The files OpenCode's `mcp add --global` looks for in its config directory, in its diff --git a/tests/unit/test_cli_install.py b/tests/unit/test_cli_install.py index 72ee29ab8f1..899e08995d0 100644 --- a/tests/unit/test_cli_install.py +++ b/tests/unit/test_cli_install.py @@ -1801,3 +1801,20 @@ def test_windsurf_install_targets_the_devin_user_file( assert ( cli._resolve_install_path("windsurf") == tmp_path / ".config" / "devin" / "mcp_config.json" ) + + +def test_windsurf_install_keeps_the_legacy_file_while_only_it_exists( + tmp_path, monkeypatch: pytest.MonkeyPatch +) -> None: + """A user still on the legacy Windsurf editor keeps their install: the old file is used + until the new one exists.""" + monkeypatch.setenv("HOME", str(tmp_path)) + monkeypatch.setattr(sys, "platform", "linux") + legacy = tmp_path / ".codeium" / "windsurf" / "mcp_config.json" + legacy.parent.mkdir(parents=True) + legacy.write_text("{}") + assert cli._resolve_install_path("windsurf") == legacy + new = tmp_path / ".config" / "devin" / "mcp_config.json" + new.parent.mkdir(parents=True) + new.write_text("{}") + assert cli._resolve_install_path("windsurf") == new From 1cd8f4fc148daa2b9d19181b9422ef3b9ec20bbb Mon Sep 17 00:00:00 2001 From: rr-develop Date: Sun, 6 Dec 2026 00:48:04 +0100 Subject: [PATCH 3/6] install: detect and install to the legacy Windsurf file when only its directory exists The legacy fallback applied only once the legacy file existed, so a home with only ~/.codeium/windsurf/ was not detected and an explicit --client windsurf wrote the Devin file. Use the legacy path while the Devin directory is absent and the legacy file or its directory is present. Co-Authored-By: Claude Haiku 5.5 Signed-off-by: rr-develop --- server/cli/install.py | 8 ++++---- tests/unit/test_cli_install.py | 36 +++++++++++++++++++++++----------- 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/server/cli/install.py b/server/cli/install.py index 23ab2df62e7..a869a994062 100644 --- a/server/cli/install.py +++ b/server/cli/install.py @@ -51,8 +51,8 @@ } -# Config files a client used before it moved. Used only while the new file does not exist -# and the old one does, so an install keeps writing where the legacy editor reads. +# Config files a client used before it moved. Used only while the client's new location +# is absent and the old one is present, so detection and installs reach the legacy editor. _LEGACY_INSTALL_CLIENTS: dict[str, dict[str, str]] = { "windsurf": { "darwin": "~/.codeium/windsurf/mcp_config.json", @@ -76,9 +76,9 @@ def _resolve_install_path(client: str) -> Path: # Unknown platforms fall back to the linux convention. key = "darwin" if osname == "darwin" else "win32" if osname == "win32" else "linux" path = _expand_config_path(spec[key]) - if client in _LEGACY_INSTALL_CLIENTS and not path.exists(): + if client in _LEGACY_INSTALL_CLIENTS and not path.parent.exists(): legacy = _expand_config_path(_LEGACY_INSTALL_CLIENTS[client][key]) - if legacy.exists(): + if legacy.exists() or legacy.parent.exists(): return legacy return path diff --git a/tests/unit/test_cli_install.py b/tests/unit/test_cli_install.py index 899e08995d0..bef60092aac 100644 --- a/tests/unit/test_cli_install.py +++ b/tests/unit/test_cli_install.py @@ -1803,18 +1803,32 @@ def test_windsurf_install_targets_the_devin_user_file( ) -def test_windsurf_install_keeps_the_legacy_file_while_only_it_exists( - tmp_path, monkeypatch: pytest.MonkeyPatch +@pytest.mark.parametrize( + ("legacy_file", "legacy_dir", "devin_dir", "expected"), + [ + (True, True, False, "legacy"), # legacy editor installed, Devin not + (False, True, False, "legacy"), # only the legacy directory exists: still detected + (True, True, True, "devin"), # Devin installed too: Devin wins + (False, False, True, "devin"), + (False, False, False, "devin"), # nothing installed: the new default + ], +) +def test_windsurf_install_path_prefers_devin_only_when_devin_is_present( + tmp_path, + monkeypatch: pytest.MonkeyPatch, + legacy_file: bool, + legacy_dir: bool, + devin_dir: bool, + expected: str, ) -> None: - """A user still on the legacy Windsurf editor keeps their install: the old file is used - until the new one exists.""" monkeypatch.setenv("HOME", str(tmp_path)) monkeypatch.setattr(sys, "platform", "linux") + if legacy_dir: + (tmp_path / ".codeium" / "windsurf").mkdir(parents=True) + if legacy_file: + (tmp_path / ".codeium" / "windsurf" / "mcp_config.json").write_text("{}") + if devin_dir: + (tmp_path / ".config" / "devin").mkdir(parents=True) legacy = tmp_path / ".codeium" / "windsurf" / "mcp_config.json" - legacy.parent.mkdir(parents=True) - legacy.write_text("{}") - assert cli._resolve_install_path("windsurf") == legacy - new = tmp_path / ".config" / "devin" / "mcp_config.json" - new.parent.mkdir(parents=True) - new.write_text("{}") - assert cli._resolve_install_path("windsurf") == new + devin = tmp_path / ".config" / "devin" / "mcp_config.json" + assert cli._resolve_install_path("windsurf") == (legacy if expected == "legacy" else devin) From 3f35e53517ac545dcf94f7e72f5b39d5d059ec23 Mon Sep 17 00:00:00 2001 From: rr-develop Date: Sun, 6 Dec 2026 02:05:57 +0100 Subject: [PATCH 4/6] mcp: give Devin its own client; windsurf keeps the Windsurf editor's file The Windsurf entry pointed at the Devin user file, so a legacy Windsurf install was not detected and the token setup disagreed with `loom install`. Keep `windsurf` on ~/.codeium/windsurf/mcp_config.json and add a `devin` client for ~/.config/devin/mcp_config.json. Both token setups and the installer now name the same file per client; the legacy fallback in the installer is removed. Co-Authored-By: Claude Haiku 5.5 Signed-off-by: rr-develop --- docs/features/integrations/mcp-clients.md | 15 +++---- frontend/src/lib/clientSetups.fixture.json | 48 ++++++++++++++++++++++ frontend/src/lib/clients.ts | 2 + server/cli/install.py | 27 +++--------- server/identity/app/token_clients.py | 7 +++- tests/unit/snapshots/cli_help.json | 4 +- tests/unit/snapshots/cli_tree.json | 1 + tests/unit/test_cli_install.py | 41 +++++------------- tests/unit/test_token_mint.py | 1 + 9 files changed, 83 insertions(+), 63 deletions(-) diff --git a/docs/features/integrations/mcp-clients.md b/docs/features/integrations/mcp-clients.md index 7ec1f4bbfca..b637477c1de 100644 --- a/docs/features/integrations/mcp-clients.md +++ b/docs/features/integrations/mcp-clients.md @@ -93,7 +93,7 @@ loom install --client cursor --server-url https://loom.example.com --token "$LOO | Flag | Default | Meaning | | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -| `--client` | every supported client whose config directory exists (Gemini CLI: its `settings.json` or the `gemini` binary, since Google Antigravity also creates `~/.gemini/`; OpenCode: `~/.config/opencode/`) | one or more of `claude-desktop`, `claude-code`, `codex`, `cursor`, `vscode`, `cline`, `windsurf`, `zed`, `gemini`, `opencode`, `kiro` | +| `--client` | every supported client whose config directory exists (Gemini CLI: its `settings.json` or the `gemini` binary, since Google Antigravity also creates `~/.gemini/`; OpenCode: `~/.config/opencode/`) | one or more of `claude-desktop`, `claude-code`, `codex`, `cursor`, `vscode`, `cline`, `windsurf`, `devin`, `zed`, `gemini`, `opencode`, `kiro` | | `--server-url` | `LOOM_BASE_URL`, then `~/.loom/config.json`, else `http://localhost:7777` | the Loom base URL; the entry points at `/mcp` | | `--token` | `LOOM_API_KEY`, then `~/.loom/config.json`, then `~/.loom/token` | the JWT the entry authenticates with; required | | `--name` | `loom` | the server key in the config file, and the name `claude mcp add` / `codex mcp add` registers | @@ -118,7 +118,8 @@ that only reads can use a `viewer` token; see | `cursor` | `~/.cursor/mcp.json` | `mcpServers` | `url` + `headers` | | `vscode` | `~/.config/Code/User/mcp.json` (default Stable profile; `settings.json` is left alone); [use with Copilot](vscode.md#editor-profile-entry) | `servers` | `url` + `headers` + `type: "http"` | | `cline` | `~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json` | `mcpServers` | `npx mcp-remote` bridge | -| `windsurf` | `~/.config/devin/mcp_config.json` (Windows: `%APPDATA%\devin\mcp_config.json`) | `mcpServers` | `url` + `headers` | +| `windsurf` | `~/.codeium/windsurf/mcp_config.json` (Windows: `%USERPROFILE%\.codeium\windsurf\mcp_config.json`) | `mcpServers` | `url` + `headers` | +| `devin` | `~/.config/devin/mcp_config.json` (Windows: `%APPDATA%\devin\mcp_config.json`) | `mcpServers` | `url` + `headers` | | `zed` | `~/.config/zed/settings.json` | `context_servers` | `url` + `headers` | | `gemini` | `~/.gemini/settings.json` | `mcpServers` | `httpUrl` + `headers` (Gemini CLI reads streamable HTTP from `httpUrl`) | | `opencode` | `~/.config/opencode/opencode.json`, or `opencode.jsonc` when that is the file there (`$OPENCODE_CONFIG_DIR` or `$XDG_CONFIG_HOME/opencode` when set) | `mcp.servers` | `type: "remote"` + `url` + `headers` | @@ -276,7 +277,7 @@ reload the client afterwards. | Kilo Code (extension and CLI) | `kilo.jsonc` in the project, or `~/.config/kilo/kilo.jsonc` | `{"mcp": {"loom": {"type": "remote", "url": "URL", "headers": {…}}}}` | connected (CLI) | | [Cline CLI](#use-shared-memory-in-cline-cli) | `~/.cline/data/settings/cline_mcp_settings.json` | `cline mcp add loom URL --transport http --header "Authorization: Bearer " --yes` (the Cline extension: [`loom install`](#what-it-writes-per-client)) | verified read | | Google Antigravity | `~/.gemini/config/mcp_config.json`, or `.agents/mcp_config.json` in the workspace | `{"mcpServers": {"loom": {"serverUrl": "URL", "headers": {…}}}}` (`url` also works) | | -| Devin Desktop and Devin CLI | `.devin/mcp_config.local.json` in the project (git-ignored, for the token), or `~/.config/devin/mcp_config.json` | `{"mcpServers": {"loom": {"url": "URL", "transport": "http", "headers": {…}}}}` (`loom install --client windsurf` writes the older `~/.codeium/windsurf/` path) | accepted (CLI 3000.12.57 configuration only); Desktop unmeasured | +| Devin Desktop and Devin CLI | `.devin/mcp_config.local.json` in the project (git-ignored, for the token), or `~/.config/devin/mcp_config.json` | `{"mcpServers": {"loom": {"url": "URL", "transport": "http", "headers": {…}}}}` (`loom install --client devin` writes this path; `--client windsurf` writes the older `~/.codeium/windsurf/` one) | accepted (CLI 3000.12.57 configuration only); Desktop unmeasured | | Qwen Code | `~/.qwen/settings.json`, or `.qwen/settings.json` | `qwen mcp add --transport http loom URL --header "Authorization: Bearer "` | connected (`qwen mcp list`) | | Kimi Code CLI | `~/.kimi-code/mcp.json`, or `.kimi-code/mcp.json` in the working directory (read once the folder is trusted); or `/mcp-config` in the TUI | `{"mcpServers": {"loom": {"url": "URL", "headers": {…}}}}`, or `"bearerTokenEnvVar": "LOOM_API_KEY"` in place of `headers` | installed (2.5.3); MCP status unmeasured | | Grok Build | `~/.grok/config.toml`, or `.grok/config.toml`; below those it also reads a project `.mcp.json`, `~/.claude.json` and `.cursor/mcp.json`, so an existing Claude Code or Cursor entry is picked up (`[compat.claude] mcps = false` and `[compat.cursor] mcps = false` turn that off) | `grok mcp add --transport http loom URL --header "Authorization: Bearer "` | accepted (1.0.77); connection unmeasured | @@ -344,10 +345,10 @@ means configured, not connected. Devin CLI's [native configuration](https://docs.devin.ai/cli/extensibility/mcp/configuration) and the Devin Desktop [MCP page](https://docs.devin.ai/desktop/cascade/mcp) both name the -user file in the table, so `loom install --client windsurf` writes that file. Installs made -before this change wrote `~/.codeium/windsurf/mcp_config.json`; the CLI still imports that file -by default through its [Windsurf import](https://docs.devin.ai/cli/reference/configuration/read-config-from), -so the old entry stays until it is removed or `read_config_from.windsurf` is set to `false`. +user file in the table, so `loom install --client devin` writes that file. `loom install --client windsurf` writes the +legacy Windsurf editor's `~/.codeium/windsurf/mcp_config.json`, which the CLI still imports by +default through its [Windsurf import](https://docs.devin.ai/cli/reference/configuration/read-config-from), +so an entry written there stays until it is removed or `read_config_from.windsurf` is set to `false`. Devin Desktop's [FAQ](https://docs.devin.ai/desktop/devin-desktop-faq) lists `~/.codeium/mcp_config.json` as the MCP config instead; Desktop itself was not run, so the Desktop path rests on the MCP page. The CLI check wrote a native diff --git a/frontend/src/lib/clientSetups.fixture.json b/frontend/src/lib/clientSetups.fixture.json index 8a1fb5c18b5..96be0119ad3 100644 --- a/frontend/src/lib/clientSetups.fixture.json +++ b/frontend/src/lib/clientSetups.fixture.json @@ -112,6 +112,22 @@ "command": "", "env": {} }, + "devin": { + "config_key": "mcpServers", + "config": { + "mcpServers": { + "loom": { + "url": "http://x/mcp", + "headers": { + "Authorization": "Bearer T" + } + } + } + }, + "config_toml": "", + "command": "", + "env": {} + }, "zed": { "config_key": "context_servers", "config": { @@ -278,6 +294,22 @@ "command": "", "env": {} }, + "devin": { + "config_key": "mcpServers", + "config": { + "mcpServers": { + "loom": { + "url": "http://x/mcp?a=1", + "headers": { + "Authorization": "Bearer T" + } + } + } + }, + "config_toml": "", + "command": "", + "env": {} + }, "zed": { "config_key": "context_servers", "config": { @@ -458,6 +490,22 @@ "command": "", "env": {} }, + "devin": { + "config_key": "mcpServers", + "config": { + "mcpServers": { + "loom": { + "url": "http://x/mcp?mytoolset=x", + "headers": { + "Authorization": "Bearer T" + } + } + } + }, + "config_toml": "", + "command": "", + "env": {} + }, "zed": { "config_key": "context_servers", "config": { diff --git a/frontend/src/lib/clients.ts b/frontend/src/lib/clients.ts index 86ca092a57b..4adddbdd6ea 100644 --- a/frontend/src/lib/clients.ts +++ b/frontend/src/lib/clients.ts @@ -16,6 +16,7 @@ export type ClientId = | "vscode" | "cline" | "windsurf" + | "devin" | "zed" | "gemini" | "opencode"; @@ -33,6 +34,7 @@ export const CLIENTS: MCPClient[] = [ { id: "vscode", label: "VS Code" }, { id: "cline", label: "Cline" }, { id: "windsurf", label: "Windsurf" }, + { id: "devin", label: "Devin" }, { id: "zed", label: "Zed" }, { id: "gemini", label: "Gemini CLI" }, { id: "opencode", label: "OpenCode" }, diff --git a/server/cli/install.py b/server/cli/install.py index a869a994062..f9754fa90f5 100644 --- a/server/cli/install.py +++ b/server/cli/install.py @@ -51,22 +51,6 @@ } -# Config files a client used before it moved. Used only while the client's new location -# is absent and the old one is present, so detection and installs reach the legacy editor. -_LEGACY_INSTALL_CLIENTS: dict[str, dict[str, str]] = { - "windsurf": { - "darwin": "~/.codeium/windsurf/mcp_config.json", - "linux": "~/.codeium/windsurf/mcp_config.json", - "win32": "%USERPROFILE%\\.codeium\\windsurf\\mcp_config.json", - }, -} - - -def _expand_config_path(raw: str) -> Path: - # Expand both ~ (home) and %ENV% (Windows) forms regardless of host OS. - return Path(os.path.expandvars(os.path.expanduser(raw))) - - def _resolve_install_path(client: str) -> Path: """Map (client, current OS) → expanded config file path.""" if client == "opencode": @@ -75,12 +59,11 @@ def _resolve_install_path(client: str) -> Path: osname = sys.platform # Unknown platforms fall back to the linux convention. key = "darwin" if osname == "darwin" else "win32" if osname == "win32" else "linux" - path = _expand_config_path(spec[key]) - if client in _LEGACY_INSTALL_CLIENTS and not path.parent.exists(): - legacy = _expand_config_path(_LEGACY_INSTALL_CLIENTS[client][key]) - if legacy.exists() or legacy.parent.exists(): - return legacy - return path + raw = spec[key] + # Expand both ~ (home) and %ENV% (Windows) forms regardless of host OS. + raw = os.path.expanduser(raw) + raw = os.path.expandvars(raw) + return Path(raw) # The files OpenCode's `mcp add --global` looks for in its config directory, in its diff --git a/server/identity/app/token_clients.py b/server/identity/app/token_clients.py index fb86ce62901..8d2bc2def15 100644 --- a/server/identity/app/token_clients.py +++ b/server/identity/app/token_clients.py @@ -49,10 +49,15 @@ "linux": "~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json", # noqa: E501 "win32": "%APPDATA%\\Code\\User\\globalStorage\\saoudrizwan.claude-dev\\settings\\cline_mcp_settings.json", # noqa: E501 }, + "windsurf": { + "darwin": "~/.codeium/windsurf/mcp_config.json", + "linux": "~/.codeium/windsurf/mcp_config.json", + "win32": "%USERPROFILE%\\.codeium\\windsurf\\mcp_config.json", + }, # Windsurf is now Devin Desktop; its user MCP file is ~/.config/devin/mcp_config.json # (docs.devin.ai/desktop/cascade/mcp, scope "User"). The Devin CLI reads the same file. # The Windows location is inferred from the CLI's %APPDATA%\devin config directory. - "windsurf": { + "devin": { "darwin": "~/.config/devin/mcp_config.json", "linux": "~/.config/devin/mcp_config.json", "win32": "%APPDATA%\\devin\\mcp_config.json", diff --git a/tests/unit/snapshots/cli_help.json b/tests/unit/snapshots/cli_help.json index 7acda9d829c..d5e8fc496d9 100644 --- a/tests/unit/snapshots/cli_help.json +++ b/tests/unit/snapshots/cli_help.json @@ -590,8 +590,8 @@ "options: -h, --help show this help message and exit" ], "loom install": [ - "usage: loom install [-h] [--client {claude-desktop,claude-code,codex,cursor,vscode,cline,windsurf,zed,gemini,opencode,kiro} [{claude-desktop,claude-code,codex,cursor,vscode,cline,windsurf,zed,gemini,opencode,kiro} ...]] [--server-url SERVER_URL] [--token TOKEN] [--name NAME] [--toolset TOOLSET] [--dry-run] [--force]", - "options: -h, --help show this help message and exit --client {claude-desktop,claude-code,codex,cursor,vscode,cline,windsurf,zed,gemini,opencode,kiro} [{claude-desktop,claude-code,codex,cursor,vscode,cline,windsurf,zed,gemini,opencode,kiro} ...] Which client(s) to wire. Omit to auto-detect and wire every supported client found on this machine. --server-url SERVER_URL Loom server URL (default LOOM_BASE_URL, else http://localhost:7777). --token TOKEN JWT to embed in the client config. Defaults to LOOM_API_KEY, then ~/.loom/token. Use `loom mint-token` to generate one. --name NAME Server name: the key under mcpServers (cursor) or servers (vscode), and the name `claude mcp add` / `codex mcp add` registers. --toolset TOOLSET MCP toolset the client lists, as `?toolset=` on the URL; when omitted, `coding` for claude-code, codex, cursor, gemini, opencode, else the server default (LOOM_MCP_TOOLSET). --dry-run Print what would be written without touching the file. --force claude-code: add the user-scope MCP entry even when the loom plugin is installed (it mounts the server itself; both = every tool listed twice)." + "usage: loom install [-h] [--client {claude-desktop,claude-code,codex,cursor,vscode,cline,windsurf,devin,zed,gemini,opencode,kiro} [{claude-desktop,claude-code,codex,cursor,vscode,cline,windsurf,devin,zed,gemini,opencode,kiro} ...]] [--server-url SERVER_URL] [--token TOKEN] [--name NAME] [--toolset TOOLSET] [--dry-run] [--force]", + "options: -h, --help show this help message and exit --client {claude-desktop,claude-code,codex,cursor,vscode,cline,windsurf,devin,zed,gemini,opencode,kiro} [{claude-desktop,claude-code,codex,cursor,vscode,cline,windsurf,devin,zed,gemini,opencode,kiro} ...] Which client(s) to wire. Omit to auto-detect and wire every supported client found on this machine. --server-url SERVER_URL Loom server URL (default LOOM_BASE_URL, else http://localhost:7777). --token TOKEN JWT to embed in the client config. Defaults to LOOM_API_KEY, then ~/.loom/token. Use `loom mint-token` to generate one. --name NAME Server name: the key under mcpServers (cursor) or servers (vscode), and the name `claude mcp add` / `codex mcp add` registers. --toolset TOOLSET MCP toolset the client lists, as `?toolset=` on the URL; when omitted, `coding` for claude-code, codex, cursor, gemini, opencode, else the server default (LOOM_MCP_TOOLSET). --dry-run Print what would be written without touching the file. --force claude-code: add the user-scope MCP entry even when the loom plugin is installed (it mounts the server itself; both = every tool listed twice)." ], "loom demo": [ "usage: loom demo [-h] [--file FILE] [--question QUESTION] [--tags TAGS] [--base-url BASE_URL] [--token TOKEN] [--org ORG] [--namespace NAMESPACE] [--root ROOT] [--search-only]", diff --git a/tests/unit/snapshots/cli_tree.json b/tests/unit/snapshots/cli_tree.json index d04ecf56059..e7cf714cd64 100644 --- a/tests/unit/snapshots/cli_tree.json +++ b/tests/unit/snapshots/cli_tree.json @@ -17582,6 +17582,7 @@ "vscode", "cline", "windsurf", + "devin", "zed", "gemini", "opencode", diff --git a/tests/unit/test_cli_install.py b/tests/unit/test_cli_install.py index bef60092aac..2f235d3fbeb 100644 --- a/tests/unit/test_cli_install.py +++ b/tests/unit/test_cli_install.py @@ -1791,44 +1791,23 @@ def test_install_with_no_client_wires_opencode_when_its_config_dir_exists( @pytest.mark.parametrize("platform", ["linux", "darwin"]) -def test_windsurf_install_targets_the_devin_user_file( +def test_windsurf_install_targets_its_own_user_file( tmp_path, monkeypatch: pytest.MonkeyPatch, platform: str ) -> None: - """Windsurf is now Devin Desktop, whose user MCP file is ~/.config/devin/mcp_config.json - (docs.devin.ai/desktop/cascade/mcp); the old ~/.codeium/windsurf path is not read by it.""" monkeypatch.setenv("HOME", str(tmp_path)) monkeypatch.setattr(sys, "platform", platform) assert ( - cli._resolve_install_path("windsurf") == tmp_path / ".config" / "devin" / "mcp_config.json" + cli._resolve_install_path("windsurf") + == tmp_path / ".codeium" / "windsurf" / "mcp_config.json" ) -@pytest.mark.parametrize( - ("legacy_file", "legacy_dir", "devin_dir", "expected"), - [ - (True, True, False, "legacy"), # legacy editor installed, Devin not - (False, True, False, "legacy"), # only the legacy directory exists: still detected - (True, True, True, "devin"), # Devin installed too: Devin wins - (False, False, True, "devin"), - (False, False, False, "devin"), # nothing installed: the new default - ], -) -def test_windsurf_install_path_prefers_devin_only_when_devin_is_present( - tmp_path, - monkeypatch: pytest.MonkeyPatch, - legacy_file: bool, - legacy_dir: bool, - devin_dir: bool, - expected: str, +@pytest.mark.parametrize("platform", ["linux", "darwin"]) +def test_devin_install_targets_the_devin_user_file( + tmp_path, monkeypatch: pytest.MonkeyPatch, platform: str ) -> None: + """Windsurf is now Devin Desktop, whose user MCP file is ~/.config/devin/mcp_config.json + (docs.devin.ai/desktop/cascade/mcp); the Windsurf file is not read by it.""" monkeypatch.setenv("HOME", str(tmp_path)) - monkeypatch.setattr(sys, "platform", "linux") - if legacy_dir: - (tmp_path / ".codeium" / "windsurf").mkdir(parents=True) - if legacy_file: - (tmp_path / ".codeium" / "windsurf" / "mcp_config.json").write_text("{}") - if devin_dir: - (tmp_path / ".config" / "devin").mkdir(parents=True) - legacy = tmp_path / ".codeium" / "windsurf" / "mcp_config.json" - devin = tmp_path / ".config" / "devin" / "mcp_config.json" - assert cli._resolve_install_path("windsurf") == (legacy if expected == "legacy" else devin) + monkeypatch.setattr(sys, "platform", platform) + assert cli._resolve_install_path("devin") == tmp_path / ".config" / "devin" / "mcp_config.json" diff --git a/tests/unit/test_token_mint.py b/tests/unit/test_token_mint.py index 58c1dc43ae5..29684b9ada9 100644 --- a/tests/unit/test_token_mint.py +++ b/tests/unit/test_token_mint.py @@ -114,6 +114,7 @@ async def test_the_default_token_follows_live_grants_and_drops_org_wide_roles( "vscode", "cline", "windsurf", + "devin", "zed", "gemini", "opencode", From 941e2bf3a3442e76cfb4eaf14c6c852b8cc5ecb2 Mon Sep 17 00:00:00 2001 From: rr-develop Date: Sun, 6 Dec 2026 04:02:53 +0100 Subject: [PATCH 5/6] docs: format the MCP clients page with prettier 3.9.9 Co-Authored-By: Claude Haiku 5.5 Signed-off-by: rr-develop --- docs/features/integrations/mcp-clients.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/features/integrations/mcp-clients.md b/docs/features/integrations/mcp-clients.md index b637477c1de..19e328f9630 100644 --- a/docs/features/integrations/mcp-clients.md +++ b/docs/features/integrations/mcp-clients.md @@ -91,15 +91,15 @@ and Codex, runs their `mcp add` command: loom install --client cursor --server-url https://loom.example.com --token "$LOOM_API_KEY" ``` -| Flag | Default | Meaning | -| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -| `--client` | every supported client whose config directory exists (Gemini CLI: its `settings.json` or the `gemini` binary, since Google Antigravity also creates `~/.gemini/`; OpenCode: `~/.config/opencode/`) | one or more of `claude-desktop`, `claude-code`, `codex`, `cursor`, `vscode`, `cline`, `windsurf`, `devin`, `zed`, `gemini`, `opencode`, `kiro` | -| `--server-url` | `LOOM_BASE_URL`, then `~/.loom/config.json`, else `http://localhost:7777` | the Loom base URL; the entry points at `/mcp` | -| `--token` | `LOOM_API_KEY`, then `~/.loom/config.json`, then `~/.loom/token` | the JWT the entry authenticates with; required | -| `--name` | `loom` | the server key in the config file, and the name `claude mcp add` / `codex mcp add` registers | -| `--toolset` | empty: `coding` for Claude Code, Codex, Cursor, Gemini CLI and OpenCode, else the server default (`LOOM_MCP_TOOLSET`) | appended as `?toolset=`; a toolset name or a `+` union of curated rosters such as `coding+tracker`; anything else is rejected before writing | -| `--dry-run` | off | print what would be written or run, touching nothing | -| `--force` | off | Claude Code only: add the user-scope entry even when the `loom` plugin is installed | +| Flag | Default | Meaning | +| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | +| `--client` | every supported client whose config directory exists (Gemini CLI: its `settings.json` or the `gemini` binary, since Google Antigravity also creates `~/.gemini/`; OpenCode: `~/.config/opencode/`) | one or more of `claude-desktop`, `claude-code`, `codex`, `cursor`, `vscode`, `cline`, `windsurf`, `devin`, `zed`, `gemini`, `opencode`, `kiro` | +| `--server-url` | `LOOM_BASE_URL`, then `~/.loom/config.json`, else `http://localhost:7777` | the Loom base URL; the entry points at `/mcp` | +| `--token` | `LOOM_API_KEY`, then `~/.loom/config.json`, then `~/.loom/token` | the JWT the entry authenticates with; required | +| `--name` | `loom` | the server key in the config file, and the name `claude mcp add` / `codex mcp add` registers | +| `--toolset` | empty: `coding` for Claude Code, Codex, Cursor, Gemini CLI and OpenCode, else the server default (`LOOM_MCP_TOOLSET`) | appended as `?toolset=`; a toolset name or a `+` union of curated rosters such as `coding+tracker`; anything else is rejected before writing | +| `--dry-run` | off | print what would be written or run, touching nothing | +| `--force` | off | Claude Code only: add the user-scope entry even when the `loom` plugin is installed | Restart the client afterwards. Exit codes: `2` no token, `5` no client detected, `1` any client failed (the others still run). See the [CLI reference](../../reference/cli.md). @@ -118,7 +118,7 @@ that only reads can use a `viewer` token; see | `cursor` | `~/.cursor/mcp.json` | `mcpServers` | `url` + `headers` | | `vscode` | `~/.config/Code/User/mcp.json` (default Stable profile; `settings.json` is left alone); [use with Copilot](vscode.md#editor-profile-entry) | `servers` | `url` + `headers` + `type: "http"` | | `cline` | `~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json` | `mcpServers` | `npx mcp-remote` bridge | -| `windsurf` | `~/.codeium/windsurf/mcp_config.json` (Windows: `%USERPROFILE%\.codeium\windsurf\mcp_config.json`) | `mcpServers` | `url` + `headers` | +| `windsurf` | `~/.codeium/windsurf/mcp_config.json` (Windows: `%USERPROFILE%\.codeium\windsurf\mcp_config.json`) | `mcpServers` | `url` + `headers` | | `devin` | `~/.config/devin/mcp_config.json` (Windows: `%APPDATA%\devin\mcp_config.json`) | `mcpServers` | `url` + `headers` | | `zed` | `~/.config/zed/settings.json` | `context_servers` | `url` + `headers` | | `gemini` | `~/.gemini/settings.json` | `mcpServers` | `httpUrl` + `headers` (Gemini CLI reads streamable HTTP from `httpUrl`) | @@ -277,7 +277,7 @@ reload the client afterwards. | Kilo Code (extension and CLI) | `kilo.jsonc` in the project, or `~/.config/kilo/kilo.jsonc` | `{"mcp": {"loom": {"type": "remote", "url": "URL", "headers": {…}}}}` | connected (CLI) | | [Cline CLI](#use-shared-memory-in-cline-cli) | `~/.cline/data/settings/cline_mcp_settings.json` | `cline mcp add loom URL --transport http --header "Authorization: Bearer " --yes` (the Cline extension: [`loom install`](#what-it-writes-per-client)) | verified read | | Google Antigravity | `~/.gemini/config/mcp_config.json`, or `.agents/mcp_config.json` in the workspace | `{"mcpServers": {"loom": {"serverUrl": "URL", "headers": {…}}}}` (`url` also works) | | -| Devin Desktop and Devin CLI | `.devin/mcp_config.local.json` in the project (git-ignored, for the token), or `~/.config/devin/mcp_config.json` | `{"mcpServers": {"loom": {"url": "URL", "transport": "http", "headers": {…}}}}` (`loom install --client devin` writes this path; `--client windsurf` writes the older `~/.codeium/windsurf/` one) | accepted (CLI 3000.12.57 configuration only); Desktop unmeasured | +| Devin Desktop and Devin CLI | `.devin/mcp_config.local.json` in the project (git-ignored, for the token), or `~/.config/devin/mcp_config.json` | `{"mcpServers": {"loom": {"url": "URL", "transport": "http", "headers": {…}}}}` (`loom install --client devin` writes this path; `--client windsurf` writes the older `~/.codeium/windsurf/` one) | accepted (CLI 3000.12.57 configuration only); Desktop unmeasured | | Qwen Code | `~/.qwen/settings.json`, or `.qwen/settings.json` | `qwen mcp add --transport http loom URL --header "Authorization: Bearer "` | connected (`qwen mcp list`) | | Kimi Code CLI | `~/.kimi-code/mcp.json`, or `.kimi-code/mcp.json` in the working directory (read once the folder is trusted); or `/mcp-config` in the TUI | `{"mcpServers": {"loom": {"url": "URL", "headers": {…}}}}`, or `"bearerTokenEnvVar": "LOOM_API_KEY"` in place of `headers` | installed (2.5.3); MCP status unmeasured | | Grok Build | `~/.grok/config.toml`, or `.grok/config.toml`; below those it also reads a project `.mcp.json`, `~/.claude.json` and `.cursor/mcp.json`, so an existing Claude Code or Cursor entry is picked up (`[compat.claude] mcps = false` and `[compat.cursor] mcps = false` turn that off) | `grok mcp add --transport http loom URL --header "Authorization: Bearer "` | accepted (1.0.77); connection unmeasured | From 099fa6ab40817c595d49a172d64a0d30a2b61373 Mon Sep 17 00:00:00 2001 From: rr-develop Date: Sun, 6 Dec 2026 06:02:36 +0100 Subject: [PATCH 6/6] docs: name Devin CLI and Devin Local as the devin target and flag Desktop's different file Co-Authored-By: Claude Haiku 5.5 Signed-off-by: rr-develop --- docs/features/integrations/mcp-clients.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/features/integrations/mcp-clients.md b/docs/features/integrations/mcp-clients.md index 19e328f9630..d57b736d9f1 100644 --- a/docs/features/integrations/mcp-clients.md +++ b/docs/features/integrations/mcp-clients.md @@ -343,18 +343,18 @@ with `type: "streamable-http"`; use its assuming a hand-written entry is accepted by every version. `enabled` in Muse's output means configured, not connected. -Devin CLI's [native configuration](https://docs.devin.ai/cli/extensibility/mcp/configuration) -and the Devin Desktop [MCP page](https://docs.devin.ai/desktop/cascade/mcp) both name the -user file in the table, so `loom install --client devin` writes that file. `loom install --client windsurf` writes the -legacy Windsurf editor's `~/.codeium/windsurf/mcp_config.json`, which the CLI still imports by -default through its [Windsurf import](https://docs.devin.ai/cli/reference/configuration/read-config-from), +The `devin` target, `~/.config/devin/mcp_config.json`, is the user file that Devin CLI and +Devin Local read. Devin CLI's [native configuration](https://docs.devin.ai/cli/extensibility/mcp/configuration) +and the [Devin Local customizations](https://docs.devin.ai/desktop/devin-local/customizations) +both name it, so `loom install --client devin` writes that file. `loom install --client windsurf` +writes the legacy Windsurf editor's `~/.codeium/windsurf/mcp_config.json`, which the CLI still +imports by default through its [Windsurf import](https://docs.devin.ai/cli/reference/configuration/read-config-from), so an entry written there stays until it is removed or `read_config_from.windsurf` is set to `false`. -Devin Desktop's [FAQ](https://docs.devin.ai/desktop/devin-desktop-faq) lists -`~/.codeium/mcp_config.json` as the MCP config instead; Desktop itself was not run, so the -Desktop path rests on the MCP page. The CLI check wrote a native -entry and listed distinct disabled entries from both files; it did not connect to Loom. -Current [Devin Local documentation](https://docs.devin.ai/desktop/devin-local/customizations) -describes shared CLI configuration discovery; Desktop itself was not run. +Devin Desktop's [editor FAQ](https://docs.devin.ai/desktop/devin-desktop-faq#per-user-configuration-directory) +lists a different file, `~/.codeium/mcp_config.json`, for its per-user configuration. Do not write +the token there when following the Desktop editor configuration. Desktop itself was not run, so +that path rests on the FAQ alone. The CLI check wrote a native entry and listed distinct disabled +entries from both files; it did not connect to Loom. Kimi's `/mcp` and `/mcp-config` are TUI commands. Kimi's `doctor` does not validate its MCP file, and the tested MiniMax binary has no