Skip to content

Add antigravity MCP install target - #265

Open
robertjamesprior wants to merge 1 commit into
mainfrom
hypeship/add-antigravity-mcp-target
Open

robertjamesprior wants to merge 1 commit into
mainfrom
hypeship/add-antigravity-mcp-target

Conversation

@robertjamesprior

@robertjamesprior robertjamesprior commented Sep 20, 2026

Copy link
Copy Markdown

Summary

Adds kernel mcp install --target antigravity, so Antigravity users don't have to hand-edit JSON to reach the Kernel MCP server.

Antigravity keys remote servers off serverUrl and ignores url and httpUrl, so none of the existing HTTP target shapes work for it — this needs its own installer rather than reuse of the Cursor or VS Code path. Config goes to ~/.gemini/config/mcp_config.json, home-relative on every platform, so no per-OS branch is needed.

Written output:

{
  "mcpServers": {
    "kernel": {
      "serverUrl": "https://mcp.onkernel.com/mcp"
    }
  }
}

Uses writeJSONFile (0644/0755) like every target except fx — the file this writes holds no credential. Antigravity stores OAuth tokens separately in ~/.gemini/antigravity/mcp_oauth_tokens.json.

On writing the OAuth shape rather than an API key

This writes the plain OAuth config, matching all eight existing targets. Antigravity's OAuth is currently unreliable — it can finish the browser flow and still send initialize without the bearer token, returning 401 Unauthorized (antigravity-cli#25, open since May).

The alternative was writing an Authorization: Bearer header with a Kernel API key, which works today. I didn't, for two reasons: it diverges from every other target, and it needs the user to already hold a key. This is the same tradeoff --target fx already makes — it writes OAuth config knowing fx's OAuth is broken, and the docs carry the workaround. Worth overriding if you'd rather the CLI optimize for what works today over what's consistent.

Validation

  • go build ./..., go vet ./cmd/mcp/, gofmt -l: all clean.
  • go test ./...: all packages pass, including two new tests — one covering an existing config (other servers and unrelated keys preserved, url explicitly absent) and one covering a clean machine, which is what exercises creating the two-level .gemini/config directory.
  • Ran the built binary against a throwaway HOME: writes the file above, prints the Customizations/paste-code next steps, and appears in --help and the invalid-target error.
  • Not driven inside Antigravity itself. The serverUrl key, config path, and token-store location come from Antigravity's MCP documentation.

Merge order

kernel/docs#612 documents this target and currently says no CLI target exists. Land this first, then that.

🤖 Generated with Claude Code


Note

Low Risk
CLI-only change that writes non-secret local MCP JSON using the same patterns as other install targets; no server or auth logic changes.

Overview
Adds kernel mcp install --target antigravity so Antigravity users get Kernel MCP wired up without hand-editing JSON.

The installer writes ~/.gemini/config/mcp_config.json, merging a kernel entry under mcpServers that uses Antigravity’s serverUrl field (not url / HTTP shapes used by other targets). Help text and post-install steps cover reload, Customizations Authenticate, and pasting the browser authorization code.

Two tests cover merging into an existing config (preserving other servers/settings and ensuring url is not written) and a clean install that creates the config path.

Reviewed by Cursor Bugbot for commit bcc3db7. Bugbot is set up for automated code reviews on this repo. Configure here.

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>
@robertjamesprior
robertjamesprior marked this pull request as ready for review September 20, 2026 08:23
@robertjamesprior
robertjamesprior requested review from masnwilliams and rgarcia and removed request for rgarcia September 20, 2026 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant