MongoDB MCP Server

<h2 align="center"> 📢 <strong>COMMUNITY SERVER NOTICE</strong><br/> This is a community-maintained MCP Server.<br/> 👉 For the

Local serverstdio

What is the MongoDB MCP server?

MongoDB MCP server is a locally run integration for AI assistants that speak the Model Context Protocol. 📢 COMMUNITY SERVER NOTICE This is a community-maintained MCP Server. 👉 For the official MongoDB MCP Server, visit <a.

What the assistant can call

Once MongoDB is connected, these are the calls the assistant has available:

  • aggregate — Execute MongoDB aggregation pipelines against the connected database
  • Input — - collection (string): The collection to query
  • explain — Get execution plans for aggregation pipelines
  • Options — "queryPlanner", "executionStats", "allPlansExecution"
  • Default — "queryPlanner"
  • Tools — The Tools tool exposed by this server
  • Resources — The server provides schema information for each collection in the database:

Configuration and credentials

You will need one environment variable: MONGODB_URI. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

Setting it up

Setup follows the usual MCP pattern — install or clone the server, register it in your client's configuration file, restart the client.

Choosing this one

This sits in the database access group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. MongoDB's toolset — aggregate, Input, explain and 4 more — is a fair guide to whether it matches your workflow. It is maintained by mongodb-developer; worth a glance at recent repository activity before you build anything load-bearing on it.

This entry was verified against MongoDB's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.

Before you rely on it

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the mongodb mcp server does with a few real requests.

Available tools

ToolWhat it does
aggregateExecute MongoDB aggregation pipelines against the connected database
Input- collection (string): The collection to query
explainGet execution plans for aggregation pipelines
Options"queryPlanner", "executionStats", "allPlansExecution"
Default"queryPlanner"
ToolsThe Tools tool exposed by this server.
ResourcesThe server provides schema information for each collection in the database:

Configuration

VariableDescriptionRequired
MONGODB_URIConfiguration value read at startup.Optional

Example prompts to try

  • Use MongoDB to aggregate.
  • Use MongoDB to Input.
  • Use MongoDB to explain.

Frequently asked questions

Yes. All operations are strictly read-only. No write or delete actions are allowed.