Mongo MCP Server

MCP service for MongoDB operations

Local serverstdioPython

What is the Mongo MCP server?

Mongo MCP server is a locally run integration for AI assistants that speak the Model Context Protocol. MCP service for MongoDB operations.

What you get

A Machine Chat Protocol (MCP) service for MongoDB operations. This service provides a comprehensive set of tools that allow Large Language Models (LLMs) to interact with MongoDB databases through complete CRUD operations, administrative tasks, and advanced features.

Setting it up

The server ships on PyPI as run, so your MCP client can launch it on demand — there is no separate build step. Add the server block to your client's configuration, restart it, and the tools register themselves.

What the assistant can call

Once Mongo is connected, these are the calls the assistant has available:

  • list_databases — List all databases
  • create_database — Create new database
  • drop_database — Delete database
  • get_database_stats — Get database statistics
  • list_collections — List all collections in a database
  • create_collection — Create new collection (with optional settings)
  • drop_collection — Delete collection
  • rename_collection — Rename collection
  • get_collection_stats — Get collection statistics
  • list_indexes — List all indexes for a collection
  • create_index — Create regular index
  • create_text_index — Create text search index

Configuration and credentials

You will need 3 environment variables: MONGODB_URI, MONGODB_DEFAULT_DB, LOG_LEVEL. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

  • Python 3.10 or above - A running MongoDB database service - It is recommended to use uv to run the program

Before you rely on it

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • With 14 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch Mongo.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the mongo mcp server does with a few real requests.

Choosing this one

Plenty of database access servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. Mongo's toolset — list_databases, create_database, drop_database and 11 more — is a fair guide to whether it matches your workflow.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Available tools

ToolWhat it does
list_databasesList all databases
create_databaseCreate new database
drop_databaseDelete database
get_database_statsGet database statistics
list_collectionsList all collections in a database
create_collectionCreate new collection (with optional settings)
drop_collectionDelete collection
rename_collectionRename collection
get_collection_statsGet collection statistics
list_indexesList all indexes for a collection
create_indexCreate regular index
create_text_indexCreate text search index
create_compound_indexCreate compound index
drop_indexDelete index

How to install the Mongo MCP server

{
  "mcpServers": {
    "mongo-mcp-441126098": {
      "command": "uvx",
      "args": ["run"],
      "env": {
        "MONGODB_URI": "your-value",
        "MONGODB_DEFAULT_DB": "your-value",
        "LOG_LEVEL": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

  • Python 3.10 or above - A running MongoDB database service - It is recommended to use uv to run the program
VariableDescriptionRequired
MONGODB_URIConfiguration value read at startup.Optional
MONGODB_DEFAULT_DBConfiguration value read at startup.Optional
LOG_LEVELConfiguration value read at startup.Optional

Example prompts to try

  • Use Mongo to list databases.
  • Use Mongo to create database.
  • Use Mongo to drop database.

Frequently asked questions

It connects Mongo to MCP-compatible AI assistants such as Claude and Cursor, exposing 14 tools (list_databases, create_database, drop_database, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Mongo directly.