A Model Context Protocol server for interacting with MongoDB databases and MongoDB Atlas. It runs locally via npx and connects with a connection string or Atlas API service-account credentials. The README recommends starting in read-only mode.
Was es kann
Wo MongoDB MCP Server läuft und was es ergänzt, laut Dokumentation
Run find, aggregate, count and explain against collections
Inspect databases, collections, schemas, indexes and storage size
Insert, update and delete documents when not in read-only mode
Create and drop collections and indexes
Export query results in EJSON format
Manage Atlas resources when Atlas API credentials are provided
Wann Sie es einsetzen sollten
Gut geeignet
You want an agent to explore or query a MongoDB or Atlas deployment
You need read-only database access for an AI assistant
You want Atlas administration tools in the same server
Nicht geeignet für
You cannot run Node.js 22.13+ (Docker is documented as an alternative)
You want write access without confirmation prompts on destructive tools (several tools require confirmation by default)
So installieren Sie MongoDB MCP Server
Sie benötigen: Node.js v22.13.0 or later; A MongoDB connection string or Atlas API service-account credentials (required for Atlas tools)
Install Node.js v22.13.0 or later
Run interactive setup: npx -y mongodb-mcp-server@latest setup
Or add the server to your MCP client config with npx -y mongodb-mcp-server@latest --readOnly
Pass MDB_MCP_CONNECTION_STRING or Atlas API credentials (MDB_MCP_API_CLIENT_ID / MDB_MCP_API_CLIENT_SECRET) via env
Remove --readOnly only if you need write operations
Konfigurationsbeispiel (aus der offiziellen Dokumentation)
Reads and, unless --readOnly is set, writes data in the connected MongoDB deployment
Atlas tools act with the permissions of the supplied service account
Sicherheitshinweise der Maintainer
README recommends minimum permissions for the Atlas service account
README strongly recommends environment variables instead of command-line arguments for connection strings and API credentials
Telemetry is enabled by default (MDB_MCP_TELEMETRY / --telemetry)
Destructive tools such as drop-database, drop-collection and delete-many require confirmation by default
Prüfen Sie den Quellcode, bevor Sie einem Agenten Zugriff auf Zugangsdaten oder Produktivsysteme geben. Wir dokumentieren die Angaben der Maintainer; Code prüfen wir nicht.
Einschränkungen
Atlas tools need Atlas API service-account credentials
Quelloffener Terminal-KI-Agent von Google, der Gemini auf die Kommandozeile bringt; laut Website wurden Nutzer ohne Bezahltarif und Google-One-Nutzer zur Antigravity CLI umgezogen.
Das agentische Coding-Tool von Anthropic, das Ihre Codebasis liest, Dateien bearbeitet und Befehle ausführt, im Terminal, in IDEs, in der Desktop-App oder im Browser.
Kostenlos bis: Kein kostenloser Tarif: Claude Code ist in den bezahlten Claude-Abonnements (Pro, Max, Team, Enterprise) enth…
Does the MongoDB MCP Server support read-only mode?
Yes. Start it with the --readOnly flag (or MDB_MCP_READ_ONLY); the README's examples all include it by default. Quelle
What Node.js version does the MongoDB MCP Server need?
Node.js v22.13.0 or later; Node 20.x support is deprecated. A Docker option avoids a local Node install. Quelle
How does the MongoDB MCP Server connect to my database?
Through a connection string (MDB_MCP_CONNECTION_STRING) or Atlas API service-account credentials; the README prefers environment variables over CLI arguments. Quelle
Can the MongoDB MCP Server manage Atlas?
Yes, with Atlas API service-account credentials it exposes Atlas tools; the README advises minimum permissions. Quelle