MongoDB MCP Server
@mongodb-developer
About MongoDB MCP Server
No overview available yet
Basic information
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"mongodb": {
"command": "npx",
"args": [
"-y",
"@pash1986/mcp-server-mongodb"
],
"env": {
"MONGODB_URI": ""
}
}
}
}Tools
2Execute MongoDB aggregation pipelines against the connected database
Get execution plans for aggregation pipelines
Overview
What is MongoDB MCP Server?
A community-maintained Model Context Protocol (MCP) server that provides read-only access to MongoDB databases. It enables LLMs to inspect collection schemas and execute aggregation pipelines safely.
How to use MongoDB MCP Server?
Install via npm and configure the server in your claude_desktop_config.json using the npx command. Set the MONGODB_URI environment variable to your MongoDB connection string, then invoke the aggregate or explain tools as needed.
Key features of MongoDB MCP Server
- Execute aggregation pipelines with configurable options.
- Retrieve execution plans using different verbosity levels.
- Automatic limit of 1000 documents if no limit is specified.
- Default 30-second timeout on all operations.
- Read-only access β no write operations are permitted.
- Schema inference from sampled collection documents.
Use cases of MongoDB MCP Server
- Query and summarize large collections with aggregation pipelines.
- Inspect database schemas to understand field types and structures.
- Analyze query performance by viewing execution plans.
- Ask natural-language questions about MongoDB data through an LLM.
- Explore database contents without risking accidental modifications.
FAQ from MongoDB MCP Server
Is this server read-only?
Yes. All operations are strictly read-only. No write or delete actions are allowed.
What safety limits are in place?
A default limit of 1000 documents is applied to any aggregation pipeline that does not include its own limit stage, and all operations time out after 30 seconds.
How do I connect to my MongoDB instance?
Set the MONGODB_URI environment variable to your connection string (e.g., mongodb://localhost:27017 or mongodb+srv://<cluster>) before starting the server.
What tools does it provide?
Two tools: aggregate (run aggregation pipelines) and explain (get execution plans with optional verbosity levels).
Is this an official MongoDB MCP Server?
No. This is a community-maintained server. The official server is maintained by MongoDB at mongodb-js/mongodb-mcp-server.
More Databases MCP servers
Database Gateway
centralmindUniversal MCP-Server for your Databases optimized for LLMs and AI-Agents.
Snowflake MCP Server
isaacwassermanMCP Alchemy
runekaagaardA MCP (model context protocol) server that gives the LLM access to and knowledge about relational databases like SQLite, Postgresql, MySQL & MariaDB, Oracle, and MS-SQL.
MongoDB Lens
fureyππ MongoDB Lens: Full Featured MCP Server for MongoDB Databases
Comments