MongoDB Official

v0.1.0Databasesbeta

Official MongoDB integration with Atlas and database operations

mongodbdatabasenosqlatlasofficial
Share:
380
Stars
0
Downloads
0
Weekly
0/5

What is MongoDB Official?

MongoDB Official is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to official mongodb mcp server provides comprehensive database operations including crud, aggregation, and schema inspection. supports both mongodb atlas cloud deployments and self-hosted mongodb instanc...

The official MongoDB MCP server provides comprehensive database operations including CRUD, aggregation, and schema inspection. Supports both MongoDB Atlas cloud deployments and self-hosted MongoDB instances.

This server falls under the Databases category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • 28 comprehensive database tools
  • CRUD operations support
  • Schema inspection and validation
  • Aggregation pipeline builder
  • Atlas cluster management
  • Index management

Use Cases

MongoDB Atlas integration
NoSQL database operations
Enterprise deployment
MongoDB, Inc.

Maintainer

LicenseApache-2.0
Languagetypescript
Versionv0.1.0
UpdatedJun 16, 2025
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

NPM

npm install mongodb-mcp-server

Manual Installation

npx mongodb-mcp-server

Configuration

Configuration Details

Config File

claude_desktop_config.json

Security

Authentication

RequiredYes

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use MongoDB Official

The official MongoDB MCP Server, maintained by the MongoDB team, connects AI assistants to your MongoDB databases and MongoDB Atlas clusters with a comprehensive set of 45+ tools. It supports full CRUD operations, index management, schema inspection, aggregation pipelines, and Atlas-specific features such as cluster creation, performance advisor recommendations, and stream processing — enabling you to query, manage, and analyze MongoDB data entirely through natural language.

Prerequisites

  • Node.js v22.13.0 or later
  • A MongoDB connection string (for local/self-hosted MongoDB) OR MongoDB Atlas API Service Account credentials (for Atlas management features)
  • An MCP-compatible client such as Claude Desktop, Claude Code, VS Code, or Cursor
1

Choose your connection method

For local or self-hosted MongoDB, you need a connection string. For Atlas management operations (cluster creation, performance advisor), you need Atlas API credentials: a Service Account client ID and client secret.

2

Set credentials as environment variables

Export your connection string or Atlas credentials. Avoid passing secrets as CLI arguments, which may be visible in process listings.

# For local/self-hosted MongoDB
export MDB_MCP_CONNECTION_STRING="mongodb://localhost:27017/myDatabase"

# For MongoDB Atlas (Service Account)
export MDB_MCP_API_CLIENT_ID="your-service-account-client-id"
export MDB_MCP_API_CLIENT_SECRET="your-service-account-client-secret"

# Optional: restrict to read-only operations
export MDB_MCP_READ_ONLY="true"
3

Add the server to your MCP client configuration

Add mongodb-mcp-server to your claude_desktop_config.json. Use --readOnly for production environments to prevent accidental writes.

4

Restart your MCP client and connect

Restart Claude Desktop. The server will use the connect tool automatically if a connection string is provided, or prompt you to connect on first use.

5

Verify the connection by listing databases

Ask your AI assistant to list available databases. This confirms the connection is working and shows what data is accessible.

MongoDB Official Examples

Client configuration

claude_desktop_config.json entry for MongoDB MCP Server with a local connection string and read-only mode.

{
  "mcpServers": {
    "MongoDB": {
      "command": "npx",
      "args": ["-y", "mongodb-mcp-server@latest", "--readOnly"],
      "env": {
        "MDB_MCP_CONNECTION_STRING": "mongodb://localhost:27017/myDatabase"
      }
    }
  }
}

Prompts to try

Sample prompts covering the range of MongoDB MCP Server capabilities.

- "List all databases and collections in my MongoDB instance"
- "Find all users in the users collection where status is active and age is over 30"
- "Show me the schema of the orders collection"
- "Aggregate sales by region and calculate the total and average revenue for last month"
- "Create an index on the email field of the users collection"
- "Get performance advisor recommendations for my Atlas cluster"
- "Create a new M10 cluster in AWS us-east-1 named staging"

Troubleshooting MongoDB Official

Connection refused or authentication failed when connecting to MongoDB

Verify MDB_MCP_CONNECTION_STRING includes the correct host, port, and credentials. For Atlas clusters, use the full connection string from the Atlas UI (Connect > Drivers). Ensure your IP is on the Atlas network access list.

Atlas tools return errors about missing credentials

Atlas management tools (cluster creation, performance advisor) require MDB_MCP_API_CLIENT_ID and MDB_MCP_API_CLIENT_SECRET from an Atlas Service Account, not the database connection string. Create a Service Account in your Atlas project under Access Manager.

Destructive operations (drop, delete) are blocked or require confirmation

This is by design — the server requires explicit confirmation before executing destructive operations. If you want to prevent them entirely, run with --readOnly or set MDB_MCP_READ_ONLY=true.

Frequently Asked Questions about MongoDB Official

What is MongoDB Official?

MongoDB Official is a Model Context Protocol (MCP) server that official mongodb integration with atlas and database operations It connects AI assistants to external tools and data sources through a standardized interface.

How do I install MongoDB Official?

Install via npm with the command: npm install mongodb-mcp-server. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).

Which AI clients work with MongoDB Official?

MongoDB Official works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is MongoDB Official free to use?

Yes, MongoDB Official is open source and available under the Apache-2.0 license. You can use it freely in both personal and commercial projects.

Browse More Databases MCP Servers

Explore all databases servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "mongodb-official": { "command": "npx", "args": ["-y", "mongodb-mcp-server"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use MongoDB Official?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides