AgentTask Atlas

MCP server · MongoDB

MongoDB MCP Server

Pick it for MongoDB or Atlas queries; enable the documented read-only mode for exploration.

Tools: 27, ~14,069 tokens of tool definitions loaded into the model's context (default config, dummy connection string; measured 2026-10-27, v3.1.0). Compare all servers →

All 27 tools, by token cost
  1. export2,860
  2. explain2,846
  3. aggregate2,386
  4. create-index2,085
  5. find411
  6. search-knowledge273
  7. aggregate-db249
  8. update-many245
  9. insert-many204
  10. drop-index200
  11. connect194
  12. collection-schema190
  13. count184
  14. mongodb-logs178
  15. rename-collection173
  16. delete-many172
  17. drop-collection140
  18. create-collection138
  19. collection-indexes125
  20. collection-storage-size125
  21. db-stats116
  22. drop-database116
  23. list-collections112
  24. list-databases101
  25. disconnect98
  26. list-knowledge-sources76
  27. list-connections72

Same server, other documented flags (measured 2026-10-27):

  • --readOnly (read-only): 18 tools, ~10,596 tokens (25% less than the default)

Install

`npx -y mongodb-mcp-server` with env vars from README (supports --readOnly). Official install docs ↗

Credentials: MongoDB connection string, or Atlas API client ID/secret.

What it can access

Runs queries/admin ops on a MongoDB database or Atlas; read-only mode documented.

Minimal safe setup

  • Run with --readOnly (only read, connect and metadata tools are registered) and disable whole categories with --disabledTools, e.g. atlas. Pass the connection string via MDB_MCP_CONNECTION_STRING, not a CLI argument, which shows up in process lists. source ↗
  • For Atlas, prefer project-level roles: Project Read Only to view clusters/databases; avoid Organization Owner. Destructive tools (drop-database, delete-many, ...) ask for confirmation by default if your client supports elicitation. source ↗

Common setup errors

Server fails on older Node.
Requires Node.js 22.13.0 or later; Node 20 support is deprecated. source ↗
Atlas tools are missing.
Atlas tools need Service Account credentials (MDB_MCP_API_CLIENT_ID / MDB_MCP_API_CLIENT_SECRET) and your IP on the API access list; a connection string alone only enables database tools. source ↗
A static API key is rejected by the remote Atlas MCP server.
The remote server needs OAuth; with static Service Account credentials use the mongodb-atlas-mcp-remote stdio package. source ↗

How it differs from alternatives

  • MongoDB Atlas-managed remote MCP server: Hosted by MongoDB with OAuth (recommended via the mongodb-atlas plugin), so nothing to run locally; the local package also works with self-managed MongoDB via a connection string. source ↗

Notes written from the official sources linked above, checked 2026-10-27.

Details

Type
MCP server
Tasks
Databases & SQL
Compatible agents
Cursor, VS Code, Codex, GitHub Copilot (source: clients with a setup heading or install/config instructions in the official README)
Maintenance
Release v3.1.0 on 2026-10-15; last commit 2026-10-23
License
Apache-2.0
Source
https://github.com/mongodb-js/mongodb-mcp-server
Verified on
2026-10-26

No independent security audit: entries summarize official sources only. Review permissions and code before installing.

Compared in: Best MCP servers for Databases & SQL in Cursor · Best MCP servers for Databases & SQL in VS Code · Best MCP servers for Databases & SQL

Badge for your README (maintainers)

The badge only says it's listed; it is not a security review or an endorsement.

Listed on AgentTask Atlas

← All MCP servers and skills