About
Overview
The MongoDB MCP Server enables AI agents to work with MongoDB databases. It supports CRUD operations on documents, collection management, aggregation pipelines, index management, and schema analysis. Designed for both development and production use with connection string configuration.
Capabilities
Tools & Capabilities
⚡find
Query documents in a MongoDB collection with filters and projections
⚡insertOne
Insert a single document into a collection
⚡updateOne
Update a document matching a filter
⚡deleteOne
Delete a document matching a filter
⚡aggregate
Run an aggregation pipeline on a collection
⚡listCollections
List all collections in the database
⚡createIndex
Create an index on a collection
Setup
Installation
bash
Install
npx -y mongodb-mcp-serverExamples
Example Usage
javascript
Usage
{
"mcpServers": {
"mongodb": {
"command": "npx",
"args": ["-y", "mongodb-mcp-server"],
"env": {
"MONGODB_URI": "mongodb://localhost:27017/mydb"
}
}
}
}Quick Info
Authormongodb
LanguageTypeScript
StatusStable
Stars★ 580
Last UpdatedFeb 12, 2026