MCP server exposing MongoDB collections with schema inference, query, aggregation, and optional read-only mode.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent โ or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag โ we're steadily working through the catalog.
๐ก Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Inspect callable tools, capabilities, and parameters exposed to AI agents by MCP Mongo Server.
A Model Context Protocol (MCP) server that lets AI assistants work with your MongoDB databases. It exposes your collections, infers their schemas, and runs queries, aggregations, and writes through a standard interface โ so tools like Claude Desktop and Cursor can read and reason about your data.
$out/$merge that could modify data).auto/none/force conversion of 24-character hex strings to ObjectIds.explain plans.convertTime helper turns Unix timestamps and date strings into UTC/GMT/ISO, so date queries stay unambiguous across timezones.Point the server at your database โ no install step needed:
Explore safely, without any chance of changing data:
This is the default, used by Claude Desktop, Cursor, and other local clients:
Expose an HTTP endpoint at /mcp for remote or multi-client access:
By default, only requests without a browser Origin (CLIs, IDEs) and requests
from localhost are accepted; everything else is rejected with 403 to guard
against DNS-rebinding attacks. Allow specific browser origins with
--allowed-origins:
| Flag | Description |
|---|---|
--read-only, -r | Block all write operations |
--allow-cross-db | Allow aggregation $out/$merge/$lookup to target other databases (off by default) |
--allow-server-js | Allow server-side JavaScript operators $function/$where/$accumulator (off by default) |
--transport, -t | stdio (default) or http |
--port, -p | HTTP port (default 3001) |
--allowed-origins | Comma-separated browser origins to allow in HTTP mode |
--json-limit | Max HTTP request body size (default 10mb) |
--auth-token | Require Authorization: Bearer <token> on the HTTP endpoint |
| Variable | Description |
|---|---|
MCP_MONGODB_URI | MongoDB connection URI (alternative to the argument) |
MCP_MONGODB_READONLY | Enable read-only mode ("true") |
MCP_MONGODB_ALLOW_CROSS_DB | Allow cross-database aggregation stages ("true") |
MCP_MONGODB_ALLOW_SERVER_JS | Allow server-side JavaScript operators ("true") |
MCP_PORT | HTTP port |
MCP_HTTP_ALLOWED_ORIGINS | Comma-separated browser origins to allow in HTTP mode |
MCP_HTTP_JSON_LIMIT | Max HTTP request body size (default 10mb) |
MCP_HTTP_AUTH_TOKEN | Bearer token required to access the HTTP endpoint |
Database scope. The server operates on the database in your connection
string. Aggregation stages that reach another database ($out, $merge,
$lookup with an explicit db) are rejected by default, so a pipeline can't
quietly read from or write to databases you didn't point it at. Enable them
with --allow-cross-db if you need them.
Server-side JavaScript. The aggregation operators $function, $where,
and $accumulator run arbitrary JavaScript on the MongoDB server. They are
rejected by default; enable them with --allow-server-js if you trust the
pipelines being run.
Read-only mode blocks every write path, including aggregation stages that
write or run server-side JavaScript ($out, $merge, $function, $where,
$accumulator).
Least privilege. Application-level checks only go so far โ the strongest guarantee comes from the database. Connect with a MongoDB user scoped to just the database you need, with read-only permissions when the assistant only needs to explore. That way the database itself enforces the boundary, as defense in depth.
MIT โ see LICENSE for details.
Factual signals from GitHub, npm, and our automated checks โ not a rating.
No reviews yet โ be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/kiliczsh-mcp-mongo-server)<a href="https://allmcps.com/mcp/kiliczsh-mcp-mongo-server"><img src="https://allmcps.com/api/badge/kiliczsh-mcp-mongo-server?style=directory" alt="MCP Mongo Server on AllMCPs" /></a>