The Model Context Protocol (MCP) is one of Google Antigravity's most powerful features, enabling seamless integration with external tools, databases, APIs, and services. This comprehensive guide will take you from MCP basics to advanced custom server development.
New to Antigravity? Start with our installation guide first, then return here to supercharge your setup.
MCP is an open protocol that allows AI assistants to securely connect with external data sources and tools. Think of it as a universal adapter that lets Google Antigravity communicate with virtually any service.
βββββββββββββββββββββββ MCP Protocol βββββββββββββββββββββββ
β Google Antigravity β ββββββββββββββββββββΊ β MCP Server β
β (AI Client) β JSON-RPC over β (Tool Provider) β
β β stdio/HTTP β β
βββββββββββββββββββββββ βββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββ
β External Serviceβ
β (DB, API, etc.) β
βββββββββββββββββββ
Browse our MCP Server Directory for ready-to-use configurations.
MCP servers are configured in your Antigravity settings file:
macOS/Linux:
~/.config/antigravity/mcp.json
Windows:
%APPDATA%\antigravity\mcp.json
{
"mcpServers": {
"server-name": {
"command": "executable",
"args": ["arg1", "arg2"],
"env": {
"API_KEY": "your-key"
}
}
}
}
Configuration issues? See our troubleshooting guide for MCP debugging tips.
Access and manipulate files beyond your project:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@anthropic-ai/mcp-filesystem",
"/Users/username/projects",
"/Users/username/documents"
]
}
}
}
Use Cases:
Full GitHub integration for issues, PRs, and repositories:
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@anthropic-ai/mcp-github"],
"env": {
"GITHUB_TOKEN": "ghp_xxxxxxxxxxxx"
}
}
}
}
Capabilities:
Example Prompts:
"Create an issue for the authentication bug we discussed"
"Review the latest PR and suggest improvements"
"Find all issues labeled 'bug' in the last week"
Direct database access for queries and schema exploration:
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": ["-y", "@anthropic-ai/mcp-postgres"],
"env": {
"POSTGRES_CONNECTION_STRING": "postgresql://user:pass@localhost:5432/dbname"
}
}
}
}
Features:
Perfect for Python and API development workflows.
NoSQL database integration:
{
"mcpServers": {
"mongodb": {
"command": "npx",
"args": ["-y", "@anthropic-ai/mcp-mongodb"],
"env": {
"MONGODB_URI": "mongodb+srv://user:pass@cluster.mongodb.net/dbname"
}
}
}
}
Team communication integration:
{
"mcpServers": {
"slack": {
"command": "npx",
"args": ["-y", "@anthropic-ai/mcp-slack"],
"env": {
"SLACK_BOT_TOKEN": "xoxb-xxxxxxxxxxxx"
}
}
}
}
Amazon Web Services integration:
{
"mcpServers": {
"aws": {
"command": "npx",
"args": ["-y", "@anthropic-ai/mcp-aws"],
"env": {
"AWS_ACCESS_KEY_ID": "AKIAXXXXXXXX",
"AWS_SECRET_ACCESS_KEY": "xxxxxxxx",
"AWS_REGION": "us-east-1"
}
}
}
}
Services Supported:
Run multiple MCP servers simultaneously:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@anthropic-ai/mcp-filesystem", "/projects"]
},
"github": {
"command": "npx",
"args": ["-y", "@anthropic-ai/mcp-github"],
"env": { "GITHUB_TOKEN": "ghp_xxx" }
},
"postgres-prod": {
"command": "npx",
"args": ["-y", "@anthropic-ai/mcp-postgres"],
"env": { "POSTGRES_CONNECTION_STRING": "postgresql://prod-url" }
},
"postgres-dev": {
"command": "npx",
"args": ["-y", "@anthropic-ai/mcp-postgres"],
"env": { "POSTGRES_CONNECTION_STRING": "postgresql://dev-url" }
}
}
}
Never hardcode credentials. Use environment variables:
# ~/.zshrc or ~/.bashrc
export GITHUB_TOKEN="ghp_xxxxxxxxxxxx"
export POSTGRES_URL="postgresql://..."
export SLACK_TOKEN="xoxb-xxxxxxxxxxxx"
Then reference in config:
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@anthropic-ai/mcp-github"],
"env": { "GITHUB_TOKEN": "${GITHUB_TOKEN}" }
}
}
}
Let's build a server for a custom CRM:
// crm-mcp-server/index.ts
import { Server, Tool } from "@anthropic-ai/mcp-server";
class CRMServer {
private server: Server;
private apiKey: string;
private baseUrl: string;
constructor() {
this.apiKey = process.env.CRM_API_KEY!;
this.baseUrl = process.env.CRM_BASE_URL!;
this.server = new Server({
name: "crm-server",
version: "1.0.0",
description: "Custom CRM integration"
});
this.registerTools();
}
private registerTools() {
// Tool 1: Search customers
this.server.addTool({
name: "search_customers",
description: "Search for customers by name, email, or status",
parameters: {
type: "object",
properties: {
query: { type: "string", description: "Search query" },
status: {
type: "string",
enum: ["active", "inactive", "lead"]
},
limit: { type: "number", default: 10 }
}
},
handler: async ({ query, status, limit }) => {
const customers = await this.searchCustomers(query, status, limit);
return JSON.stringify(customers);
}
});
// Add more tools...
}
start() {
this.server.start();
}
}
const crmServer = new CRMServer();
crmServer.start();
server.addTool({
name: "safe_query",
handler: async (params) => {
try {
const result = await dangerousOperation(params);
return JSON.stringify({ success: true, data: result });
} catch (error) {
return JSON.stringify({
success: false,
error: error.message
});
}
}
});
MCP servers become even more powerful with Agent Mode:
Example Workflow:
MCP Servers Active:
- postgres (database)
- github (version control)
- slack (notifications)
Prompt: "Create a feature branch, implement user analytics,
and notify the team when done"
Agent Mode with MCP:
1. github: Create branch "feature/analytics"
2. postgres: Query schema for user tables
3. Write analytics code
4. Run tests
5. github: Commit and push
6. github: Create pull request
7. slack: Post update to #dev channel
# Check if server runs manually
npx -y @anthropic-ai/mcp-github
# Check logs
tail -f ~/.config/antigravity/logs/mcp-*.log
For more solutions, see our complete troubleshooting guide.
Browse our MCP Server Directory for:
Last updated: December 2025
Related Articles: