Add antigravity MCP install target - #265
robertjamesprior wants to merge 5 commits into
Conversation
Antigravity keys remote servers off serverUrl rather than url, so the existing HTTP target shapes don't work for it. Config lives at ~/.gemini/config/mcp_config.json. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
this worked: {
"mcpServers": {
"kernel": {
"command": "npx",
"args": [
"-y",
"mcp-remote@latest",
"https://mcp.onkernel.com/mcp",
"--static-oauth-client-metadata",
"{\"client_name\":\"Antigravity\"}"
]
}
}
}also i'd rewrite next steps as: |
masnwilliams
left a comment
There was a problem hiding this comment.
requesting one change before approval. otherwise the target is scoped and the paired docs cover setup. non-blocking: target metadata is now spread across several lists and switches; a registry would make future targets less error-prone.
Replacing mcpServers.kernel wholesale dropped any field a user had added by hand, including the headers block that carries the API-key workaround, so rerunning the install silently broke a working config. Merge into the existing object instead: set serverUrl, and delete only url and httpUrl, which antigravity ignores. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Blocker addressed in b7b3caa.
Regression test On the non-blocking note: you're right that target metadata is spread across several lists and switches. Every other installer has the same whole-object replacement, so the |
Preserving the headers block means the file can now hold an API key, and writeJSONFile leaves it world-readable at 0644. Use writePrivateJSONFile, which already backs the fx target and chmods an existing file. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Bugbot caught a real consequence of the previous commit, fixed in 8e7d216. Merging the existing object means Switched the antigravity path to Extended the regression test to assert |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8e7d216. Configure here.
Antigravity's remote-server client can complete the OAuth flow and still send initialize without the bearer token, so the serverUrl config this target wrote fails on first contact with 401 Unauthorized. Write the npx mcp-remote stdio entry instead, matching Claude Desktop, Windsurf and Zed. mcp-remote runs the OAuth flow itself, so the token never depends on Antigravity's client. Reinstalling over a previous serverUrl entry strips it along with the other remote-transport keys. Post-install steps now describe the reload-and-authorize path that the stdio entry actually takes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Blocker addressed in 554f75b — you're right, and the reasoning in the description was wrong on two counts.
{
"mcpServers": {
"kernel": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://mcp.onkernel.com/mcp"]
}
}
}Reinstalling over a previous "It diverges from every other target" was false. Four of the eight — claude, windsurf, goose, zed — already write The fx precedent was stale. fx's OAuth was fixed by the authorization-server cutover last week, so fx writes OAuth config because OAuth works there now, not because we knowingly ship a broken path. I was arguing from a state that hadn't been true for five days. (The fx client doc still opens with the old issuer error — separate fix.) I dropped Took your next-steps wording verbatim. One consequence worth flagging: the merge preserves a hand-added Verified: the built binary against a throwaway |
|
Two corrections to the comment above, from an accuracy pass. Neither changes this diff. The API-key form I pointed at was broken. I said kernel/docs#623 rewrites that section to I overstated the fx point. I said fx's OAuth "works there now". What's established is narrower: the issuer mismatch was fixed on the canonical discovery path by the cutover, and the legacy routes on The argument doesn't depend on it either way: claude, windsurf, goose and zed already write |
masnwilliams
left a comment
There was a problem hiding this comment.
the switch to mcp-remote addresses the Antigravity initialize: Unauthorized failure, and the earlier config-preservation blocker is fixed. requesting the remaining OAuth consent identity fix before approval. please also resolve the existing BugBot comment about skipping the POSIX permission assertion on Windows.
Without static client metadata, mcp-remote registers as "MCP CLI Proxy", so the consent screen reads "mcp cli proxy wants to access kernel" and asks the user to trust that name rather than the application they are connecting. Also skip the config permission assertion on Windows, where Mode().Perm() reports 0666 for a writable file, matching TestInstallForFx. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Both addressed in 631ce29. Client identity. Flag is back, so the written args are now exactly what you posted: "args": ["-y", "mcp-remote", "https://mcp.onkernel.com/mcp", "--static-oauth-client-metadata", "{\"client_name\":\"Antigravity\"}"]Windows. The Retracting what I said earlier — I called that flag "not load-bearing" and that was wrong. I'd checked that registration returned
That name is what the grant renders and what the trust warning names, so it's the whole point, not decoration. Verified end to end after the change: ran Two things I found while confirming it, neither in this diff: The other four stdio targets have the same problem. claude, windsurf, goose and zed all run bare Retrofitting them only helps new installs. mcp-remote caches kernel/docs#623 now carries the same flag in its manual-config example. Left it out of that page's API-key example, since that path authenticates with the header and never reaches a consent screen. Full suite green, |
masnwilliams
left a comment
There was a problem hiding this comment.
all requested changes are addressed: Antigravity now uses the working mcp-remote path, identifies itself correctly in OAuth consent, preserves existing config safely, and handles the permission assertion portably. checks and BugBot are green.



Summary
Adds
kernel mcp install --target antigravity, so Antigravity users don't have to hand-edit JSON to reach the Kernel MCP server.Written output:
{ "mcpServers": { "kernel": { "command": "npx", "args": [ "-y", "mcp-remote", "https://mcp.onkernel.com/mcp", "--static-oauth-client-metadata", "{\"client_name\":\"Antigravity\"}" ] } } }--static-oauth-client-metadatanames the OAuth client. Without it mcp-remote registers asMCP CLI Proxy, and the consent screen asks the user to trust that name rather than Antigravity.Config goes to
~/.gemini/config/mcp_config.json, home-relative on every platform, so no per-OS branch is needed.Why stdio rather than a remote server
Antigravity does support remote servers, keyed off
serverUrl— it ignoresurlandhttpUrl, so none of the existing HTTP target shapes work for it. But its remote-server client can complete the OAuth flow and still sendinitializewithout the bearer token, which comes back as401 Unauthorized(antigravity-cli#25, open since May). AserverUrlentry fails on first contact.So this writes the
npx mcp-remotestdio entry instead, matching claude, windsurf, goose and zed — half the existing targets, and the shape we already use for every client whose native remote path doesn't work. mcp-remote runs the OAuth flow itself, so the token never depends on Antigravity's client.The server side is healthy either way: unauthenticated
initializereturns401with a spec-correctWWW-Authenticatenaming the protected-resource metadata, that metadata resolves, and dynamic registration returns200. The failure is entirely client-side.Reinstall behavior
installForAntigravitymerges into any existingmcpServers.kernelobject rather than replacing it, so hand-added fields survive. It setscommandandargsand deletesserverUrl,urlandhttpUrl— the remote-transport keys, which nothing reads under stdio — and migrates anyone who installed the earlierserverUrlshape.A hand-added
headersblock is preserved but inert under stdio; mcp-remote takes--headerarguments, not aheadersobject. Deleting someone's credential config silently is worse, and those users land on mcp-remote's OAuth, which works. kernel/docs#623 rewrites that section to pass the key throughmcp-remote's--header-file.The file is written with
writePrivateJSONFile(0600, chmods an existing file) because a preservedheadersblock can hold an API key. Onlyfxdid that before.Validation
go build ./...,go vet ./cmd/mcp/,gofmt -l: all clean.go test ./...: all packages pass, including three tests covering an existing config, a clean machine, and a reinstall over aserverUrlentry with a hand-addedheadersblock. All three fail against the previous commit (command = <nil>, want npx).HOME, for both a clean install and a reinstall over an existing config: writes the entry above, strips the stale keys, leaves other servers alone, tightens0644to0600, and prints the new next steps.npxwith the exact args the built binary writes: it discovers the authorization server, registers asAntigravity, and reaches the authorization step. Registering without the flag comes backMCP CLI Proxy, which is what the consent screen showed in review.Merge order
kernel/docs#612 has already merged and documents this target, so the published page names a CLI command no released binary has and shows the
serverUrlconfig that doesn't work. kernel/docs#623 corrects that page.Land #623 first. It fixes a published page whose manual-config path is wrong today and needs no CLI to be right, so there's no reason to hold it behind this. This one closes the remaining gap when it ships in a release.
🤖 Generated with Claude Code
Note
Low Risk
Scoped CLI changes that only write local MCP JSON; tighter file permissions reduce exposure if API keys are preserved in config.
Overview
Adds
kernel mcp install --target antigravityfor Google Antigravity, writing Kernel MCP settings to~/.gemini/config/mcp_config.jsonand documenting Antigravity-specific next steps (reload MCP servers, OAuth, verify connection).Because Antigravity’s native remote MCP path can OAuth without sending a bearer token on
initialize, the installer configures stdio vianpx mcp-remote(with--static-oauth-client-metadataso the consent screen shows Antigravity), notserverUrl/url/httpUrl. Reinstalls merge into an existingmcpServers.kernelentry, drop stale remote keys, and keep hand-added fields such asheaders; the config file is written with0600permissions when secrets might be present.Tests cover fresh install, merging with other servers, and reinstall over a prior remote-shaped entry including preserved
headers.Reviewed by Cursor Bugbot for commit 631ce29. Bugbot is set up for automated code reviews on this repo. Configure here.