A Model Context Protocol (MCP) server that enables LLMs to interact directly with MongoDB databases
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.
https://github.com/user-attachments/assets/2389bf23-a10d-49f9-bca9-2b39a1ebe654
To get started, find your mongodb connection url and 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
{
"mcpServers": {
"mongodb": {
"command": "npx",
"args": [
"mongo-mcp",
"mongodb://<username>:<password>@<host>:<port>/<database>?authSource=admin"
]
}
}
}
To install MongoDB MCP Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install mongo-mcp --client claude
If you don't have a mongo db server to connect to and want to create a sample sandbox, follow these steps
docker-compose up -d
npm run seed
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
{
"mcpServers": {
"mongodb": {
"command": "node",
"args": [
"dist/index.js",
"mongodb://root:example@localhost:27017/test?authSource=admin"
]
}
}
}
The seed script creates three collections with sample data:
Try these prompts with Claude to explore the functionality:
"What collections are available in the database?"
"Show me the schema for the users collection"
"Find all users in San Francisco"
"Find all electronics products that are in stock and cost less than $1000"
"Show me all orders from the user john@example.com"
"List the products with ratings above 4.5"
"What indexes exist on the users collection?"
"Create an index on the products collection for the 'category' field"
"List all indexes across all collections"
"Insert a new product with name 'Gaming Laptop' in the products collection"
"Update the status of order with ID X to 'shipped'"
"Find and delete all products that are out of stock"
The server provides these tools for database interaction:
find
: Query documents with filtering and projectionlistCollections
: List available collectionsinsertOne
: Insert a single documentupdateOne
: Update a single documentdeleteOne
: Delete a single documentcreateIndex
: Create a new indexdropIndex
: Remove an indexindexes
: List indexes for a collectionThis project is licensed under the MIT License - see the LICENSE file for details.
Access comprehensive B2B data on companies, employees, and job postings for your LLMs and AI workflows.
Interact with Verodat AI Ready Data platform
Provides AI assistants with a secure and structured way to explore and analyze data in GreptimeDB.
Immutable ledger database with live synchronization
Manage and query databases, tenants, users, auth using LLMs
Query your ClickHouse database server.
Interact with the SingleStore database platform
MCP server for dbt-core (OSS) users as the official dbt MCP only supports dbt Cloud. Supports project metadata, model and column-level lineage and dbt documentation.
A MCP server that provides real-time cryptocurrency market data through CoinCap's public API without requiring authentication
MCP server for libSQL databases with comprehensive security and management tools. Supports file, local HTTP, and remote Turso databases with connection pooling, transaction support, and 6 specialized database tools.