Mongo-MCP is an MCP server that provides Large Language Models with tools to interact directly with MongoDB databases over standard input/output. Designed for developers and data engineers using MCP-compatible AI assistants, it enables automated database administration, document CRUD operations, index management, and data aggregation. The server exposes dedicated tools for creating, listing, and dropping collections and databases, as well as fetching database statistics. It handles document-level tasks including single and batch insertions, queries with sorting and projection, updates, replacements, and deletions. For query optimization and schema performance, Mongo-MCP supports managing standard, compound, and text indexes. It also executes aggregation pipelines and retrieves distinct field values. Built on Python with FastMCP and PyMongo, Mongo-MCP supports configurable connection pooling, timeout settings, read preferences, and feature flags that restrict dangerous or administrative operations when connecting LLMs to production or local instances.
Category: Databases & Data Stores
Tags: database, mongodb, nosql, query
.cursor/mcp.json), add mongo-mcp under mcpServers using uvx. 3. Configure the command arguments and environment variables: json { "mcpServers": { "mongo-mcp": { "command": "uvx", "args": ["mongo-mcp"], "env": { "MONGODB_URI": "mongodb://localhost:27017", "MONGODB_DEFAULT_DB": "your_database_name", "LOG_LEVEL": "INFO" } } } } 4. Restart the client to initialize the server connection over stdio.Part of MCP Servers
Mongo-MCP allows AI models to manage MongoDB instances. It provides tools for executing CRUD operations, running aggregation pipelines, listing and dropping collections or databases, managing indexes, and retrieving server health metrics.
Mongo-MCP communicates via standard input/output (stdio), making it compatible with any MCP client that supports stdio transport, such as Cursor and Claude Desktop.
You can run Mongo-MCP directly using uvx by invoking uvx run mongo-mcp, or configure your client config file with the uvx command and your target MONGODB_URI environment variable.
Yes, Mongo-MCP is open source software distributed under the MIT license on GitHub.