MongoDB & Atlas MCP Server
Official Model Context Protocol server to connect AI agents to MongoDB databases, Atlas clusters, and Stream Processing.
About this Server
The official MongoDB Model Context Protocol (MCP) server connects AI coding agents directly to self-hosted MongoDB instances and cloud-hosted MongoDB Atlas clusters. It gives assistants deep capabilities to query documents, build aggregation pipelines, inspect collection schemas and storage sizes, create indexes, analyze query explain plans, and manage Atlas clusters, projects, users, and stream processing pipelines.
Direct low-latency RPC protocol communication with structured JSON schemas.
Restricted capability bounds to prevent accidental modifications or leakage.
Security & Best Practices
When to Use (and When Not To)
- •Natural language document queries, aggregation pipeline generation, and schema discovery in MongoDB
- •Diagnosing slow database queries with query optimizer explain plans and Atlas Performance Advisor
- •Automating Atlas cloud cluster management, stream processing deployment, and database user creation
- •High-dimensional vector embedding similarity searches (use Chroma MCP instead)
- •Pure relational multi-engine SQL joins across MySQL/SQLite/Oracle (use DBHub MCP instead)
- •Elasticsearch Query DSL and cluster shard inspection (use Elasticsearch MCP instead)
Install & Setup
claude mcp add mongodb -- npx -y mongodb-mcp-server@latestExposed Tools & Endpoints
14 toolsFunctions your AI agent can invoke via this Model Context Protocol server
Runs a find query with filters, projections, and sort options against a MongoDB collection.
Executes multi-stage aggregation pipelines against a MongoDB collection.
Infers and describes the document schema, field types, and structure for a collection.
Lists and describes all indexes configured on a MongoDB collection.
Returns query execution statistics and the winning plan chosen by the query optimizer.
Inserts an array of documents into a specified MongoDB collection.
Updates all documents matching a filter expression in a collection.
Removes documents matching a filter expression from a collection.
Lists all collections in a given MongoDB database.
Lists all databases available on the connected MongoDB instance.
Inspects cluster state, tier, disk sizing, and connection strings for MongoDB Atlas clusters.
Retrieves Atlas Performance Advisor index recommendations and slow query log analysis.
Inspects Atlas Stream Processing resources, processor health, stats, and networking.
Searches official MongoDB Assistant documentation, expert guidance, and syntax manuals.