Official · by mongodb-js

MongoDB MCP server

The MongoDB MCP server lets an AI assistant run queries, aggregations, and document counts against MongoDB collections.

  • Runs locally
  • Apache-2.0 licence
  • ★ 1,144 on GitHub
  • Verified against its source 19 Oct 2026

What the MongoDB MCP server does

The server connects MongoDB to agentic AI tools and assistants, letting them run aggregations and find queries on a collection, count documents in a collection, and list the databases for a connection. It also includes a tool to list MongoDB Atlas clusters and a tool to search the MongoDB Assistant knowledge base. It can be run locally by launching the mongodb-mcp-server package with npx, and a separate hosted Atlas-Managed MCP server is offered as an authenticated deployment.

Tools it gives your assistant

6 tools or toolsets, as its documentation lists them.

  • aggregate Runs an aggregation against a collection
  • find Runs a find query against a collection
  • count Counts documents in a collection, with optional filter
  • list-databases Lists databases for a connection
  • atlas-list-clusters Lists MongoDB Atlas clusters
  • search-knowledge Searches the MongoDB Assistant knowledge base

How to install it

Run it locally

With Node.js (npx)

npx -y mongodb-mcp-server

What you need

In the mongodb-js documentation's own words:

  • “At least v22.13.0. Check with node -v”
  • “NOTE: atlas tools are only available when you set credentials on configuration (#configuration) section”

Commands and settings change between versions. Check the official instructions before you install.