DatabaseOfficial

MongoDB MCP server

Query collections, manage indexes, run aggregation pipelines, and inspect schemas in MongoDB databases.

Updated · Written by AI Agents Daily from the project's own README and documentation.

Docs & setup

Starter recipes

Real tasks you can ask an agent once this server is connected.

Answer a data question

Ask a plain question such as "how many sign-ups did we get per week this quarter?" and let the assistant build and run the aggregation pipeline.

Try

Find slow queries

Ask it to run explain on a slow query and list the indexes on that collection, then suggest which index would help.

Try

Learn an unfamiliar database

Point it at a database you inherited and ask for a summary of each collection: what fields it holds, how many documents, and how large it is.

Try
Install
npx -y mongodb-mcp-server@latest --readOnly

Runs on your computer. Your AI client starts it with npx when it needs it.

From the project README · checked 2 Oct 2026

Downloads
3.7M

npm · all time since Apr 2025 · as of 2 Oct 2026

Checked 2 Oct 2026

License
Apache-2.0

Official server

Access

It gets whatever the connection string's database user or the Atlas service account allows. Keep --readOnly unless you truly need writes, since write tools include delete-many and drop-database. Those risky tools ask for confirmation by default, but only in clients that support it; otherwise they run straight away. Give the service account the minimum roles.

Related MCP servers