
mcp-mongo-server
MCP server that lets AI assistants query and modify your MongoDB databases
The repository was last updated 22 days ago and is published under MIT.
mcp-mongo-server is an open-source MCP server for databases. It is available on CLI, API, Self-hosted, macOS, Linux and Windows.
- Pricing
- Open source
- Platforms
- CLI, API, Self-hosted
- GitHub stars
- 282
- Last commit
- Language
- TypeScript
- License
- MIT
Similar MCP servers
About mcp-mongo-server
Connects AI clients such as Claude Desktop and Cursor to MongoDB, so they can list collections, infer document structure, and run queries, aggregations and writes. It runs from npx with a single connection string and supports standalone, replica set, sharded and Atlas deployments over plain or TLS connections.
Safety controls are built in. A read-only flag blocks insert, update, index creation and aggregation stages such as $out and $merge, while cross-database stages and server-side JavaScript operators stay off unless explicitly enabled. Named connections can be defined in a JSON environment variable, each with its own database allowlist and read-only setting.
It suits developers and data analysts who want to explore a database in plain language, and teams that want to expose a shared database to several clients over HTTP with bearer-token auth.
What it does
- Schema inference
- Detects collection structure automatically from document samples so assistants understand the data shape.
- Read-only mode
- Blocks every write path globally or per connection for safe exploration.
- Query and aggregation
- Runs queries and aggregation pipelines, with optional explain plans.
- Named connections
- Defines multiple databases with individual permissions and database allowlists.
- Time conversion helper
- Converts Unix timestamps and date strings into UTC, GMT or ISO for unambiguous date queries.
- Stdio and HTTP transports
- Runs locally over stdio or as a remote HTTP endpoint with optional bearer-token auth.
Good for
- Asking an AI assistant questions about production or analytics data without writing queries by hand
- Exploring an unfamiliar MongoDB database safely with read-only access
- Generating aggregation pipelines from natural-language requests
- Sharing one database with several AI clients over a remote HTTP endpoint
Pricing
Open source
Free and MIT licensed; self-hosted via npm.
Prices change. Check npmjs.com before you buy.
mcp-mongo-server FAQ
Can mcp-mongo-server modify data?
Yes, by default it supports insert, update and index creation. Passing --read-only or setting MCP_MONGODB_READONLY to true blocks all writes.
Which MongoDB deployments are supported?
Standalone, replica set, sharded and Atlas deployments, over plain or TLS connections.
What Node.js version is required?
Node.js 20 or newer.
How is remote access restricted?
In HTTP mode only requests without a browser Origin and requests from localhost are accepted by default. You can allow specific origins and require a bearer token.
Is mcp-mongo-server free?
Yes. mcp-mongo-server is open source, so you can use and self-host it for free.
What are the best alternatives to mcp-mongo-server?
The closest alternatives to mcp-mongo-server are mongo-mcp, Mongodb MCP Server, Mongo Scout MCP, mongodb-lens and florentine-ai.
Where this comes from
- Description: written from the project's README.

