mcp-mongo-server

MCP.Pizza Chef: kiliczsh

Give it a connection string and your assistant can find out which collections exist, work out what shape the records take, run searches and summaries across them, and, when you allow it, add or correct records. A read-only switch blocks every path that could change data, so exploring carries no risk. Reaching other databases and running code inside the database are both switched off unless you deliberately enable them. Works with Claude Desktop, Cursor, and Windsurf, needs a recent version of Node, and is actively maintained.

Data

Use This MCP server To

Ask what is in my database without writing a query Count how many records match a condition this month Explore a live database safely in read-only mode Summarize trends across a big collection of records Add or correct a record when I have allowed writing Check which collections exist and what they contain

README

MCP MongoDB Server


NPM Version NPM Downloads NPM License

A Model Context Protocol (MCP) server that lets AI assistants work with your MongoDB databases. It exposes your collections, infers their schemas, and runs queries, aggregations, and writes through a standard interface — so tools like Claude Desktop and Cursor can read and reason about your data.

Demo

MCP MongoDB Server Demo | Claude Desktop

Why use it

  • Talk to your database in plain language — the assistant discovers your collections and their shape automatically.
  • Safe by default — turn on read-only mode to let an assistant explore without any risk of changing data.
  • Works everywhere — connects to standalone, replica set, sharded, and Atlas deployments, over plain or TLS connections.

Key Features

  • Read-Only Mode — blocks every write path (insert, update, index creation, and aggregation stages like $out/$merge that could modify data).
  • Smart ObjectId Handling — configurable auto/none/force conversion of 24-character hex strings to ObjectIds.
  • Schema Inference — automatic collection schema detection from document samples.
  • Query & Aggregation — full query and aggregation pipeline support, with optional explain plans.
  • Write Operations — insert, update, and index creation (when read-only mode is off).
  • Time Conversion — a convertTime helper turns Unix timestamps and date strings into UTC/GMT/ISO, so date queries stay unambiguous across timezones.
  • Progress & Cancellation — long operations report progress and can be cancelled mid-flight.
  • Two Transports — run locally over stdio, or expose an HTTP endpoint for remote access.

mcp-mongo-server FAQ

Is it actively maintained?
Yes. The project was updated within the last few weeks.
Can I stop it changing my data?
Yes. A read-only switch blocks additions, edits, and any summary step that could write, so the assistant can only look.
Do I need to pay for a key?
No key to buy. You do need the connection details for the database, and using a read-only login is the safest option.
Which apps does it work in?
Claude Desktop, Cursor, and Windsurf are documented, and it can also be run over the network for remote access.
Can I use this to answer a question about my company's records?
Yes. It discovers the collections itself and figures out what the records look like, so you can just ask in plain language.
How hard is setup?
One command with your connection details, then a short block in your app's settings. A recent version of Node is required.
Does it work with MongoDB Atlas?
Yes. Single servers, replica sets, sharded clusters, and Atlas are all supported, over plain or secured connections.