A Model Context Protocol (MCP) server that enables LLMs to interact directly with MongoDB databases. Query collections, inspect schemas, and manage data seamlessly through natural language. - ๐ Collection schema inspection - ๐ Document querying and filtering - ๐ Index management - ๐ Document operations (insert, update, delete) To get started, find your mongodb connection url and add this confi
Add this skill
npx mdskills install QuantGeekDev/mongo-mcpWell-documented MongoDB MCP server with useful database tools and clear setup instructions
1# ๐๏ธ MongoDB MCP Server for LLMS23[](https://nodejs.org/en/)4[](https://opensource.org/licenses/MIT)5[](https://smithery.ai/server/mongo-mcp)67A Model Context Protocol (MCP) server that enables LLMs to interact directly with MongoDB databases. Query collections, inspect schemas, and manage data seamlessly through natural language.89## โจ Features1011- ๐ Collection schema inspection12- ๐ Document querying and filtering13- ๐ Index management14- ๐ Document operations (insert, update, delete)1516## Demo Video171819https://github.com/user-attachments/assets/2389bf23-a10d-49f9-bca9-2b39a1ebe6542021222324## ๐ Quick Start2526To get started, find your mongodb connection url and add this configuration to your Claude Desktop config file:2728**MacOS**: `~/Library/Application\ Support/Claude/claude_desktop_config.json`29**Windows**: `%APPDATA%/Claude/claude_desktop_config.json`3031```json32{33 "mcpServers": {34 "mongodb": {35 "command": "npx",36 "args": [37 "mongo-mcp",38 "mongodb://<username>:<password>@<host>:<port>/<database>?authSource=admin"39 ]40 }41 }42}43```4445### Installing via Smithery4647To install MongoDB MCP Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/mongo-mcp):4849```bash50npx -y @smithery/cli install mongo-mcp --client claude51```5253### Prerequisites5455- Node.js 18+56- npx57- Docker and Docker Compose (for local sandbox testing only)58- MCP Client (Claude Desktop App for example)5960### Test Sandbox Setup6162If you don't have a mongo db server to connect to and want to create a sample sandbox, follow these steps63641. Start MongoDB using Docker Compose:6566```bash67docker-compose up -d68```69702. Seed the database with test data:7172```bash73npm run seed74```7576### Configure Claude Desktop7778Add this configuration to your Claude Desktop config file:7980**MacOS**: `~/Library/Application\ Support/Claude/claude_desktop_config.json`81**Windows**: `%APPDATA%/Claude/claude_desktop_config.json`8283#### Local Development Mode:8485```json86{87 "mcpServers": {88 "mongodb": {89 "command": "node",90 "args": [91 "dist/index.js",92 "mongodb://root:example@localhost:27017/test?authSource=admin"93 ]94 }95 }96}97```9899### Test Sandbox Data Structure100101The seed script creates three collections with sample data:102103#### Users104105- Personal info (name, email, age)106- Nested address with coordinates107- Arrays of interests108- Membership dates109110#### Products111112- Product details (name, SKU, category)113- Nested specifications114- Price and inventory info115- Tags and ratings116117#### Orders118119- Order details with items120- User references121- Shipping and payment info122- Status tracking123124## ๐ฏ Example Prompts125126Try these prompts with Claude to explore the functionality:127128### Basic Operations129130```plaintext131"What collections are available in the database?"132"Show me the schema for the users collection"133"Find all users in San Francisco"134```135136### Advanced Queries137138```plaintext139"Find all electronics products that are in stock and cost less than $1000"140"Show me all orders from the user john@example.com"141"List the products with ratings above 4.5"142```143144### Index Management145146```plaintext147"What indexes exist on the users collection?"148"Create an index on the products collection for the 'category' field"149"List all indexes across all collections"150```151152### Document Operations153154```plaintext155"Insert a new product with name 'Gaming Laptop' in the products collection"156"Update the status of order with ID X to 'shipped'"157"Find and delete all products that are out of stock"158```159160## ๐ Available Tools161162The server provides these tools for database interaction:163164### Query Tools165166- `find`: Query documents with filtering and projection167- `listCollections`: List available collections168- `insertOne`: Insert a single document169- `updateOne`: Update a single document170- `deleteOne`: Delete a single document171172### Index Tools173174- `createIndex`: Create a new index175- `dropIndex`: Remove an index176- `indexes`: List indexes for a collection177178## ๐ License179180This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.181
Full transparency โ inspect the skill content before installing.