Official MongoDB MCP server connecting AI agents to Atlas, Community, and Enterprise deployments
Includes Performance Advisor integration, vector search support, and auto-embedding generation
Open source with stdio and HTTP transport — runs in VS Code, Cursor, Windsurf, and Docker
Pricing: Free forever
Best for: Individuals & startups
Pros & Cons
Pros
Official first-party server backed by MongoDB with regular feature updates
Covers the full stack — Atlas cloud management, local dev clusters, and database operations
Built-in vector search and embedding generation streamlines AI-native workflows
Performance Advisor integration surfaces optimization insights directly in your editor
Cons
Atlas-specific features (Performance Advisor, cluster management) require an Atlas account
Auto-embedding generation is limited to Voyage AI models — no bring-your-own-model option yet
Complex tool surface area can overwhelm simple use cases that only need basic queries
Key Features
Atlas management tools for organizations, projects, clusters, and database usersFull CRUD operations — insert, update, delete documents and run aggregation pipelinesPerformance Advisor integration for index recommendations and slow query diagnosticsVector search index creation with automatic embedding generation via Voyage AILocal cluster management using the mongodb-atlas-local Docker imageSchema inspection and collection metadata tools for context-aware code generationSupports stdio and HTTP transport — works in IDEs, CLI agents, and Docker deploymentsOpen source with community contributions and official MongoDB maintenance
MongoDB MCP is the official Model Context Protocol server from MongoDB that connects AI-powered developer tools to MongoDB Atlas clusters, Community Edition, and Enterprise Advanced deployments. It lets AI agents explore databases, run queries, manage indexes, and perform CRUD operations through natural language — directly inside IDEs like VS Code, Cursor, and Windsurf.
The server organizes its tools into three categories: Atlas tools for managing cloud resources (organizations, projects, clusters, database users), local Atlas tools for creating and managing local development clusters via the mongodb-atlas-local Docker image, and database tools for document operations, aggregation pipelines, and schema inspection. Recent updates added Performance Advisor integration so you can surface index recommendations and slow query diagnostics without leaving your editor.
MongoDB MCP also supports vector search workflows. The insert-many tool can auto-generate embeddings using Voyage AI models for fields with vector search indexes, removing the manual embedding step. The CreateIndex tool handles both standard and vector search indexes through a single interface. For local development, the server can spin up ephemeral MongoDB clusters on demand, cutting setup time to seconds. The server is open source, runs via stdio or HTTP transport, and can be self-hosted or deployed in Docker.
Does MongoDB MCP work with self-hosted MongoDB or only Atlas?
The official MongoDB MCP Server supports both Atlas clusters and local/self-hosted MongoDB instances via connection string. Atlas-specific features like Atlas Search indexes and vector search require an Atlas deployment, but basic CRUD operations and aggregation pipelines work with any MongoDB instance.
Can the AI assistant create and drop collections?
Yes. The server provides tools for creating collections, dropping collections, and managing indexes including Atlas Search and vector search indexes. Write operations are available by default — configure your connection string with a read-only user if you want to restrict access.
What is the vector search capability?
On Atlas deployments, the server can create and query Atlas Vector Search indexes, enabling semantic similarity searches across documents. This is useful for RAG (Retrieval-Augmented Generation) workflows where the AI stores and retrieves embeddings directly within MongoDB.
How do I connect the server to my database?
Set the MDB_MCP_CONNECTION_STRING environment variable to your MongoDB connection string (e.g., mongodb+srv://user:pass@cluster.mongodb.net/). The server auto-discovers databases and collections. You can also use MDB_MCP_CONNECTION_STRINGS for multiple clusters with named aliases.