MCP.so
Sign In

MongoDB MCP Server

@MCP-Mirror

About MongoDB MCP Server

Mirror of

Basic information

Category

Databases

Transports

stdio

Publisher

MCP-Mirror

Config

Add this server to your MCP-compatible client using the configuration below.

{
  "mcpServers": {
    "mongodb": {
      "command": "npx",
      "args": [
        "-y",
        "@pash1986/mcp-server-mongodb"
      ],
      "env": {
        "MONGODB_URI": ""
      }
    }
  }
}

Tools

2

Execute MongoDB aggregation pipelines against the connected database

Get execution plans for aggregation pipelines

Overview

What is MongoDB MCP Server?

A Model Context Protocol server that provides read-only access to MongoDB databases. It enables LLMs to inspect collection schemas and execute aggregation pipelines.

How to use MongoDB MCP Server?

Add the server configuration to the mcpServers section of your claude_desktop_config.json, using npx -y @pash1986/mcp-server-mongodb and setting the MONGODB_URI environment variable to your connection string.

Key features of MongoDB MCP Server

  • Execute MongoDB aggregation pipelines against connected databases
  • Get execution plans for aggregation pipelines
  • Automatic limit of 1000 documents if no limit stage is specified
  • Default timeout of 30 seconds for all operations
  • Provides inferred JSON schema information for each collection
  • Read‑only operations only for safety

Use cases of MongoDB MCP Server

  • LLMs querying MongoDB collections using aggregation pipelines
  • Inspecting collection schemas to understand database structure
  • Analyzing query performance with execution plan explanations

FAQ from MongoDB MCP Server

What tools does the server provide?

The server provides two tools: aggregate (execute aggregation pipelines) and explain (get execution plans).

What is the default document limit?

A limit of 1000 documents is applied automatically if no limit stage is specified in the pipeline.

What are the runtime requirements?

The server requires Node.js and is run via npx. It connects to any MongoDB instance via a connection string.

How is schema information obtained?

Schemas are derived by sampling collection documents and inferring field names and data types.

Is the connection read‑only?

Yes, all operations are read‑only. No write or update operations are supported.

Comments

More Databases MCP servers