mongodb-js/mongodb-mcp-server

A Model Context Protocol server to connect to MongoDB databases and MongoDB Atlas Clusters.

What it solves

AI assistants often need to work with databases, but connecting them to MongoDB requires custom integrations. This project removes that friction by providing a standard bridge between AI tools and MongoDB. It lets an AI agent run queries, inspect schemas, update documents, and even manage MongoDB Atlas clusters using plain-language requests — without the developer hand-writing database code for each interaction.

How it works

The MongoDB MCP Server implements the Model Context Protocol (MCP), a common interface used by many AI coding assistants. The server runs locally (via npx or Docker) or connects to a remotely hosted Atlas-managed version. It exposes a set of tools that the AI agent can call, such as find, aggregate, insert-many, create-index, and Atlas operations like atlas-create-cluster or atlas-get-performance-advisor. You connect it either with a MongoDB connection string (for self-managed instances) or with MongoDB Atlas API credentials (for cloud management). For safety, the default configuration includes a --readOnly flag, which prevents any write operations unless you explicitly remove it. You can also install official plugins for specific AI clients like Cursor, VS Code, Claude, and Codex, which handle the configuration automatically.

Who it’s for

Developers and teams who use AI coding assistants (such as Cursor, Claude, VS Code, or GitHub Copilot) and want to let those assistants interact directly with their MongoDB databases or MongoDB Atlas projects. It’s especially useful for quick queries, schema exploration, performance troubleshooting, and routine database administration — all from within the AI chat interface.

Highlights

  • Full CRUD and query support: find, count, aggregate, insert, update, delete, and more.
  • Schema and index inspection: collection-schema, collection-indexes, and explain help AI agents understand data shape and query performance.
  • Atlas management tools: create clusters, projects, and database users, manage IP access lists, and pull performance advisor recommendations.
  • Multiple deployment options: run locally with npx or Docker, use the official AI-agent plugins, or connect to the remote Atlas-hosted server.
  • Read-only mode by default: prevents accidental writes unless you explicitly enable them.

Related

  • Project
  • Project
  • Project
  • Project
  • Project