{"type":"mcp_server","name":"mongo-mcp","description":"This repository provides a Model Context Protocol (MCP) server, enabling Large Language Models to interact with MongoDB databases using natural language for querying, schema inspection, and data management.","category":"Database","language":"TypeScript","stars":174,"forks":16,"owner":"QuantGeekDev","github_url":"https://github.com/QuantGeekDev/mongo-mcp","homepage":null,"setup":"## Setup\n\n1.  Find your mongodb connection url and add the configuration to your Claude Desktop config file.\n2.  **MacOS**: `~/Library/Application\\ Support/Claude/claude_desktop_config.json`\n3.  **Windows**: `%APPDATA%/Claude/claude_desktop_config.json`\n\n```json\n{\n  \"mcpServers\": {\n    \"mongodb\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"mongo-mcp\",\n        \"mongodb://<username>:<password>@<host>:<port>/<database>?authSource=admin\"\n      ]\n    }\n  }\n}\n```\n\n### Installing via Smithery\n\nTo install MongoDB MCP Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/mongo-mcp):\n\n```bash\nnpx -y @smithery/cli install mongo-mcp --client claude\n```\n\n### Prerequisites\n\n- Node.js 18+\n- npx\n- Docker and Docker Compose (for local sandbox testing only)\n- MCP Client (Claude Desktop App for example)\n\n### Test Sandbox Setup\n\nIf you don't have a mongo db server to connect to and want to create a sample sandbox, follow these steps\n\n1. Start MongoDB using Docker Compose:\n\n```bash\ndocker-compose up -d\n```\n\n2. Seed the database with test data:\n\n```bash\nnpm run seed\n```\n\n### Configure Claude Desktop\n\nAdd this configuration to your Claude Desktop config file:\n\n**MacOS**: `~/Library/Application\\ Support/Claude/claude_desktop_config.json`\n**Windows**: `%APPDATA%/Claude/claude_desktop_config.json`\n\n#### Local Development Mode:\n\n```json\n{\n  \"mcpServers\": {\n    \"mongodb\": {\n      \"command\": \"node\",\n      \"args\": [\n        \"dist/index.js\",\n        \"mongodb://root:example@localhost:27017/test?authSource=admin\"\n      ]\n    }\n  }\n}\n```","tools":"## Available Tools\n\n1.  Collection schema inspection (Allows inspection of collection schemas).\n2.  Document querying and filtering (Enables querying and filtering of documents).\n3.  Index management (Provides tools for managing indexes).\n4.  Document operations (insert, update, delete) (Supports document operations like insert, update, and delete).\n5.  `find` (Query documents with filtering and projection)\n6.  `listCollections` (List available collections)\n7.  `insertOne` (Insert a single document)\n8.  `updateOne` (Update a single document)\n9.  `deleteOne` (Delete a single document)\n10. `createIndex` (Create a new index)\n11. `dropIndex` (Remove an index)\n12. `indexes` (List indexes for a collection)","faq":null,"created_at":"2024-12-05T23:12:54+00:00","updated_at":"2025-03-28T23:46:23+00:00","source_url":"https://model-context-protocol.com/servers/mongo-db-model-context-protocol-server","related_articles":[]}