The official MongoDB MCP server, maintained by MongoDB, Inc., connects AI models directly to your MongoDB databases. Query documents, run aggregation pipelines, inspect collection schemas and manage indexes — all through plain English. Works with MongoDB Atlas, self-hosted clusters and local instances.
Bring your own
Claude Sonnet 4.5
Chat with 60+ AI models on the same workflow — switch to a different model mid-conversation and re-run the same prompt, or use Compare mode to put several side-by-side and balance quality vs. cost.
MongoDB connection URI (mongodb:// or mongodb+srv://). Supports Atlas, replica sets and local instances. Use a read-only user for safety.
How models use it and what it is built for.
MongoDB MCP wraps the MongoDB Node.js driver as a set of MCP tools. Models can list databases and collections, query documents with filter expressions derived from natural language, run aggregation pipelines for analytics, insert or update documents (with confirmation), inspect indexes, and describe collection schemas by sampling documents. It runs as a local stdio process configured with your connection URI — no cloud account required beyond your existing MongoDB setup. The server is open source under the Apache 2.0 license and published on npm as @mongodb-js/mongodb-mcp-server.
Typical tools an AI model can call. Exact names vary by version.
Copy any of these into MCP Agent Studio after connecting.
List all collections in the production database and their document counts.
Find the 10 most recent orders with status "pending" and total > $500.
Run an aggregation to show total revenue by product category for this month.
Show me the schema of the "users" collection by sampling 20 documents.
This is not a single-model product: you get the same MCP connection with 60+ models (Claude, GPT, Gemini, DeepSeek, open-weight, and more), you can switch mid-conversation, and you can open Compare mode to run the same prompt against multiple models at once. The card above is a suggested starting point for this server — not the only choice.
Default pick for MongoDB
Claude Sonnet 4.5
Claude Sonnet 4.5 generates correct aggregation pipelines and multi-step query logic reliably. Use Haiku for simple find queries to keep costs low.
Listing tools proves the server is reachable, not that a model can work with it. Evals go further: they read every tool on the server, write a test suite from its real schemas, and run it — code decides pass/fail on the responses (schema conformance, error codes, pagination, result caps) while a scoring model grades plain-English tasks driven through the tools.
Get a pass/fail report per tool with the evidence behind each verdict — and replay the same suite after every schema change. Destructive tools are excluded from the run.
Run evalsOpen MCP Agent Studio with the connection pre-filled. Add your token, pick any of 60+ models, and start chatting — no install required.
Open Agent StudioCommon questions about connecting, scoping and using it safely.
It is an official open-source MCP server from MongoDB, Inc. that lets AI models query and manage MongoDB databases through natural language. You give it a connection URI and it exposes find, aggregate, insert, update and schema-inspection tools to any MCP-compatible AI client.
Yes. Paste your Atlas connection string (mongodb+srv://...) as the connection URI. It also works with self-hosted replica sets, standalone instances and local development servers on mongodb://localhost:27017.
Create a dedicated read-only MongoDB user and scope it to only the databases the agent needs. Never use an admin or atlas admin credential. For extra safety, point the agent at a staging replica during initial setup.
Yes — insertOne, updateOne and deleteOne tools are available. The server asks for confirmation before writes, and you can restrict it to a read-only user at the database level to make mutation impossible.
MongoDB MCP speaks the MongoDB query language (BSON filters, aggregation pipelines) while Postgres MCP generates SQL. Both let AI models query your data in natural language — choose based on which database your application uses.