Connect to MongoDB Atlas clusters from Google Antigravity. Query collections, manage indexes, view aggregation pipelines, and perform database operations with natural language.
# MongoDB Atlas MCP Server for Google Antigravity The MongoDB Atlas MCP Server provides seamless integration between Google Antigravity and your MongoDB Atlas clusters. Query data, analyze schemas, and manage your database using natural language. ## Why Use MongoDB Atlas MCP? MongoDB Atlas is the leading cloud database service for modern applications. This MCP server enables: - **Natural Language Queries**: Ask questions about your data in plain English - **Schema Discovery**: Understand your data structure automatically - **Aggregation Builder**: Create complex pipelines with AI assistance - **Real-time Monitoring**: View cluster health and performance metrics ## Key Features ### Data Operations - Find, insert, update, and delete documents - Run aggregation pipelines - Bulk operations for large datasets - Text search and geospatial queries ### Schema Management - Analyze collection schemas - Create and manage indexes - Schema validation rules - Data modeling suggestions ### Cluster Administration - Monitor cluster performance - View connection statistics - Manage database users - Configure network access ## Configuration ```json { "mcpServers": { "mongodb-atlas": { "command": "npx", "args": ["@mongodb/atlas-mcp-server"], "env": { "MONGODB_URI": "mongodb+srv://user:password@cluster.mongodb.net/database", "MONGODB_DATABASE": "your-database" } } } } ``` ## Common Use Cases ### Query Data Ask Antigravity: "Find all users who signed up in the last 7 days and have verified their email" ### Aggregation Pipelines Ask Antigravity: "Create an aggregation pipeline to get total revenue by product category for Q4 2024" ### Index Optimization Ask Antigravity: "Analyze the users collection and suggest indexes for common query patterns" ### Schema Analysis Ask Antigravity: "Show me the schema of the orders collection with field types and sample values" ## Best Practices 1. **Connection Strings**: Store MongoDB URI in environment variables, never in code 2. **Indexes**: Create indexes for frequently queried fields 3. **Aggregations**: Use $match early in pipelines to reduce data processed 4. **Projections**: Only request fields you need to reduce bandwidth 5. **Connection Pooling**: Reuse connections for better performance ## Security Considerations - Use Atlas IP Access List to restrict connections - Enable authentication and use strong passwords - Implement field-level encryption for sensitive data - Regular backup and point-in-time recovery The MongoDB Atlas MCP Server makes database operations intuitive and efficient in your Google Antigravity workflow.
{
"mcpServers": {
"mongodb-atlas": {
"args": [
"@mongodb/atlas-mcp-server"
],
"command": "npx"
}
}
}