mongodb-mcp-server
CommunityMCP server by mongodb-js · updated · ★ 1.1k · 84k downloads a week
MongoDB Model Context Protocol Server mongodb-mcp-server is a community project by mongodb-js, not verified by a company domain.
Last commit 3 days ago
Apache-2.0: permissive, fine for commercial use
Published package or server URL, 1,146 stars, original repository
Not checked yet. What we check
What you need
| Setting | Needed | What it is |
|---|---|---|
MDB_Environment variable | Optional | When set to true, allows configuration values to be overridden via request headers and query parameters. |
MDB_Environment variable, secret | Optional | Atlas API client ID for authentication. Required for running Atlas tools. |
MDB_Environment variable, secret | Optional | Atlas API client secret for authentication. Required for running Atlas tools. |
MDB_Environment variable | Optional | Base URL for the MongoDB Assistant API. |
MDB_Environment variable | Optional | Time in milliseconds that temporary database users created when connecting to MongoDB Atlas clusters will remain active before being automatically deleted. |
MDB_Environment variable | Optional | Comma separated values of tool names that require user confirmation before execution. Requires the client to support elicitation. |
MDB_Environment variable | Optional | 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 closed when the session ends — recommended w |
MDB_Environment variable, secret | Optional | MongoDB connection string for direct database connections. Optional, if not set, you'll need to call the connect tool before interacting with MongoDB data. |
MDB_Environment variable | Optional | When set to true, disallows the use of server-side JavaScript operators (such as $where, $function, and $accumulator) in query filters and aggregation pipelines. |
MDB_Environment variable | Optional | Comma separated values of tool names, operation types, and/or categories of tools that will be disabled. |
MDB_Environment variable | Optional | When true, runs the server in dry mode: dumps configuration and enabled tools, then exits without starting the server. |
MDB_Environment variable | Optional | Time in milliseconds the user has to respond to an elicitation request (such as a tool confirmation prompt) before it fails. |
MDB_Environment variable | Optional | Time in milliseconds between export cleanup cycles that remove expired export files. |
MDB_Environment variable | Optional | Time in milliseconds after which an export is considered expired and eligible for cleanup. |
MDB_Environment variable | Optional | Folder to store exported data files. |
MDB_Environment variable | Optional | When true, the HTTP transport allows requests with a session ID supplied externally through the 'mcp-session-id' header. When an external ID is supplied, the initialization request is optional. |
MDB_Environment variable | Optional | Deprecated. Use `monitoringServerHost` instead. Host address to bind the healthCheck HTTP server to (only used when transport is 'http'). If provided, `healthCheckPort` must also be set. |
MDB_Environment variable | Optional | Deprecated. Use `monitoringServerPort` instead. Port number for the healthCheck HTTP server (only used when transport is 'http'). If provided, `healthCheckHost` must also be set. |
MDB_Environment variable | Optional | Maximum size of the HTTP request body in bytes (only used when transport is 'http'). This value is passed as the optional limit parameter to the Express.js json() middleware. |
MDB_Environment variable | Optional | Header that the HTTP server will validate when making requests (only used when transport is 'http'). |
From the publisher's entry in the official MCP Registry. Required settings are already in the install config below as placeholders.
Install mongodb-mcp-server
Built from the published package, never by AIclaude mcp add mongodb-mcp-server -- npx -y mongodb-mcp-serverRun in your terminal. Add --scope user to use it in every project.
{
"mcpServers": {
"mongodb-mcp-server": {
"command": "npx",
"args": [
"-y",
"mongodb-mcp-server"
]
}
}
}Settings, Developer, Edit config. Paste into claude_desktop_config.json and restart.
{
"mcpServers": {
"mongodb-mcp-server": {
"command": "npx",
"args": [
"-y",
"mongodb-mcp-server"
]
}
}
}Add to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (this project).
{
"servers": {
"mongodb-mcp-server": {
"command": "npx",
"args": [
"-y",
"mongodb-mcp-server"
]
}
}
}Add to .vscode/mcp.json. VS Code uses "servers", not "mcpServers".
codex mcp add mongodb-mcp-server -- npx -y mongodb-mcp-server{
"mcpServers": {
"mongodb-mcp-server": {
"command": "npx",
"args": [
"-y",
"mongodb-mcp-server"
]
}
}
}Add to ~/.gemini/config/mcp_config.json (all projects) or .agents/mcp_config.json (this project).
gemini mcp add mongodb-mcp-server npx -y mongodb-mcp-serverGemini CLI was replaced by Antigravity CLI in June 2026 and remains only for enterprise licences and paid API keys.
MCP servers run with your permissions and can read what you give them access to. Some need an API key: check the README and add it under env in the mongodb-mcp-server block.
Weekly newsletter
Like mongodb-mcp-server? Get the best new MCP servers every week
The best new tools, security warnings before you install something risky, and one practical tip. Free, three minute read.
Alternatives to mongodb-mcp-server
All alternatives →MCP server for interacting with the Supabase platform
Built-in MCP server for ArcadeDB multi-model database (graph, document, vector, time-series)
MCP Toolbox for Databases enables your agent to connect to your database.
MCP Toolbox for Databases enables your agent to connect to your database.
Real-time Kubernetes network traffic visibility and API analysis for HTTP, gRPC, Redis, Kafka, DNS.
Self-learning vector database for Node.js — hybrid search, Graph RAG, FlashAttention-3, HNSW, 50+ attention mechanisms
mongodb-mcp-server: common questions
How do I install mongodb-mcp-server?
In Claude Code run claude mcp add mongodb-mcp-server -- npx -y mongodb-mcp-server. For Claude Desktop, Cursor and VS Code, paste the config shown above and restart. See the install guides.
Is mongodb-mcp-server the official server?
mongodb-mcp-server is a community project by mongodb-js, not verified by a company domain.
Is mongodb-mcp-server free?
The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.
Is mongodb-mcp-server safe to use?
It scores 91 of 100. Grades: maintenance A, licence A, quality B. The security check has not run for it yet. Review the code before you install. How grades work.
What are alternatives to mongodb-mcp-server?
Similar MCP servers: Supabase, ArcadeDB MCP Server, MCP Toolbox for Databases, MCP Toolbox for Databases.
Does mongodb-mcp-server work with ChatGPT?
Not directly. It runs locally, and ChatGPT only connects to remote servers with a URL. Use it in Claude Code, Claude Desktop, Cursor, VS Code or Codex.
