
This is a Model Context Protocol (MCP) server for interacting with AIStor object stores.

A Model Context Protocol server that lets AI assistants explore MongoDB collections, infer schemas, and run queries, aggregations, and writes.
MCP MongoDB Server is cataloged as an MCP server attributed to kiliczsh. A Model Context Protocol server that lets AI assistants explore MongoDB collections, infer schemas, and run queries, aggregations, and writes. It is categorized under databases storage. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.
Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.
Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.
能力定义尚未审核。未核验的采集内容不会作为可信接口展示。
暂无可展示的已审核记录。这不表示上游不支持此能力。
暂无可展示的已审核记录。这不表示上游不支持此能力。
暂无可展示的已审核记录。这不表示上游不支持此能力。
Email delivery is not connected. This page does not collect email addresses or create subscriptions.
Browse the registry for current listings instead.
Reviews for MCP MongoDB Server are not available yet
Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.
Yes. Named connections restrict selection to their configured databases, and cross-database aggregation stages are rejected by default unless enabled.
Yes, long operations report progress and can be cancelled mid-flight.
Conversion is configurable with `auto`, `none`, or `force` modes for 24-character hex strings.
README.md · 30f80b503465 · 采集于 2026-11-13 09:35:36 UTC
保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。
当前显示最后一次成功采集的文档快照,请以来源页面为准。
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:
npx -y mcp-mongo-server mongodb://localhost:27017/mydatabase
Explore safely, without any chance of changing data:
npx -y mcp-mongo-server mongodb://localhost:27017/mydatabase --read-only
This is the default, used by Claude Desktop, Cursor, and other local clients:
npx -y mcp-mongo-server "mongodb://user:pass@localhost:27017/mydatabase"
Expose an HTTP endpoint at /mcp for remote or multi-client access:
npx -y mcp-mongo-server "mongodb://user:pass@localhost:27017/mydatabase" --transport http --port 3001
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:
npx -y mcp-mongo-server "mongodb://..." --transport http --port 3001 --allowed-origins "https://app.example.com"
| 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_CONNECTIONS | JSON object of named MongoDB connections and their database permissions |
MCP_MONGODB_MAX_RESULT_DOCUMENTS | Optional document cap for query and aggregate |
MCP_MONGODB_MAX_RESULT_BYTES | Optional UTF-8 byte cap for the compact JSON results array, minimum 2 |
MCP_MONGODB_QUERY_TIMEOUT_MS | Optional MongoDB operation timeout in milliseconds for query, aggregate, listIndexes, and query count and explain operations |
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 |
Set MCP_MONGODB_CONNECTIONS to a JSON string. This MCP client configuration
uses a local build and the two Docker test databases.
{
"mcpServers": {
"mongodb": {
"command": "node",
"args": [
"/absolute/path/to/mcp-mongo-server/build/index.js"
],
"env": {
"MCP_MONGODB_CONNECTIONS": "{\"default\":{\"uri\":\"mongodb://127.0.0.1:37017/mcp_test\"},\"analytics\":{\"uri\":\"mongodb://127.0.0.1:37018/mcp_test?directConnection=true\",\"databases\":[\"mcp_test\",\"mcp_test_secondary\"],\"readOnly\":true}}"
}
}
}
}
listConnections and listDatabases. Pass connectionId and database to database tools and the collection analysis prompt. Omitted selectors use the default connection and its URI database.databases to allow only the URI database. If supplied, the list must include the URI database. Global read-only mode applies to every connection.listConnections to choose a writable target.MCP_MONGODB_URI can supply default when the JSON contains only secondary connections. Named connections default to a 5-second server selection timeout. Set serverSelectionTimeoutMS in the URI to override it.resources/list reports its ID and fails. Tools targeting other connections remain usable.Database scope. The server operates on the selected database.
Named connections restrict selection to their configured databases.
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. Named connections still enforce their
database allowlist.
Server-side JavaScript. The operators $function, $where, and
$accumulator are blocked by default in aggregation pipelines and in the
filters for query, count, and update. In read-write mode,
--allow-server-js enables these operators.
Read-only mode blocks writes, including the $out and $merge
aggregation stages. It also blocks server-side JavaScript even when
--allow-server-js is set.
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.
Claim this server with your GitHub account to request manual ownership verification.
Link to the catalog listing for MCP MongoDB Server from your README. This badge does not certify ownership, compatibility or security.
[](https://awesome-mcp.com/servers/mcp-mongo-server)Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.
来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。
尚无已审核的包 / 镜像标识,暂不展示下载统计。
Alternative and complementary servers in the same category

This is a Model Context Protocol (MCP) server for interacting with AIStor object stores.

A Model Context Protocol server that lets AI assistants run SQL queries against AWS Athena databases and retrieve results.

A Model Context Protocol (MCP) server that exposes access to an InfluxDB v2 instance using the InfluxDB OSS API v2.