How to Set Up MCP Servers in Antigravity CLI (Step-by-Step)

Connect Antigravity CLI to external tools with MCP servers. Complete setup guide covering agy mcp add/list/remove commands, settings.json configuration, verification, and troubleshooting.

August 10, 2026
implementationguidesetupAntigravity CLIagyMCPsettings.json

Prerequisites

  • Antigravity CLI (agy) installed and authenticated (see Getting Started)
  • Node.js 18+ or Docker for npx- and Docker-based servers

What is MCP?

MCP (Model Context Protocol) lets Antigravity CLI's agent use external tools — filesystem, GitHub, databases — through a standard interface. Antigravity CLI supports MCP out of the box, configured either via CLI commands or directly in settings.json.

Antigravity CLI has first-class MCP management commands. Add a server with agy mcp add:

agy mcp add <name> <command>
agy mcp add postgres npx @modelcontextprotocol/server-postgres
agy mcp add github npx @modelcontextprotocol/server-github

The first argument is a display name, the rest form the command (plus any args).

Managing Servers

agy mcp list            # List all configured servers
agy mcp remove <name>   # Remove a server
agy mcp enable <name>   # Enable a server
agy mcp disable <name>  # Disable a server

Method 2: settings.json

Servers can also be configured directly in settings.json:

{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": ["@modelcontextprotocol/server-postgres"]
    },
    "github": {
      "command": "npx",
      "args": ["@modelcontextprotocol/server-github"]
    }
  }
}

The mcpServers object maps a server name to a { command, args } pair. API keys can be added per-server via an env block:

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_TOKEN": "${GITHUB_TOKEN}"
      }
    }
  }
}

Verifying Your Servers

  1. Run agy mcp list — your servers should appear
  2. Start an agent session and ask it to use a tool from the server, e.g. "query the postgres server"
  3. If a server fails, check the session log for the connection error

Using MCP Tools in Antigravity CLI

Once connected, the agent calls the server's tools like any built-in tool:

You: "Use the github server to find issues labeled bug."

Agent: [calls the github tool, returns matching issues]

Security Considerations

  • Least privilege — give servers only the credentials they need
  • Keep secrets out of git — use ${VAR_NAME} interpolation in env so API keys resolve from your shell at launch
  • Review server tools — an MCP server executes arbitrary commands on your machine
  • Disable unused servers — use agy mcp disable <name> for servers you don't need in a given session

Troubleshooting

Further Resources