MongoDB MCP Server
Official MongoDB MCP server: queries and aggregations, index management, Atlas clusters and local deployments
- 1,152 ★ on the repository
- Last commit
- Apache-2.0
Broad access
Why this level
- Without --readOnly it can delete documents, collections and databases
- Can create and modify Atlas clusters, affecting costs
- Handles connection strings and secrets
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add mcp/mongodb-mcp-serverDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewBroad accessThe tool can change data, run commands or handle secrets.
- Without --readOnly it can delete documents, collections and databases
- Can create and modify Atlas clusters, affecting costs
- Handles connection strings and secrets
This is third-party code. Review the repository files before installing.
What it does
The server connects the agent to any MongoDB database via a connection string: find, aggregate, count, collection schema and indexes, query explain plans, result export, plus inserting, updating and deleting documents. With Atlas service account credentials it adds tools for projects, clusters, database users, access lists, alerts, the performance advisor and Stream Processing. There are tools for Atlas Local deployments and search over the MongoDB knowledge base. The --readOnly flag keeps only read operations.
Who it is for. For developers and administrators working with MongoDB or MongoDB Atlas.
Good fit when
- You need to explore collection schemas and write an aggregation on real data
- You need to find why a query is slow and pick an index
- You need to create or inspect an Atlas cluster from the agent
Not a fit when
- The project uses a relational database
- The agent must not access production data even read-only
Example request
Show the schema of the orders collection and find which indexes are missing for common queriesMCP
- Transport
- stdio, http
- Authentication
- key is optional
Environment variables
MDB_MCP_CONNECTION_STRINGsecret- MongoDB connection string
MDB_MCP_API_CLIENT_IDsecret- Atlas service account client ID for Atlas tools
MDB_MCP_API_CLIENT_SECRETsecret- Atlas service account client secret
MDB_MCP_READ_ONLY- true keeps only read operations
MDB_MCP_DISABLED_TOOLS- Tools to disable
Limitations
Requires Node.js 22.13 or later. Atlas tools need service account credentials, which should have minimal permissions. Without --readOnly the agent can delete documents, collections and databases. Atlas may be unavailable from Russia; self-hosted MongoDB works without restrictions.
How to disable. Remove the MongoDB block from your MCP client config or uninstall the mongodb plugin in your agent.
FAQ
How do I stop the agent from changing data?
Start with --readOnly or MDB_MCP_READ_ONLY=true; create, update and delete tools are not registered.
Can I avoid running the server locally?
For Atlas there is a MongoDB-hosted server with OAuth, installed as the mongodb-atlas plugin in Cursor, VS Code, Claude and Codex.
Discussion
No questions or reviews yet.
Related
MCP serversMCP MongoDB Server (kiliczsh)
MCP MongoDB Server
An MCP server that gives an agent queries, aggregations and writes in MongoDB and starts with one npx command, no install
MCP server that gives an agent access to MySQL: schema inspection and queries, read-only by default, writes behind flags
Official YDB MCP server
YDB MCP
YDB's own official MCP server from the database's developers: parameterized SQL queries, execution plans, directory browsing, and a base for custom servers
Redis's official MCP server: strings, hashes, streams, JSON and vector search from your agent
A Python MCP server for MySQL: listing tables, reading data, running SQL and inspecting schema through a controlled interface
Official Tableau MCP server: the agent finds data sources, sends queries to them and opens dashboards and Pulse metrics
README in short
The README offers several install paths: official mongodb and mongodb-atlas plugins for various agents, an interactive setup script, a setup skill and manual config. All config examples include --readOnly. It lists every tool for databases, Atlas, Atlas Local and the knowledge base, plus all configuration options, proxy support and cloud deployment. Apache-2.0 licensed.