MCP server · Data + databases

OfficialNot tested yet (sources checked)Read-writeApache-2.0Updated November 2026

MongoDB MCP

Query and inspect MongoDB databases through MongoDB's official MCP server, run here in read-only mode with telemetry turned off.

Quick verdict

A well-guarded official database server and a good fit for local, self-managed MongoDB. Keep --readOnly and a read-only database user unless a task truly needs writes, and turn telemetry off.

  • MaintainerMongoDB (official)
  • Security scopeRead-write
  • Transportsstdio, streamable-http
  • Install channelnpm · mongodb-mcp-server
  • EvidenceNot tested yet (sources checked)
  • LicenseApache-2.0 · Open source

MongoDB's official MCP server gives an agent tools to explore schemas, run find and aggregation queries, read indexes and stats, and, when writes are allowed, insert, update, delete and drop data. With Atlas service-account credentials it also manages Atlas projects, clusters, database users and access lists. It runs locally over stdio against any MongoDB deployment, from a local Community Edition instance to Atlas. The configuration shown here passes only a connection string, starts the server with --readOnly so no create, update or delete tool is registered, and turns telemetry off.

MCP security best practices

Install MongoDB MCP

Runs locally with npx and needs Node.js 22.13 or later (per the README). --readOnly keeps every create, update and delete tool unregistered and rejects aggregation pipelines with a $out or $merge stage; --telemetry disabled stops usage events. Use a database user with only the read role, because the flag limits tools, not the user. MongoDB also publishes a Docker image (mongodb/mongodb-mcp-server) and runs a separate hosted Atlas Managed MCP Server at https://mcp.mongodb.com for Atlas-only use, which this profile does not cover. The HTTP transport has no authentication and must stay on loopback.

npx -y mongodb-mcp-server@latest

Config entry (mcpServers)
{
  "mcpServers": {
    "mongodb-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "mongodb-mcp-server@latest",
        "--readOnly",
        "--telemetry",
        "disabled"
      ],
      "env": {
        "MDB_MCP_CONNECTION_STRING": "<MONGODB_CONNECTION_STRING>"
      }
    }
  }
}

Credentials

NameRequiredWhat it is for
MDB_MCP_CONNECTION_STRINGRequiredConnection string for the deployment the agent may read, for example a local mongodb:// URI. It embeds the database user and password, so pass it as an environment variable and use a dedicated user with only the read role.
MDB_MCP_API_CLIENT_IDOptionalAtlas service-account client id. Only needed for the Atlas tools, which this configuration does not enable. Grant the narrowest project-level role.
MDB_MCP_API_CLIENT_SECRETOptionalAtlas service-account client secret, paired with the client id. Not used by this configuration.

Verified configurations

Not run by us yet. This profile is Not tested yet (sources checked): the install channel, config entry, credentials and license were checked against the source and upstream metadata, but no configuration has been installed, discovered and executed in a recorded environment. When one is, it appears here with the eight scope dimensions below.

Best for

Developers who want a coding agent to explore and query a local or development MongoDB database (schemas, documents, indexes, query plans) without giving it write access.

Why use it

It is vendor-maintained, Apache-2.0, listed in the official MCP Registry, and works fully local against a self-managed MongoDB. Its guards are documented: a read-only mode that unregisters write tools and blocks $out and $merge pipelines, per-tool and per-operation disabling, confirmation prompts on drops and deletes, collection-scan rejection and result caps.

Tradeoffs

Writes, deletes and drops (delete-many, drop-collection, drop-database) are enabled unless --readOnly is set, and confirmation prompts only appear in clients that support MCP elicitation; otherwise those tools run without asking. Telemetry is on by default and sends usage events (tool names, client and platform details, a device id, and Atlas identifiers when Atlas tools run) to MongoDB; this configuration turns it off. The Assistant tools send search text to MongoDB's knowledge service. The connect tool stays available in read-only mode, so an agent given another connection string can reach another deployment, still read-only. Adding Atlas credentials exposes billed actions such as creating or upgrading clusters. The README marks the MDB_MCP_CONNECTION_STRING variable deprecated in favour of a JSON MDB_MCP_CONNECTION_STRINGS value, while both setup guides still use it.

Upstream state

npm package published · repository active · in the official MCP Registry (active). Lifecycle is derived from a committed upstream snapshot at build time, never authored by hand.

Official MCP Registry name: io.github.mongodb-js/mongodb-mcp-server

Editorial details

EditorCJ ZwartLast updatedNovember 2026SourcesMongoDB MCP Server repository README: setup, tools, configuration, read-only mode, telemetry; MongoDB MCP Server LICENSE (Apache License 2.0); MongoDB docs: MCP Server overview (local and Atlas Managed); MongoDB docs: MCP Server tools; MongoDB docs: local MCP security best practices; MongoDB docs: Atlas Managed MCP security (aggregate write stages); Source: read-only rejection of $out and $merge pipelines; Official MCP Registry: io.github.mongodb-js/mongodb-mcp-server; npm: mongodb-mcp-server

Grade B: Not tested yet (sources checked). Re-review is due by 2027-05-10. Config entries, credential names and package status can change upstream; verify against the source repository before granting an agent access.

Sources

Related guides

All MCP servers →