MongoDB MCP: Documentation
Updated:
Connection
Local: npx -y mongodb-mcp-server@latest --readOnly (stdio by default, Streamable HTTP also available). Docker: docker run mongodb/mongodb-mcp-server. Auth is a MongoDB connection string (--connectionString) or an Atlas Service Account (client ID/secret) for managing Atlas infrastructure. Drop --readOnly to allow writes.
Tools
About 24 tools in two groups: data operations — find, aggregate, insert-many, update-many, delete-many, create-index, explain, db-stats; Atlas management — atlas-create-cluster, atlas-create-db-user and more, for clusters, users and access lists.
Agent flow
"Find users with no login in 90+ days and group them by country", "show the execution plan for this aggregation pipeline", "spin up a staging Atlas cluster and create a user for it".
Pricing
The MCP server is free and open source (Apache-2.0). Self-hosted MongoDB is free; Atlas is billed per MongoDB's plans (a free M0 cluster is available).