A Model Context Protocol (MCP) server enabling large language models (LLMs) to communicate directly with MongoDB. It allows natural language to be used for database queries, schema exploration, and data operations.
- 🔍 Explore collection structures
- 📊 Query and filter documents
- 📈 Manage indexes
- 📝 Perform insert, update, and delete operations on documents
Screen.Recording.2025-04-20.at.11.47.30.AM.mov
To begin, locate your MongoDB connection string and update your Claude Desktop configuration file:
MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"mongodb": {
"command": "npx",
"args": [
"mongo-mcp",
"mongodb+srv://<username>:<password>@<cluster-address>/<database>"
]
}
}
}
- Node.js 18+
- npx
- MCP Client (Ex. Claude Desktop App)
Add this configuration to your Claude Desktop config file:
MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
The server provides these tools for database interaction:
listCollections
: List available collectionsgetCollectionSchema
: Collection schemafindDocument
: Query documents with filtering and projectioninsertDocument
: Inserts a document into a collectionupdateDocument
: Update a single document
createIndex
: Create a new indexdeleteIndex
: Remove an indexlistIndexes
: List indexes for a collection