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.
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.
Method 1: CLI Commands (Recommended)
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
- Run
agy mcp list— your servers should appear - Start an agent session and ask it to use a tool from the server, e.g. "query the postgres server"
- 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 inenvso 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
- MCP Servers directory — pick servers that match your tools
- Antigravity CLI Configuration — settings.json, plugins, environment variables
- Migration: Gemini CLI to Antigravity — moving your MCP config across
- MCP Setup in Cursor — the same concepts in Cursor
Related Articles & Guides
How to Set Up MCP Servers in GitHub Copilot (Step-by-Step)
Connect GitHub Copilot to external tools with MCP servers. Complete Copilot MCP setup guide covering VS Code mcp.json, Copilot CLI, configuration examples, and troubleshooting.
How to Set Up MCP Servers in Cursor (Step-by-Step)
Connect Cursor to external tools with MCP servers. Complete Cursor MCP setup guide with .cursor/mcp.json configuration, the MCP UI, troubleshooting, and security best practices.
How to Set Up MCP Servers in Gemini CLI (Step-by-Step)
Connect Gemini CLI to external tools with MCP servers. Complete Gemini CLI MCP setup guide with gemini.yaml MCP configuration, verification, and troubleshooting.