Home / Databases / mongodb-mcp-server
mongodb-mcp-server
io.github.mongodb-js/mongodb-mcp-server · v3.3.0 stdio
MongoDB Model Context Protocol Server
Description supplied by the publisher in the MCP Registry. We have not tested this server.
Use it to let an agent explore collections and run queries against MongoDB; prefer a read-only user while you test. At our last check: 1,161 GitHub stars, about 108,205 npm downloads a week, TypeScript, Apache-2.0; connects over stdio; Socketlist score 90/100.
Ranks #7 of 196 Databases servers on Socketlist by score, with 1,161 GitHub stars and a last code push 18d ago.
Install
npx -y mongodb-mcp-serverdocker run -i --rm docker.io/mongodb/mongodb-mcp-server:3.3.0Assembled from the package metadata in the official MCP Registry (including any subcommand or flag the publisher lists). Some publishers do not list the subcommand that starts MCP mode, so confirm the command in the README, along with any required configuration and credentials, before connecting it to real data.
Connect mongodb-mcp-server to Claude Code, Cursor or VS Code
Built from what the publisher declared in the official MCP Registry (the launch command above). We have not run this server. Replace anything in <angle brackets>, and keep keys and tokens in your environment, not in a shared file.
Claude Code
Run in a terminal. Adds the server at local scope; add --scope project or --scope user to share it. Secret variables the publisher declares are included; drop any the README says are optional. Claude Code setup guide.
claude mcp add --env MDB_MCP_API_CLIENT_ID=<mdb_mcp_api_client_id> --env MDB_MCP_API_CLIENT_SECRET=<mdb_mcp_api_client_secret> --env MDB_MCP_CONNECTION_STRING=<mdb_mcp_connection_string> --env MDB_MCP_CONNECTION_STRINGS=<mdb_mcp_connection_strings> --env MDB_MCP_VOYAGE_API_KEY=<mdb_mcp_voyage_api_key> --transport stdio mongodb-mcp-server -- npx -y mongodb-mcp-server.mcp.json (Claude Code project scope, VS Code with Copilot)
Put this in a .mcp.json file at the project root. ${NAME} reads the value from your environment, so no secret is written to the file. VS Code and .mcp.json guide.
{
"mcpServers": {
"mongodb-mcp-server": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"mongodb-mcp-server"
],
"env": {
"MDB_MCP_API_CLIENT_ID": "${MDB_MCP_API_CLIENT_ID}",
"MDB_MCP_API_CLIENT_SECRET": "${MDB_MCP_API_CLIENT_SECRET}",
"MDB_MCP_CONNECTION_STRING": "${MDB_MCP_CONNECTION_STRING}",
"MDB_MCP_CONNECTION_STRINGS": "${MDB_MCP_CONNECTION_STRINGS}",
"MDB_MCP_VOYAGE_API_KEY": "${MDB_MCP_VOYAGE_API_KEY}"
}
}
}
}Cursor
Put this in .cursor/mcp.json in the project, or ~/.cursor/mcp.json for every project. Cursor mcp.json guide.
{
"mcpServers": {
"mongodb-mcp-server": {
"command": "npx",
"args": [
"-y",
"mongodb-mcp-server"
],
"env": {
"MDB_MCP_API_CLIENT_ID": "${env:MDB_MCP_API_CLIENT_ID}",
"MDB_MCP_API_CLIENT_SECRET": "${env:MDB_MCP_API_CLIENT_SECRET}",
"MDB_MCP_CONNECTION_STRING": "${env:MDB_MCP_CONNECTION_STRING}",
"MDB_MCP_CONNECTION_STRINGS": "${env:MDB_MCP_CONNECTION_STRINGS}",
"MDB_MCP_VOYAGE_API_KEY": "${env:MDB_MCP_VOYAGE_API_KEY}"
}
}
}
}Configuration the publisher declares
| Environment variable | Required | Secret | Publisher's note |
|---|---|---|---|
MDB_MCP_AGGREGATION_COUNT_MAX_TIME_MS_CAP | No | No | Deprecated. Use `aggregationCountTimeoutMs` instead. |
MDB_MCP_AGGREGATION_COUNT_TIMEOUT_MS | No | No | The maximum time in milliseconds for the count phase of aggregation operations. This is used to limit the time spent counting documents when determining if results were capped. |
MDB_MCP_ALLOW_REQUEST_OVERRIDES | No | No | When set to true, allows configuration values to be overridden via request headers and query parameters. |
MDB_MCP_API_CLIENT_ID | No | Yes | Atlas API client ID for authentication. Required for running Atlas tools. |
MDB_MCP_API_CLIENT_SECRET | No | Yes | Atlas API client secret for authentication. Required for running Atlas tools. |
MDB_MCP_ASSISTANT_BASE_URL | No | No | Base URL for the MongoDB Assistant API. |
MDB_MCP_ATLAS_TEMPORARY_DATABASE_USER_LIFETIME_MS | No | No | Time in milliseconds that temporary database users created when connecting to MongoDB Atlas clusters will remain active before being automatically deleted. |
MDB_MCP_CONFIRMATION_REQUIRED_TOOLS | No | No | Comma separated values of tool names that require user confirmation before execution. Requires the client to support elicitation. |
MDB_MCP_CONNECTION_CONNECT_TIMEOUT_MS | No | No | Milliseconds a MongoDB connection may stay in the 'connecting' state (e.g. an in-progress OIDC flow) before it is closed. Bounds a dial that never settles so it cannot pin a connection indefinitely. K |
MDB_MCP_CONNECTION_IDLE_TIMEOUT_MS | No | No | Milliseconds a MongoDB connection may stay unused (no tool call touching it) before it is closed to release the underlying connection pool and its server-side state. Applied per connection regardless |
MDB_MCP_CONNECTION_SCOPE | No | No | Visibility scope for MongoDB connections created at runtime. With 'session' (the default), each MCP session only sees the connections it created (plus the shared 'preconfigured' one) and they are clos |
MDB_MCP_CONNECTION_STRING | No | Yes | MongoDB connection string for direct database connections, exposed under the connectionId "preconfigured". Optional, if not set, you'll need to call the connect tool before interacting with MongoDB da |
41 more are listed in the registry entry; see the README for the full set.
"Required" and "secret" are the publisher's own flags in the registry, and many publishers leave them unset, so check the README too.
Allowlist entry
If your organisation restricts MCP servers, this is the entry an admin adds to allowedMcpServers in Claude Code managed settings or a GitHub Copilot enterprise managed-settings.json. A serverCommand entry must match the configured command and arguments exactly, so change both together.
{
"allowedMcpServers": [
{
"serverCommand": [
"npx",
"-y",
"mongodb-mcp-server"
]
}
]
} How allowlists work in each client: MCP server allowlists for Claude Code, GitHub Copilot and Cursor. Before you connect it to real data: 10 security checks for MCP servers.
Score breakdown
| Part | Points | What we observed | Result |
|---|---|---|---|
| Maintenance | 40/40 | Last push 18d ago, 9 open issues | Strong |
| Security hygiene | 25/35 | Licence Apache-2.0, SECURITY.md missing, published package or hosted endpoint | Fair |
| Adoption | 25/25 | 1,161 GitHub stars, 108,205 npm downloads a week | Strong |
Result: Strong is 80% or more of the part's points, Fair 50% or more. Automated signals, not a security audit. How we score.
Maintain this server? Claim or correct this listing, or get featured in Databases. Paid placements are labelled and never change the score.
Five scored MCP servers, every Monday
The Plug Weekly is a free email picked from these scores, with a short Best of MCP servers PDF when you join. About a 3-minute read. Unsubscribe any time.
| GitHub stars | 1,161 |
| npm weekly downloads | 108,205 |
| Last push | 18d ago |
| Licence | Apache-2.0 |
| Open issues | 9 |
| SECURITY.md | No |
| Language | TypeScript |
| Latest version published | 2026-11-09 |
Signals captured from GitHub, npm and the official MCP Registry on November 11, 2026. See the scoring method.
Similar servers
Compare all alternativesArcadeDB MCP Server
Score 79. Maintenance 35 of 40, security 29 of 35, adoption 15 of 25.com.arcadedb/mcp-server
Built-in MCP server for ArcadeDB multi-model database (graph, document, vector, time-series)
ArcadeDB
Score 79. Maintenance 35 of 40, security 29 of 35, adoption 15 of 25.io.github.ArcadeData/arcadedb
Multi-Model database with built-in MCP server for SQL, Cypher, Gremlin, and GraphQL.