Mongodb MCP Server logo

Mongodb MCP Server

Connect AI agents to MongoDB databases and Atlas with query, administration, diagnostics, and data-management tools.

Install Mongodb MCP Server

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "mongodb-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "mongodb-mcp-server@latest"
      ],
      "env": {
        "MDB_MCP_CONNECTION_STRING": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

Install not yet sandbox-tested— we haven't run this command through our automated sandbox yet. Not a red flag; we're working through the catalog.

Overview

mongodb-mcp-server connects MCP-compatible AI agents to MongoDB databases, self-managed deployments, and MongoDB Atlas. It exposes tools for querying collections, inspecting schemas and indexes, modifying data, managing databases, and reviewing diagnostics. Atlas-specific tools can create clusters, users, and access-list entries, while local setup accepts a MongoDB connection string or Atlas API credentials. Reach for it when an agent needs operational access to MongoDB through a standard local MCP process.

Use cases

  • Query MongoDB collections with natural-language requests
  • Inspect collection schemas, indexes, and storage usage
  • Create and manage MongoDB Atlas clusters
  • Analyze query execution plans and database statistics
  • Insert, update, delete, or export MongoDB documents

Key features

  • MongoDB and MongoDB Atlas connectivity
  • Find, aggregation, count, and export operations
  • Collection, index, database, and schema management
  • Multi-document insert, update, and delete tools
  • Query plans, database statistics, and mongod logs
  • Atlas cluster, user, and access-list administration

Tools53

What Mongodb MCP Server lets your agent do. Expand a tool for its parameters.

Self-reported~1.7k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked Today

Recent health check succeeded.

15/15 checks healthy over the last 41d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 13d ago via OSV.dev · mongodb-mcp-server@latest (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars1.2kStargazers on the source repository.
npm downloads427kPackage downloads in the last 30 days.
Last commitTodayMost recent push to the default branch.
Tools exposed53Callable tools this server registers over MCP.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How Mongodb MCP Server works

What mongodb-mcp-server does

mongodb-mcp-server gives an MCP client an interface for working with MongoDB databases and MongoDB Atlas. Its database tools cover reads, writes, collection and database administration, metadata inspection, query analysis, exports, and recent MongoDB server events. Atlas tools add cluster connectivity and selected project-management operations.

The package can connect to a self-managed MongoDB deployment or an Atlas cluster. Atlas administration uses MongoDB Atlas service-account API credentials, while database access can use a MongoDB connection string. The project is listed in the Databases category and is suited to agents that need to inspect or operate on MongoDB data through natural-language requests.

How it works

The server runs locally through the npm package and communicates with an MCP client. A connection is established with the connect or atlas-connect-cluster tool, which returns a connection ID for use with subsequent database tools. Multiple Atlas connections can remain active at the same time. list-connections helps identify active connection IDs, and disconnect closes a connection and revokes its ID.

A setup command provides an interactive path for configuring a connection string or Atlas credentials:

Terminal
npx -y mongodb-mcp-server@latest setup

The package requires Node.js 22.13 or later. The project also provides official agent plugins for local MongoDB access and for connecting to the MongoDB-hosted Atlas MCP server over OAuth.

Setup and configuration

Start with a MongoDB connection string for a database deployment, or use Atlas service-account API credentials for the Atlas tools. The setup flow can configure either option. Manual client configuration is also supported; the exact configuration-file syntax depends on the MCP client.

For a local MCP configuration, the package can be launched with npx. The VS Code and Cursor installation examples use the mongodb-mcp-server package and pass MDB_MCP_CONNECTION_STRING as the connection-string environment variable. A read-only launch option is shown for those integrations.

Sensitive connection strings and API credentials should preferably be supplied through environment variables rather than command-line arguments, because command-line values can appear in process listings or logs. Atlas service accounts should receive only the permissions needed for the intended operations.

Tools and capabilities

Database and collection operations include:

  • Query documents with find, count matches, run aggregations, and export query or aggregation results as EJSON.
  • Insert, update, or delete multiple documents.
  • Create, rename, and drop collections; list collections and databases.
  • Create, inspect, and drop indexes; inspect collection schema and storage size.
  • Return database statistics, explain query plans, and recent mongod events.
  • Create or drop databases and connect to or disconnect from MongoDB instances.

Atlas operations include connecting to a cluster, creating a free cluster, creating M10–M80 clusters, creating database users, and adding IP or CIDR ranges to an access list. Atlas cluster creation supports replica sets or a single shard; compute and disk autoscaling behavior is configured by the tool, and customer-managed-key encryption at rest is supported.

Limitations and notes

Write and administration tools can alter or remove data, collections, indexes, and databases. Use least-privilege credentials, especially for Atlas service accounts, and consider the read-only launch option where changes are not needed. Large insert or update operations may need to be divided into batches when they exceed MongoDB request-payload limits.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Mongodb MCP Server

mongodb-mcp-server is an MCP server that connects AI agents to MongoDB databases, self-managed deployments, and MongoDB Atlas. Its main tools query and modify documents, run aggregations, inspect schemas and indexes, manage collections and databases, analyze queries, and administer Atlas clusters, users, and access lists.

Run `npx -y mongodb-mcp-server@latest setup` to start the interactive setup process. It guides you through configuring a MongoDB connection string or Atlas API credentials. The server requires Node.js 22.13 or later and can also be added through supported client plugin marketplaces.

Yes, mongodb-mcp-server works with Cursor. The project provides a Cursor installation option and an official MongoDB plugin. A local configuration can launch the package with `npx`, use the `MDB_MCP_CONNECTION_STRING` environment variable, and enable the read-only option.

Use Atlas service-account API credentials with the setup flow or connect through the official MongoDB Atlas plugin. The server also provides `atlas-connect-cluster`, which returns a connection ID for the other MongoDB tools. Atlas administration requires service-account credentials with appropriate permissions.

Yes, mongodb-mcp-server includes tools for inserting, updating, and deleting documents, as well as creating or dropping collections, indexes, and databases. Use least-privilege credentials and the read-only launch option when changes should be prevented.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewMongodb MCP Server AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/mongodb-mcp-server?style=directory)](https://allmcps.com/mcp/mongodb-mcp-server)
HTML Embed
<a href="https://allmcps.com/mcp/mongodb-mcp-server"><img src="https://allmcps.com/api/badge/mongodb-mcp-server?style=directory" alt="Mongodb MCP Server on AllMCPs" /></a>