
How-Tos
How to add an MCP server in Google Antigravity
Add an MCP server in Google Antigravity from the store or mcp_config.json, including stdio, remote auth, and the default Ask permission.
Searcher → Analyst → Writer → Editor · subagentic-20261026-0800
Antigravity supports the Model Context Protocol on the Antigravity App, the Antigravity CLI, and the Antigravity IDE. MCP is the open standard that lets Antigravity connect to local developer tools, databases, file parsers, and remote APIs, then fetch structured context or run actions those servers define. A connected server can supply a live schema from Neon, Supabase, or AlloyDB, pull recent Netlify or Heroku build logs, create a Linear issue, or search Notion or GitHub.
Listed servers install from the MCP Store. Custom servers go in mcp_config.json. That file uses one schema whether you are configuring the app, the IDE, or the CLI.
Install a listed server
Antigravity App
In the app, manage servers in the Installed MCP Servers section of Settings.
- Click Settings at the bottom left of the screen.
- Select Customizations and review Installed MCP Servers.
- Click Add MCP. That opens the MCP Store, a searchable list of available servers.
- Search or scroll to a server and click Add.
From that list, click the trash can icon to uninstall, the toggle to disable or enable, or the refresh button to refresh.
Antigravity IDE
- Click … at the top of the editor’s agent side panel and select MCP Servers.
- Hover over a supported server and click Install, or open the server and then click Install.
- Follow any on-screen prompts.
Once installed, resources and tools from that server are available to the editor.
For a server that is not in the store:
- Click … and select MCP Servers.
- Click Manage MCP Servers.
- Click View raw config.
- Edit
mcp_config.jsonwith the schema below.
The IDE configuration file is global at ~/.gemini/config/mcp_config.json, or local to the workspace under .agents/mcp_config.json.
Antigravity CLI
The CLI supports local stdio processes and remote servers. Type /mcp in the prompt panel and press Enter to open the MCP Manager Overlay. It shows status rings for active, disconnected, or loading servers, and it can reload configurations or inspect real-time connection logs.
The CLI also loads two files. Enabled plugins can add MCP servers as well.
- Global:
~/.gemini/config/mcp_config.json, for all projects. - Workspace:
<workspace>/.agents/mcp_config.json, for that workspace only.
Write mcp_config.json
The root object contains an mcpServers map. Each key is a unique server id. Each entry must specify one transport property: command for a local stdio server, or serverUrl for a remote Streamable HTTP server. You can also use url instead of serverUrl.
The guide’s example runs both transports. The paths, URL, and token are placeholders from the documentation:
{
"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"
}
}
}
}
Optional properties from the same table:
argsis a string array passed tocommand. Default is an empty array. Stdio only.envis a map of environment variables injected into the local process. Default is an empty object. Stdio only.cwdis the working directory used when spawning a local process. No default is listed.headersis a map of HTTP headers sent with a remote connection, such asAuthorizationor an API key. Default is an empty object.disabledset to true suspends the connection without removing the entry frommcp_config.json. Default is false.enabledToolsis an allowlist of tool names. When set, all other tools on that server are hidden.disabledToolsis a denylist of tool names withheld from the agent. Default is an empty array.timeoutSecondsis the timeout, in seconds, for connecting and listing tools, and for each tool call.
oauth and authProviderType are covered in the auth section.
Timeouts
By default, Antigravity waits up to 5 minutes for an MCP server to connect and list its tools, and up to 3 minutes for each tool call. The property table records those defaults as 300 seconds to connect and 180 seconds per call. A call that runs longer fails with an error that names the server and the limit:
MCP tool call to server "sqlite-explorer" timed out after 3m0s
A positive timeoutSeconds replaces both limits. The value 600 lets each tool call run for up to 10 minutes. A negative value, such as -1, turns both limits off. 0, or leaving timeoutSeconds unset, keeps the defaults. The same value also limits how long the server has to connect, so a small number can stop a slow-starting server from connecting.
Authenticate
Connected servers can use built-in Google credentials, OAuth, or custom HTTP headers.
Application Default Credentials
Set authProviderType to google_credentials to attach Google Application Default Credentials:
{
"mcpServers": {
"my-gcp-service": {
"serverUrl": "https://example.googleapis.com/mcp/",
"authProviderType": "google_credentials"
}
}
}
This requires Application Default Credentials locally. To set them up, run:
gcloud auth application-default login
If you previously logged in, set the quota project. Replace the brace placeholder in the documented command with your quota project id:
gcloud auth application-default set-quota-project {QUOTA_PROJECT}
OAuth
Antigravity automatically handles OAuth for servers that support dynamic client registration. For those servers, no additional configuration is needed beyond the server entry. A serverUrl entry is enough.
If the server does not support dynamic client registration, provide client credentials manually. The oauth object takes clientId and an optional clientSecret:
{
"mcpServers": {
"oauth-server": {
"serverUrl": "https://api.example.com/mcp/",
"oauth": {
"clientId": "your-client-id",
"clientSecret": "your-client-secret"
}
}
}
}
If you provide client credentials manually, register this URL as a redirect URI with your OAuth provider:
https://antigravity.google/oauth-callback
To connect to an OAuth-enabled server:
- Open Agent settings with
Cmd+,on macOS, orCtrl+,on Windows and Linux. - Navigate to the Customizations tab and click Authenticate next to the server.
- Complete authentication in the browser and copy the authorization code.
- Paste the code back 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.
For a remote server that expects an API key or bearer token instead of OAuth, add it to headers. The first example uses an Authorization header with the placeholder YOUR_API_TOKEN. Substitute your own token.
Keep the default Ask permission
Access to MCP tools and resources is governed by Antigravity’s permissions system. By default, unconfigured MCP tools run in Ask mode and require your approval before execution.
You can allow specific tools or entire servers in your policy configuration. The guide names three patterns:
mcp(server/tool)matches a specific tool on a specific server.mcp(server/*)matches all tools on a specified server.mcp(*)is a global wildcard matching any MCP tool across all connected servers.
The guide does not include a complete policy file, so the surrounding syntax is unknown from this page. Take that from the permissions documentation rather than guessing a wrapper.
What to try next
Install Google Developer Knowledge from the MCP Store using the steps for the surface you actually use. The guide says it connects with your Google credentials, so no API key is needed. It exposes search_documents, get_documents, and answer_query, and it can search official Google developer documentation, including the Antigravity docs, so the agent can check a current API before it writes code.
For the CLI or a shared workspace config, the MCP page points to Antigravity steps in the Developer Knowledge documentation. Those steps are not reproduced on the MCP page. After the server is connected, use the guide’s example: ask the agent to look up the current Antigravity hooks documentation and add a PreToolUse hook that blocks shell commands which modify files outside this workspace.
If the server is custom, confirm the entry sets command or serverUrl, then run one tool. Expect an Ask approval unless that tool already matches one of the three policy patterns above.