MCP/MongoDB & Atlas MCP Server
MongoDB & Atlas MCP Server logo

MongoDB & Atlas MCP Server

Verified Golden (1000+ GitHub stars)

Official Model Context Protocol server to connect AI agents to MongoDB databases, Atlas clusters, and Stream Processing.

rag-data•Databases & Storage
GitHub1.2k
License:Apache-2.0
VERIFIED

About this Server

The official MongoDB Model Context Protocol (MCP) server connects AI coding agents directly to self-hosted MongoDB instances and cloud-hosted MongoDB Atlas clusters. It gives assistants deep capabilities to query documents, build aggregation pipelines, inspect collection schemas and storage sizes, create indexes, analyze query explain plans, and manage Atlas clusters, projects, users, and stream processing pipelines.

Real-time Interaction

Direct low-latency RPC protocol communication with structured JSON schemas.

Scoped Sandboxing

Restricted capability bounds to prevent accidental modifications or leakage.

Security & Best Practices

Least Privilege Credentials: Connect using dedicated MongoDB users restricted to required target databases and read-only roles where suitable.
Connection String Secrecy: Safeguard mongodb+srv connection URIs and Atlas API keys using client environment variables.
Network Whitelisting: Restrict Atlas cluster IP access lists (CIDR) to authorized developer workstations or secure NAT gateways.

When to Use (and When Not To)

Best For
  • •Natural language document queries, aggregation pipeline generation, and schema discovery in MongoDB
  • •Diagnosing slow database queries with query optimizer explain plans and Atlas Performance Advisor
  • •Automating Atlas cloud cluster management, stream processing deployment, and database user creation
Not For / Limitations
  • •High-dimensional vector embedding similarity searches (use Chroma MCP instead)
  • •Pure relational multi-engine SQL joins across MySQL/SQLite/Oracle (use DBHub MCP instead)
  • •Elasticsearch Query DSL and cluster shard inspection (use Elasticsearch MCP instead)

Install & Setup

terminal command
$claude mcp add mongodb -- npx -y mongodb-mcp-server@latest

Exposed Tools & Endpoints

14 tools

Functions your AI agent can invoke via this Model Context Protocol server

find

Runs a find query with filters, projections, and sort options against a MongoDB collection.

aggregate

Executes multi-stage aggregation pipelines against a MongoDB collection.

collection-schema

Infers and describes the document schema, field types, and structure for a collection.

collection-indexes

Lists and describes all indexes configured on a MongoDB collection.

explain

Returns query execution statistics and the winning plan chosen by the query optimizer.

insert-many

Inserts an array of documents into a specified MongoDB collection.

update-many

Updates all documents matching a filter expression in a collection.

delete-many

Removes documents matching a filter expression from a collection.

list-collections

Lists all collections in a given MongoDB database.

list-databases

Lists all databases available on the connected MongoDB instance.

atlas-inspect-cluster

Inspects cluster state, tier, disk sizing, and connection strings for MongoDB Atlas clusters.

atlas-get-performance-advisor

Retrieves Atlas Performance Advisor index recommendations and slow query log analysis.

atlas-streams-discover

Inspects Atlas Stream Processing resources, processor health, stats, and networking.

search-knowledge

Searches official MongoDB Assistant documentation, expert guidance, and syntax manuals.