MCP-Server Offiziell

MongoDB MCP Server

Official MongoDB MCP server: query and manage MongoDB databases and Atlas from an AI agent, with a read-only mode.

Autor
MongoDB
Funktioniert mit
Any MCP client, Cursor, Gemini CLI, OpenAI Codex
Lizenz
Apache-2.0
Letzte Version
Oct 1, 2026
Dokumentiert
Oct 2, 2026

Was MongoDB MCP Server ist

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

Wie sich MongoDB MCP Server einbinden lässt: welche Agenten es ausführen und was es ergänztLÄUFT INIhr AgentAny MCP clientCursorOpenAI CodexGemini CLI4 Hosts dokumentiertMCP SERVER · OFFIZIELLMongoDB MCP ServerDen Agenten mit Tools, Daten und…5 Installationsschritte2 BerechtigungshinweiseLizenz: Apache-2.0WAS ES ERGÄNZTWas es kannRun find, aggregate, count and ex…Inspect databases, collections, s…Insert, update and delete documen…Create and drop collections and i…Agent → Erweiterung → neue Fähigkeit · aus dem offiziellen Repository oder der Dokumentation
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)

  1. Install Node.js v22.13.0 or later
  2. Run interactive setup: npx -y mongodb-mcp-server@latest setup
  3. Or add the server to your MCP client config with npx -y mongodb-mcp-server@latest --readOnly
  4. Pass MDB_MCP_CONNECTION_STRING or Atlas API credentials (MDB_MCP_API_CLIENT_ID / MDB_MCP_API_CLIENT_SECRET) via env
  5. Remove --readOnly only if you need write operations
Konfigurationsbeispiel (aus der offiziellen Dokumentation)
{
  "mcpServers": {
    "MongoDB": {
      "command": "npx",
      "args": ["-y", "mongodb-mcp-server@latest", "--readOnly"],
      "env": {
        "MDB_MCP_CONNECTION_STRING": "mongodb://localhost:27017/myDatabase"
      }
    }
  }
}

Berechtigungen und Sicherheit

Worauf es zugreifen kann

  • 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
  • Node 20.x support is deprecated

Tools, die es erweitert

OpenAI Codex

Web · Desktop · Mobile

Noch keine Nutzerbewertungen

OpenAI's coding agent for the CLI, IDE extension, desktop app, web and iOS, included in ChatGPT plans or billed by API.

Kostenlos bis: Desktop app only listed, Usage limits apply

Listed Noch nicht bewertet

Geprüft developers.openai.com (öffnet die Website von OpenAI Codex in einem neuen Tab)

Kostenlos · kostenpflichtig ab $8/mo US · geprüft Sep 29

Claude Code

Web · Desktop

Noch keine Nutzerbewertungen

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…

Listed Noch nicht bewertet

Geprüft code.claude.com (öffnet die Website von Claude Code in einem neuen Tab)

Ab $20/mo US · geprüft Sep 29

Häufig gestellte Fragen

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

Verwandte Ratgeber

Quellen und Lücken

Weitere Erweiterungen zum Ansehen