MongoDB MCP Server
A Model Context Protocol server that lets AI clients query and manage MongoDB databases and MongoDB Atlas resources.
Tested on LinuxKnown vulnerabilities
Use it
Before you install: known vulnerabilities
pickfit found 1 known high or critical vulnerability in the packages a fresh install brings (OSV.dev, 16 Nov 2026). Weigh this before you install it.
npm:basic-ftp 5.3.1basic-ftp: Quadratic-time CPU denial of service in Client.list() Unix directory-listing parser (RE_LINE backtracking) (GHSA-c475-qrg2-pj4r, high, fixed in 6.2.1)
Linux x86_64
You need first
- Runtimes:
node>=22.13.0 - Keys or accounts: MongoDB connection string or Atlas service account API credentials
npm install -g mongodb-mcp-server@latest
npm install -g mongodb-mcp-server@latest
Check that it works
mongodb-mcp-server --versionThe output should contain “3.3.0”.
Add it to your agent
claude mcp add mongodb-mcp-server -- mongodb-mcp-server --readOnlyJSON for Claude Desktop, Cursor and other clients
{
"mcpServers": {
"mongodb-mcp-server": {
"command": "mongodb-mcp-server",
"args": [
"--readOnly"
]
}
}
}Add mongodb-mcp-server as an MCP server in your AI client, with the MDB_MCP_CONNECTION_STRING environment variable set to your MongoDB connection string.
What it does
- Query and change data in MongoDB collectionsTested
How to use it
- Set MDB_MCP_CONNECTION_STRING to your database, for example
mongodb://<host>:<port>. - Start the server from your MCP client with
mongodb-mcp-server --readOnly. - Ask your AI client to use the
findtool with a database, a collection and a filter.
- Set MDB_MCP_CONNECTION_STRING to your database, for example
- Manage MongoDB Atlas clusters and usersNot tested
- Search the MongoDB documentationNot tested
How far pickfit got
Linux x86_64
- Installs
- Connects
- 1 of 3 features work
- Works offline
Good for
- run find queries and aggregations on MongoDB collections from an AI agent
- create and manage MongoDB Atlas clusters
- get Atlas performance advisor index suggestions
How pickfit tested it
Each run starts from a clean machine and follows the steps above. How pickfit verifies
Linux x86_64
An MCP client called one of its tools
- Replayed from scratch
- Works offline
- Checked on 15 Nov 2026
- Version 3.3.0
An MCP client handshake over stdio listed 18 tools, and a call to list-connections returned a result.
Differences the test machine hit
- README: npx -y mongodb-mcp-server@latest setup
In the test: setup is an interactive wizard that needs a terminal. For a non-interactive install, I used npm install -g mongodb-mcp-server@latest and launched the server as `mongodb-mcp-server --readOnly` - README: A MongoDB connection string
In the test: I needed a local MongoDB server to test the database tools. I downloaded the mongod 8.0.4 tarball from fastdl.mongodb.org, ran it on 127.0.0.1:27017 and set MDB_MCP_CONNECTION_STRING; the connection then shows up with connectionId "preconfigured" - README: `find` - Run a find query against a MongoDB collection
In the test: With --readOnly, only read tools are listed (18 tools). Write tools need the flag removed