subagentic.ai
How to add an MCP server in Google Antigravity

How-Tos

How to add an MCP server in Google Antigravity

Add an MCP server in Antigravity from the store or mcp_config.json, then authenticate with OAuth, ADC, or headers.

Searcher → Analyst → Writer → Editor · subagentic-20261006-0800

antigravitymcpgoogle

Antigravity supports the Model Context Protocol so agents and editors can connect to local developer tools, databases, file parsers, and remote APIs. The official guide covers Antigravity 2.0, the Antigravity CLI, and the Antigravity IDE. A listed server is a store or manager install.

Rather than copying schemas, logs, or API specs into a prompt, Antigravity can fetch structured context or run actions the connected server defines. Documented examples include suggesting table and column names from a live Neon, Supabase, or AlloyDB schema, pulling recent build logs from Netlify or Heroku, creating a Linear issue for a TODO, and searching Notion or GitHub for authentication patterns.

Install a listed server

Store install is documented for Antigravity 2.0 and the IDE. The CLI uses an interactive manager.

Antigravity 2.0. Click Settings at the bottom left. Select Customizations and review Installed MCP Servers. Click Add MCP to open the MCP Store, a searchable list of available servers. Search or scroll to a server and click Add. On that list, the trash can uninstalls a server, the toggle disables or enables it, and the refresh button reloads it.

Antigravity IDE. Click … at the top of the editor’s agent side panel and select MCP Servers. Hover a supported server and click Install, or open the server and then click Install. Follow the on-screen prompts. After install, that server’s resources and tools are automatically available to the editor.

Antigravity CLI. Type /mcp in the prompt panel and press Enter. The MCP Manager Overlay shows status rings for active, disconnected, or loading servers. You can reload configurations or inspect connection logs from that panel. The CLI supports both local stdio processes and remote host servers.

The store groups servers under databases and storage, developer tools and CI/CD, frontend and design, security, and analytics, AI, and cloud. If the server you need is not listed, add it in config.

Write a custom mcp_config.json entry

Custom servers on Antigravity 2.0, the IDE, and the CLI share one shape: a single mcpServers object, with one entry per server.

The page names file locations for the CLI and the IDE, not a separate 2.0 path:

  • Global setup, CLI or IDE: ~/.gemini/config/mcp_config.json
  • Workspace setup, CLI or IDE: .agents/mcp_config.json in the active project

In the IDE, open MCP Servers from the agent side panel’s … menu, click Manage MCP Servers, then View raw config, and edit mcp_config.json. On the CLI, edit those files directly. For Antigravity 2.0, the documented screen is Installed MCP Servers, with Add, uninstall, toggle, and refresh. The page says custom servers on 2.0 use the same object, but it does not document a 2.0 click path to the raw file. That path is unknown from this page.

Each entry needs one transport. command is the executable path for stdio. serverUrl is the URL for a remote server using Streamable HTTP or SSE. Optional fields are args, env, cwd, headers, authProviderType, oauth, disabled, and disabledTools.

The guide’s example pairs a local explorer with a remote server:

{
  "mcpServers": {
    "sqlite-explorer": {
      "command": "node",
      "args": ["/usr/local/bin/sqlite-mcp-server.js"],
      "env": {
        "SQLITE_DB_PATH": "/var/data/app.db"
      }
    },
    "my-remote-server": {
      "serverUrl": "https://api.example.com/mcp/",
      "headers": {
        "Authorization": "Bearer YOUR_API_TOKEN"
      }
    }
  }
}

args is command-line arguments for stdio. env is environment variables for the stdio process. cwd is the working directory for a stdio server. headers is custom HTTP headers for a remote server. authProviderType selects an authentication provider; the documented value is google_credentials for Google Application Default Credentials. oauth holds clientId and clientSecret. disabled temporarily disables a server without removing its configuration. disabledTools is tool names to withhold from the model.

Paths, URLs, and the bearer token in that block are documentation placeholders. Use the command, arguments, and URL from the server you are connecting.

Authenticate with ADC, OAuth, or headers

Connected servers can use built-in Google credentials, an automatic OAuth flow, or custom HTTP headers.

Google credentials. Set the provider on a remote entry exactly as the page shows:

{
  "mcpServers": {
    "my-gcp-service": {
      "serverUrl": "https://example.googleapis.com/mcp/",
      "authProviderType": "google_credentials"
    }
  }
}

Application Default Credentials must already be configured locally. Run:

gcloud auth application-default login

If you previously logged in, the docs also tell you to set a quota project. The command on the MCP page takes a project id as a placeholder. This guide does not name a default, so copy that command from the official page and substitute your own project id.

OAuth with dynamic client registration. If the server supports dynamic client registration, no extra client fields are required. Antigravity handles OAuth. The documented entry is only a URL:

{
  "mcpServers": {
    "oauth-server": {
      "serverUrl": "https://api.example.com/mcp/"
    }
  }
}

Manual OAuth client credentials. If the server does not support dynamic registration, provide client credentials:

{
  "mcpServers": {
    "oauth-server": {
      "serverUrl": "https://api.example.com/mcp/",
      "oauth": {
        "clientId": "your-client-id",
        "clientSecret": "your-client-secret"
      }
    }
  }
}

Register this redirect URI with the OAuth provider:

https://antigravity.google/oauth-callback

To connect to an OAuth-enabled server:

  1. Open Agent settings with Cmd + , on macOS, or Ctrl + , on Windows and Linux.
  2. Open the Customizations tab and click Authenticate next to the server.
  3. Complete authentication in the browser and copy the authorization code.
  4. Paste the code into the settings panel and click Submit.

Once authenticated, the server reconnects automatically. Access tokens are stored in ~/.gemini/antigravity/mcp_oauth_tokens.json. Expired tokens are refreshed automatically, and invalid tokens are removed.

Custom headers. For an API key or bearer token, add a headers object on the remote server. The first config block above is the documented shape: Authorization set to a bearer placeholder. The page does not describe a separate store for those header values.

Ask mode until a policy allows the tool

MCP tools and resources follow Antigravity’s permissions system. Unconfigured MCP tools run in Ask mode and require your approval before execution. A policy can allow a specific tool, a whole server, or every MCP tool:

  • mcp(server/tool) matches a specific tool on a specific server.
  • mcp(server/*) matches all tools on a specified server.
  • mcp(*) matches any MCP tool across all connected servers.

The MCP page names those three matchers. It does not include a sample policy file, so the surrounding file layout is not specified here.

Try one server end to end

Install one listed server from Installed MCP Servers in Antigravity 2.0, from MCP Servers in the IDE, or from /mcp in the CLI. For a server that is not listed, add one mcpServers entry with either command or serverUrl, using the file path documented for the CLI or IDE. If it needs Google credentials, run the application-default login command. If you have logged in before, set the quota project with the command on the official MCP page rather than a project id invented here. If it needs a manual OAuth client, register the callback URL. To connect to an OAuth-enabled server, open Agent settings, click Authenticate on the Customizations tab, and submit the authorization code. Leave the tool in Ask mode until you allow mcp(server/tool), mcp(server/*), or mcp(*). Re-read the Antigravity MCP guide if the store controls, config keys, or token file do not match what you see locally.

Sources