MongoDB MCP Server
Enables AI agents to interact with MongoDB databases: list collections, query documents, aggregate pipelines, and inspect schemas. Supports both local MongoDB instances and Atlas cloud deployments.
Quick Install
$ npx -y mongodb-mcp-server@3.0.5Environment Variables
| Variable | Description | Required |
|---|---|---|
| MONGODB_URI | MongoDB connection string | Yes |
In-Depth Setup Guide
Complete setup walkthrough & security best practices
Configuration by Client
{
"mcpServers": {
"mongodb": {
"command": "npx",
"args": [
"-y",
"mcp-server-mongodb"
],
"env": {
"MONGODB_URI": "mongodb:///mydb"
}
}
}
}Need a different client? Use the Config Generator for Windsurf, Cline, Antigravity, and more.
Available Tools (6)
MongoDB FAQ
What is the MongoDB MCP server?
Enables AI agents to interact with MongoDB databases: list collections, query documents, aggregate pipelines, and inspect schemas. Supports both local MongoDB instances and Atlas cloud deployments.
How do I install the MongoDB MCP server?
Run: npx -y mongodb-mcp-server@3.0.5
Which AI clients support the MongoDB MCP server?
The MongoDB MCP server works with Claude Desktop, Cursor, Codex CLI, Antigravity, Windsurf, and any MCP-compatible client using stdio transport.
What tools does the MongoDB MCP server provide?
The server provides 6 tools: find, aggregate, insertOne, updateOne, deleteOne, listCollections.