Repository navigation
loom install --client gemini writes Gemini CLI's MCP entry - #744
Conversation
zlareb1
left a comment
There was a problem hiding this comment.
Verdict: needs verification. No code findings in the client registration, URL shape, configuration merge/refusal, detection or token redaction. The 325 focused Python tests, 43 frontend client-configuration tests, generated reference check and function-length gate pass locally.
The branch conflicts with main in docs/features/integrations/mcp-clients.md, so CI has not started. Rebase and retain the current table content while adding the client, then run CI before merge. The local full frontend build hits the same filename-casing error on main; native Windows and a live client were not exercised locally.
|
Hi @zlareb1, this one is ready for review: |
Gemini CLI users had to use the extension or edit settings.json by hand. `loom install --client gemini` now merges `mcpServers.loom` into ~/.gemini/settings.json (%USERPROFILE%\.gemini\settings.json on Windows) as `httpUrl` + `headers`, the key Gemini CLI reads for streamable HTTP, on the coding toolset like the other coding agents. The token dialog offers Gemini CLI too, from the same table. Gemini CLI reads settings.json with comments allowed. A file that holds comments is refused rather than rewritten without them, and the entry to paste is printed with the token as <token>. With no --client, Gemini CLI counts as installed when its settings file or the `gemini` binary exists, not when ~/.gemini/ alone does, since Google Antigravity also creates that directory. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Rahul <[email protected]>
a94ae21 to
82bcea5
Compare
|
@zlareb1 rebased onto main (82bcea5). The conflicts were in |
zlareb1
left a comment
There was a problem hiding this comment.
No further findings in client registration, MCP URL shape, config preservation/refusal, detection or token redaction. All 133 focused install, token and CLI snapshot tests pass locally. The earlier merge conflict is gone; CI is running.
Closes: #724
Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
loom install --client geminiwrites Loom's MCP entry into Gemini CLI's~/.gemini/settings.json, and the token dialog offers Gemini CLI.Why
Gemini CLI users installed Loom through the Gemini extension or by editing
settings.jsonby hand;loom install --clienthad no Gemini entry.Scope and risk
server/identity/app/token_clients.py: ageminirow inCONFIG_PATHS(~/.gemini/settings.json;%USERPROFILE%\\.gemini\\settings.jsonon Windows),geminiinCODING_CLIENTS(the URL carries?toolset=coding), and anhttpUrlbranch inmcp_entry():{"httpUrl": …, "headers": {"Authorization": "Bearer …"}}.config_key()'smcpServersdefault fits.server/cli/install.py:_install_oneis unchanged, and a test shows asettings.jsonholding other settings and other servers keeps them across a write and a rewrite;//or/* */comments outside strings is refused: nothing is written, and the message names the file and prints the entry to paste. The token is printed as<token>, as--dry-runalready does. A file that is invalid JSON without comments gets the existing message. This applies to every JSON client, since a rewrite would drop comments in any of them; tell me if you'd rather keep it togemini;--client, Gemini CLI counts as installed when~/.gemini/settings.jsonexists orgeminiis onPATH, not when~/.gemini/alone exists, because Google Antigravity also creates that directory. Tested both ways.frontend/src/lib/clients.ts:geminiinClientId,CLIENTS("Gemini CLI") andCODING_TOOLSET_CLIENTS, and thehttpUrlkey informatMcpConfig();clientSetups.fixture.jsongains thegeminisetups (generated fromclient_config), whichclients.test.tsandtest_token_clients.pyboth check.test_cli_install.py(write + rewrite keeping settings; refusal with comments; detection;_has_json_commentsignoring slashes inside strings),test_token_mint.py(the mint's client list), andcli_tree.json/cli_help.jsonregenerated withLOOM_UPDATE_CLI_SNAPSHOT=1under Python 3.12 (CI's version; 3.14 also reflows thesql-access grantusage, which I left out).test_detect_installed_clientsnow pinsshutil.whichso a machine withgeminiinstalled does not change its result.mcp-clients.md(the--clientand--toolsetrows, the coding-toolset sentence, the "Plugin or plain MCP" row, ageminirow in "What it writes per client", and the comments refusal),connect-a-coding-agent.md,integrations/index.mdandquickstart.md.Not changed:
pluginInstallLinesreturns nothing forgemini, thoughgemini extensions install https://github.com/ClickHouse/loomexists. Happy to add it here or separately.Compatibility, rollout and rollback
me_service_accounts.create'sclientsgains ageminientry; nothing removed or renamed.loomentry already written stays in the user'ssettings.json.Tests
Against a real Gemini CLI. Loom 1.2.0 (released image,
LOOM_AUTH_REQUIRED=true, a writer token frommint_token), this branch's CLI, Gemini CLI 0.68.0 from npm, all under a throwawayHOME:full run log
Gates (Python 3.12, as CI):
AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): Claude Code. I reviewed each change against the issue's file list and acceptance criteria, ran the tests above, and ran
loom installandgemini mcp listmyself against a live server.I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make format-check,make lint,make typecheckandmake test-unitpass; the integration suite passes if server behaviour changed. (format, lint and typecheck as listed above; formake test-unitthe files this change touches and the snapshot, docs and public-copy tests were run, not the whole unit suite)docs/reference/configuration.mdand thedocs/reference/tables (python scripts/codegen/docs_reference.py), the reach manifest,schemas/schema.sql(make schema-dump) and the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py). (the CLI snapshots were regenerated; every--checkpasses)main; no merged migration is edited. (n/a)hooks/,lib/,bin/,skills/,.mcp.json, the Codexplugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version. (n/a)npm --prefix frontend run build) and its tests pass, iffrontend/changed.docs/describe the system as it now is, and this description names any operator steps and wire changes.tests/unit/test_public_copy.py).git commit -s), as CONTRIBUTING.md asks.