Repository navigation
Description
Company or project name
No response
Component
CLI
Use case
OpenCode users add Loom by hand today (opencode mcp add … or editing opencode.json), while loom install --client writes the entry for Claude Code, Codex, Cursor, VS Code, Cline, Windsurf, Zed and Claude Desktop.
Describe the solution you'd like
Goal. loom install --client opencode writes Loom's entry into ~/.config/opencode/opencode.json, merging with the servers already there, and the token dialog in the dashboard offers OpenCode too.
Files to change
server/identity/app/token_clients.py:- a
CONFIG_PATHSrow foropencode: OpenCode reads its global config from~/.config/opencode/opencode.jsonon Linux and macOS; its config docs (https://opencode.ai/docs/config/) name no per-user path for Windows, so check where your build reads it and say so in the PR; - the entry nests under
mcp.servers, whileconfig_key()returns a single top-level key today, so the nesting needs its own handling in the config built byclient_config(); mcp_entry()returns{"type": "remote", "url": …, "headers": {"Authorization": "Bearer …"}}for OpenCode;opencodeinCODING_CLIENTS, so the URL carries?toolset=coding.
- a
server/cli/install.py:_install_onemerges into one top-level section and refuses a file that is not valid JSON. Make it write undermcp.servers. OpenCode readsopencode.jsonoropencode.jsonc(its config docs writeopencode.json(c)and their examples useopencode.jsonc), and JSONC may hold comments and trailing commas thatjson.loadcannot read. Whenopencode.jsoncis the file there, merge the entry into it and keep its comments and trailing commas; never write a second config beside it. Only when the file cannot be merged safely, refuse with a message that names it and prints the entry to paste. Say in the PR which fileopencode mcp add --globalcreates on a machine with no global config, and write that one in that case.frontend/src/lib/clients.ts:opencodeinClientId,CLIENTSandCODING_TOOLSET_CLIENTS, and informatMcpConfig()themcp.serversnesting and thetype: "remote"entry, kept equal to the server's throughclientSetups.fixture.json;frontend/src/lib/clients.test.ts.tests/unit/test_token_clients.py,tests/unit/test_cli_install.pyandtests/unit/test_token_mint.py(the set of clients a new token comes with).tests/unit/snapshots/cli_tree.jsonandcli_help.json: the--clientchoices are pinned there.- docs/features/integrations/mcp-clients.md, each spot that names the
loom installor coding-toolset clients:- the
--clientrow of the flag table (its list of client names); - the
--toolsetrow, whose default reads "codingfor Claude Code, Codex and Cursor"; - the sentence under "Plugin or plain MCP" that ends "the default only for Claude Code, Codex and Cursor";
- the "Plugin or plain MCP" row that lists the
loom install --client <name>clients (Claude Desktop, VS Code, Cline, Windsurf, Zed); - the "What it writes per client" table, and the OpenCode row under "Other editors and agents".
- the
- docs/getting-started/connect-a-coding-agent.md: the token dialog's client list under Connect ("Cursor, VS Code, Cline, Windsurf, Zed or Claude Desktop", around line 81) and the "
--clientalso takes …" list after the command. - docs/features/integrations/index.md: the row that lists the
loom installclients ("Claude Desktop, Cursor, VS Code, Cline, Windsurf, Zed | …loom install --client …", around line 19), and docs/getting-started/quickstart.md: the sentence that lists the clientsloom installwrites an MCP entry for (around lines 528–529). The MCP clients page has checked entries for nine more agents and the hosted builders' routes #695 and Google ADK memory services use Loom in both SDKs #696 also editindex.md(Google ADK memory services use Loom in both SDKs #696 re-pads its Map table), and The MCP clients page has checked entries for nine more agents and the hosted builders' routes #695 editsmcp-clients.md: rebase onto whichever is still open.
OpenCode 2.x nests the entry under mcp.servers, while the npm opencode-ai 1.x releases write {"mcp": {"loom": {...}}}. Say in the PR which versions the written entry supports.
Acceptance criteria
- A unit test writes the file, then rewrites it, without losing the other servers under
mcp.serversor other top-level keys. - When only
~/.config/opencode/opencode.jsoncexists,loom install --client opencodemerges the entry into it, keeps its comments and trailing commas, and creates noopencode.json; a unit test covers it. loom installwith no--clientwires OpenCode when~/.config/opencode/exists, and a unit test covers it.- OpenCode enables OAuth for a remote server unless its entry sets
"oauth": false(https://opencode.ai/docs/mcp-servers/). Decide whether the written entry sets"oauth": falseand say why in the PR; then checkopencode mcp listagainst a server that takes the bearer token only and against one withLOOM_OAUTH_ENABLED=true, and report what each shows. opencode mcp listshowsloomconnected (OpenCode 2.3.0 is the version the MCP clients page checked; say which version you used).make format-check lint typecheck,npm --prefix frontend testandnpm --prefix frontend run build(tsc -b && vite build, as CI runs it) pass.npx --prefix frontend playwright install chromium && npm --prefix frontend run e2epasses (the specs infrontend/e2e/, as CI'sfrontend-e2ejob runs them).- The docs checks pass:
.venv/bin/python -m pytest tests/unit/test_doc_links.py tests/unit/test_public_copy.py -q
.venv/bin/python -m scripts.codegen.docs_reference --checkLOOM_UPDATE_CLI_SNAPSHOT=1 .venv/bin/python -m pytest tests/unit/test_cli_surface_snapshot.pyregeneratescli_tree.jsonandcli_help.json(the commandtests/unit/snapshots/README.mdgives), and.venv/bin/python -m pytest tests/unit/test_token_clients.py tests/unit/test_cli_install.py tests/unit/test_token_mint.py tests/unit/test_cli_surface_snapshot.py -qpasses.
Describe alternatives you've considered
opencode mcp add loom --url URL --header "Authorization=Bearer <JWT>" works today, as the MCP clients page shows; this makes loom install cover OpenCode like the other clients and puts it in the dashboard's token dialog.
Where the need comes from
The need is mine, an AI tool helped shape the proposal
Additional context
the Gemini CLI install issue (loom install --client gemini) and #709 (Zed) change the same files: server/identity/app/token_clients.py, server/cli/install.py, frontend/src/lib/clients.ts, frontend/src/lib/clientSetups.fixture.json and the CLI snapshots. Taken in parallel, expect to rebase onto whichever merges first.
Size: L (several days). Read CONTRIBUTING.md first (signed-off commits), and comment here to say you are working on it.
Activity
rahulsjha commentedon Nov 16, 2026
Hi @zlareb1, I'd also like to take the OpenCode entry, right after #724 since they touch the same files. Plan: an
opencoderow inCONFIG_PATHS(itsopencode.jsonlocation per platform) with themcpkey and entry shape OpenCode expects (type: "remote",url,headers),opencodeinCODING_CLIENTS, the frontendclients.tsentries andformatMcpConfig()branch, the matching unit and snapshot tests, and the MCP clients docs; I'll verify it against a running OpenCode and put the version and result in the PR. Could you assign it to me?