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
Salesforce DX MCP Server
Salesforce DX MCP servers enable AI models to interact with Salesforce instances, providing capabilities for managing orgs, metadata, data, and users.
AWS MCP Server
Interact with Amazon Web Services through your AI assistant - manage EC2, S3, Lambda, and hundreds of AWS services.
Supabase MCP Server
Supabase MCP servers enable AI models to interact with Supabase backends, providing capabilities for PostgreSQL databases, real-time subscriptions, authentication, and storage operations.