MongoDB MCP Server

Community
Databases
stdio

Enables AI agents to interact with MongoDB databases: list collections, query documents, aggregate pipelines, and inspect schemas. Supports both local MongoDB instances and Atlas cloud deployments.

Quick Install

$ npx -y mongodb-mcp-server@3.0.5

Environment Variables

VariableDescriptionRequired
MONGODB_URIMongoDB connection stringYes

In-Depth Setup Guide

Complete setup walkthrough & security best practices

Read Guide

Configuration by Client

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

Need a different client? Use the Config Generator for Windsurf, Cline, Antigravity, and more.

Available Tools (6)

findaggregateinsertOneupdateOnedeleteOnelistCollections

MongoDB FAQ

What is the MongoDB MCP server?

Enables AI agents to interact with MongoDB databases: list collections, query documents, aggregate pipelines, and inspect schemas. Supports both local MongoDB instances and Atlas cloud deployments.

How do I install the MongoDB MCP server?

Run: npx -y mongodb-mcp-server@3.0.5

Which AI clients support the MongoDB MCP server?

The MongoDB MCP server works with Claude Desktop, Cursor, Codex CLI, Antigravity, Windsurf, and any MCP-compatible client using stdio transport.

What tools does the MongoDB MCP server provide?

The server provides 6 tools: find, aggregate, insertOne, updateOne, deleteOne, listCollections.