Skip to content
AI Dev Toolkit.
Esc
  • AI Token CounterCount tokens for GPT, Claude, Gemini, DeepSeek, Qwen and more.Tool
  • LLM API Cost CalculatorEstimate per-request, daily and monthly API costs.Tool
  • AI Model ComparisonCompare prices, context windows and features across models.Tool
  • AI Model Pricing PagesSpecs, real costs and cheaper alternatives for popular models.Tool
  • Context Window CheckerSee whether your text fits each model’s context window.Tool
  • Subscription vs API CalculatorFind out whether a chat plan or the API is cheaper for you.Tool
  • GPU / VRAM CalculatorCheck how much VRAM a local model needs and which GPUs fit.Tool
  • Prompt Caching CalculatorEstimate savings from prompt caching.Tool

MCP server · Databases

MongoDB MCP server

Lets an assistant query and manage MongoDB databases and, with Atlas credentials, manage Atlas projects, clusters and users.

Maintainer
MongoDB (official)
Licence
Apache-2.0
Runs
Locally (npx)
Sign-in
A token or API key
Registry version
2.1.0 (updated 2026-08-10)
Last activity
2026-10-13

Overview

What it does

MongoDB’s MCP server runs locally through npx and connects to any MongoDB deployment from a connection string, whether that is a local instance, a self-managed cluster or Atlas. With an Atlas service account it also exposes tools for the Atlas platform itself. Every configuration example in the README adds the --readOnly flag, which stops create, update and delete tools from being registered.

Pick it when an assistant needs to explore collections, infer a schema, run find or aggregation queries, or check indexes and query plans. Atlas users can list and create clusters, manage database users and IP access lists, read Performance Advisor suggestions and work with Atlas Stream Processing. For Atlas, MongoDB also offers a hosted server through its “mongodb-atlas” plugins, which sign in with OAuth. The local CLI has no built-in authentication and is meant for single-user use on your own machine.

Tools

What the assistant can do

  • find, aggregate, count and explain queries
  • Collection schema, index and storage statistics
  • Insert, update, delete and drop tools (blocked by --readOnly)
  • Export of query results in EJSON
  • Atlas projects, clusters, database users and access lists
  • Atlas Performance Advisor, alerts and Stream Processing
  • Atlas Local deployments and MongoDB knowledge-base search

Install

Install MongoDB MCP server in your app

You need:

  • Node.js 22.13 or newer (20.19 still works but is deprecated)
  • A MongoDB connection string, or Atlas service account credentials for the Atlas tools

Run in your project. --scope local keeps the servers private to you in this project; use user for every project.

Terminal
claude mcp add --env MDB_MCP_CONNECTION_STRING="${MDB_MCP_CONNECTION_STRING}" --scope local mongodb -- npx -y mongodb-mcp-server@latest --readOnly
Native Windows (PowerShell)
claude mcp add --env MDB_MCP_CONNECTION_STRING="$env:MDB_MCP_CONNECTION_STRING" --scope local mongodb -- cmd /c npx -y 'mongodb-mcp-server@latest' --readOnly
  • Set MDB_MCP_CONNECTION_STRING first, e.g. export MDB_MCP_CONNECTION_STRING=… in your shell. The command saves the value, not the variable.

Want it alongside other servers? Open MongoDB MCP Server in the MCP config generator and add the rest; it writes one file per app. The snippets follow the setup in the server’s README, checked on 2026-10-14.

Before you install

  • Without --readOnly (or MDB_MCP_READ_ONLY=true) the assistant can drop collections and databases and delete documents.
  • Pass connection strings and Atlas credentials as environment variables, not command-line arguments, which can show up in process lists.
  • The CLI has no authentication; never bind it to a non-loopback host or share it between users.
  • A local MCP server runs with your user account’s permissions. Install it only from the source linked above. See how to choose a safe server.

Why it’s listed

Why we list it

Official, frequently released and covers both raw MongoDB data and the Atlas platform.

Related

All MCP serversMCP config generatorGuide: MCP servers in Claude CodeGuide: what is MCP?