← Back to directory
M

MongoDB MCP Server

Official
Official MCP server for MongoDB databases and Atlas clusters
Category
Database #8 of 58
Stars
★ 1.1k Very popular
Transport
stdio (local process) · Streamable HTTP
Runtime
Node.js 22.13+ · Docker
Credentials
Optional API key
License
Apache-2.0
Last commit
Tools
52
70FMRS · B

Officially maintained by MongoDB, this MCP server is feature-rich, covering database and Atlas management, with read-only mode and security configs. Overall reliable, but security best practices should be followed.

Strongest · Documentation 16/20 Weakest · Reliability 10/20

Reliability
10/20
Security and permissions
16/20
Maintenance
14/20
Documentation
16/20
Setup experience
14/20
Why each score
Reliability 10/20
The manifest and README show a complete toolset, configuration surface, and transports, so the happy path is plausible; however no tests, CI workflows, or executable evidence were supplied, so the init/tool-list handshake and failure paths cannot be verified. Per static calibration, score stays at 10.
Security and permissions 16/20
Secrets are flagged in the manifest; the README recommends env vars over CLI args, least-privilege Atlas service accounts, read-only defaults in examples, confirmation for destructive tools, HTTP transport security warnings, and session-scoped connections with server-side JS disabled. No red-line issue is apparent, but source-level enforcement cannot be verified, so 16.
Maintenance 14/20
The repo is not archived, uses Apache-2.0, sits under the mongodb-js org, and ships versioned npm/OCI packages, indicating clear ownership and a license. No commit history, release cadence, issue-response, or dependency-update evidence was provided, so 14.
Documentation 16/20
The README covers prerequisites, multiple setup paths, authentication, a full configuration table, tool lists, resources, limits, and security guidance with clear structure. Deductions for no dedicated troubleshooting section, no per-tool parameter reference, and no cost info; hence 16.
Setup experience 14/20
Setup is clear: Node 22.13+ or Docker, with npx, Docker, HTTP, Copilot, OpenCode examples plus VS Code/Cursor install links. Few steps and mainstream client coverage. Per static calibration, >15 requires executable evidence, which is absent, so 14.

Static review · not runListed 2026-08-07

Read the FMRS scoring method →

Fit and risk

What it can accessUses the networkConnects to a database

Best for

  • Developers and data analysts who want to interact with MongoDB via natural language
  • Scenarios needing MongoDB integration into LLM workflows
  • Teams using MongoDB Atlas looking to automate cluster management

Not for

  • Users who need generic MCP services without database interaction
  • Users needing full write access without configuring safety measures (default is read-only)
  • Users requiring local storage or non-standard transports (only stdio and HTTP supported)

Required permissions

  • Network access: connect to MongoDB instance or Atlas API
  • File system access (optional): export data files, log files
  • Atlas API credentials (required for Atlas tools)

Risks and side effects

  • If read-only mode is not enabled, tools can modify or delete database data
  • Exposed Atlas API credentials could lead to unauthorized cluster management
  • HTTP transport without authentication may be exposed to unauthorized clients
  • Server-side JavaScript operators may be executed, but disabled by default

Setup

Before you start

Runtime:Node.js 22.13+ · Docker

MDB_MCP_CONNECTION_STRING optionalsecret MongoDB connection string, e.g. mongodb://localhost:27017/myDatabase, pointing to a local or Atlas instance.
MDB_MCP_API_CLIENT_ID optionalsecret Atlas Service Account API client ID, created in the MongoDB Atlas console; needed for Atlas tools.
MDB_MCP_API_CLIENT_SECRET optionalsecret Atlas Service Account API secret paired with the client ID; only needed for Atlas tools.
MDB_MCP_VOYAGE_API_KEY optionalsecret Voyage AI embeddings API key, only required for Atlas Local deployments with auto-embed vector search.
Other optional settings (1)
MDB_MCP_READ_ONLY optional Set to true to allow only read, connect, and metadata operations, disabling writes and deletes.
  1. Ensure Node.js v22.13.0 or higher is installed (check with node -v).
  2. Add the server configuration to your MCP client config file, e.g.:
{
  "mcpServers": {
    "MongoDB": {
      "command": "npx",
      "args": ["-y", "mongodb-mcp-server@latest", "--readOnly"],
      "env": {
        "MDB_MCP_CONNECTION_STRING": "mongodb://localhost:27017/myDatabase"
      }
    }
  }
}
  1. For Atlas tools, set Atlas API client ID and secret via environment variables or CLI args.
  2. For Docker, run docker run --rm -i mongodb/mongodb-mcp-server:latest.
  3. For HTTP transport, use --transport http.
claude_desktop_config.json
{
  "mcpServers": {
    "MongoDB": {
      "command": "npx",
      "args": [
        "-y",
        "mongodb-mcp-server@latest",
        "--readOnly"
      ],
      "env": {
        "MDB_MCP_CONNECTION_STRING": "mongodb://localhost:27017/myDatabase"
      }
    }
  }
}

Shown for Claude Desktop. Other clients may use a different file or key (VS Code uses "servers") — the configurator below converts it.

.vscode/mcp.json
{
  "servers": {
    "MongoDB": {
      "command": "npx",
      "args": [
        "-y",
        "mongodb-mcp-server@latest",
        "--readOnly"
      ],
      "env": {
        "MDB_MCP_CONNECTION_STRING": "mongodb://localhost:27017/myDatabase"
      }
    }
  }
}

Goes in your project's .vscode/mcp.json (VS Code uses a "servers" key).

Terminal
claude mcp add MongoDB -e MDB_MCP_CONNECTION_STRING=mongodb://localhost:27017/myDatabase -- npx -y mongodb-mcp-server@latest --readOnly

Run it in a terminal; replace any <…> placeholders with your own values first.

Check that it works

After adding the server config, check that tools like find and list-databases appear in your MCP client's tool list; ask the AI to run list-databases — a returned database list confirms the connection works.

Troubleshooting

  1. Check Node version with `node -v` to ensure v22.13.0+
  2. Verify MongoDB connection string is correct and network-accessible
  3. Confirm Atlas API credentials are valid and have required permissions
  4. Check logs (default to disk and forwarded to MCP client) for error details

Things to try

Once connected, you can ask your AI assistant things like:

  • List all collections in my local database
  • Find the 10 most recent documents in the orders collection
  • Create an index on the email field of the users collection
  • Create a free Atlas cluster and list my Atlas projects

Tools 52

aggregate read-only
Run an aggregation pipeline against a MongoDB collection
aggregate-db read-only
Run an aggregation against a MongoDB database
collection-indexes read-only
Describe the indexes for a collection
collection-schema read-only
Describe the schema for a collection
collection-storage-size read-only
Get the size of the collection
connect read-only
Connect to a MongoDB instance
count read-only
Count documents matching a filter in a collection
create-collection writes
Create a new collection (creates database if not exists)
Show 44 more tools
create-index writes
Create an index for a collection
db-stats read-only
Return statistics reflecting the use state of a single database
delete-many destructive
Remove all documents matching a filter from a collection
disconnect read-only
Close a MongoDB connection and revoke its connectionId
drop-collection destructive
Remove a collection or view and its associated indexes
drop-database destructive
Remove the specified database and its data files
drop-index destructive
Drop an index from a collection
explain read-only
Return statistics describing the execution of the winning plan
export read-only
Export query or aggregation results in EJSON format
find read-only
Run a find query against a MongoDB collection
insert-many writes
Insert an array of documents into a collection
list-collections read-only
List all collections for a given database
list-connections read-only
List active MongoDB connections and their connectionIds
list-databases read-only
List all databases for a MongoDB connection
mongodb-logs read-only
Return the most recent logged mongod events
rename-collection writes
Rename a collection in a database
update-many writes
Update all documents matching a filter in a collection
atlas-connect-cluster read-only
Connect to a MongoDB Atlas cluster and return a connectionId
atlas-create-access-list writes
Allow IP/CIDR ranges to access Atlas clusters
atlas-create-cluster writes
Create a MongoDB Atlas cluster (M10-M80)
atlas-create-db-user writes
Create a MongoDB Atlas database user
atlas-create-free-cluster writes
Create a free MongoDB Atlas cluster
atlas-create-project writes
Create a MongoDB Atlas project
atlas-get-performance-advisor read-only
Get Atlas performance advisor recommendations (indexes, slow queries, etc.)
atlas-inspect-access-list read-only
Inspect IP/CIDR ranges with access to Atlas clusters
atlas-inspect-cluster read-only
Inspect metadata of a MongoDB Atlas cluster
atlas-list-alerts read-only
List triggered alerts for a MongoDB Atlas project
atlas-list-clusters read-only
List MongoDB Atlas clusters
atlas-list-db-users read-only
List MongoDB Atlas database users
atlas-list-orgs read-only
List MongoDB Atlas organizations
atlas-list-projects read-only
List MongoDB Atlas projects
atlas-load-sample-dataset writes
Load a MongoDB sample dataset into an Atlas cluster
atlas-pause-resume-cluster writes
Pause or resume a dedicated (M10+) Atlas cluster
atlas-streams-build writes
Create Atlas Stream Processing resources (workspace, connection, processor)
atlas-streams-discover read-only
Discover and inspect Atlas Stream Processing resources
atlas-streams-manage writes
Manage Atlas Stream Processing resources (start/stop, modify)
atlas-streams-teardown destructive
Delete Atlas Stream Processing resources
atlas-upgrade-cluster writes
Upgrade an Atlas cluster tier (e.g., M0 to Flex or M10)
atlas-local-connect-deployment read-only
Connect to an Atlas Local deployment and return a connectionId
atlas-local-create-deployment writes
Create a MongoDB Atlas local deployment
atlas-local-delete-deployment destructive
Delete a MongoDB Atlas local deployment
atlas-local-list-deployments read-only
List MongoDB Atlas local deployments
list-knowledge-sources read-only
List available data sources in the MongoDB Assistant knowledge base
search-knowledge read-only
Search the MongoDB Assistant knowledge base for official documentation and expert guidance

Use cases

Let AI assistants directly query and manipulate MongoDB data
Manage MongoDB Atlas clusters, projects, database users, and alerts
Get performance advice and optimize database queries
Retrieve official MongoDB documentation and expert guidance

Supported clients

Claude Desktop
VS Code
Cursor
Windsurf
GitHub Copilot CLI
OpenCode

Listed from the project's documentation, not tested by this site.

Overview

The MongoDB MCP server is an official Model Context Protocol server maintained by MongoDB, enabling AI assistants to interact with MongoDB databases and MongoDB Atlas clusters through standard tools. It provides a comprehensive set of database operations (query, aggregation, index management) and Atlas management tools (cluster creation, performance advisor, stream processing), with features like read-only mode, index checking, and logging. Supports stdio and HTTP transports, configurable via environment variables or command-line arguments.

Similar servers

Source revision c0f436fd5dc5 Data synced 2026-10-11 Read the FMRS scoring method