MongoDB MCP Server
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.
✨ Features
- 🔍 Explore collection structures
- 📊 Query and filter documents
- 📈 Manage indexes
- 📝 Perform insert, update, and delete operations on documents
Demo Video
https://github.com/user-attachments/assets/6a63d107-0e55-46de-9422-4cf0ecd2e65b
🚀 Getting Started
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>"
]
}
}
}
Prerequisites
- Node.js 18+
- npx
- MCP Client (Ex. Claude Desktop App)
Configure Claude Desktop
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
📝 Available Tools
The server provides these tools for database interaction:
Query Tools
listCollections: List available collectionsgetCollectionSchema: Collection schemafindDocument: Query documents with filtering and projectioninsertDocument: Inserts a document into a collectionupdateDocument: Update a single document
Index Tools
createIndex: Create a new indexdeleteIndex: Remove an indexlistIndexes: List indexes for a collection
Recommend MCP Servers 💡
cdata-jdbc-mcp-server
A read-only MCP Server that connects Claude Desktop to external data through CData JDBC Drivers
mcp-jdbc-server
Java-based MCP Server for JDBC, compatible with Virtuoso and other JDBC-compliant DBMS.
@gomomento/mcp-momento
A simple Model Context Protocol (MCP) server implementation for Momento Cache, providing tools to interact with Momento Cache for operations like get, set, list, create, and delete caches.
mcp_sqlite_poc
An MCP server implementation for SQLite databases, enabling AI models to interact with SQLite through standardized tools for query execution, schema discovery, and data management.
Pratye/MEC-Postgres
A Model Context Protocol server providing read and write access to PostgreSQL databases, enabling LLMs to inspect schemas and execute queries.
nocodb-mcp-server
nocodb mcp server