MongoDB MCP Server

Stabledatabase
580 starsTypeScriptmongodb
GitHubnpm
About

Overview

The MongoDB MCP Server enables AI agents to work with MongoDB databases. It supports CRUD operations on documents, collection management, aggregation pipelines, index management, and schema analysis. Designed for both development and production use with connection string configuration.
Capabilities

Tools & Capabilities

find

Query documents in a MongoDB collection with filters and projections

insertOne

Insert a single document into a collection

updateOne

Update a document matching a filter

deleteOne

Delete a document matching a filter

aggregate

Run an aggregation pipeline on a collection

listCollections

List all collections in the database

createIndex

Create an index on a collection

Setup

Installation

bash
Install
npx -y mongodb-mcp-server
Examples

Example Usage

javascript
Usage
{
  "mcpServers": {
    "mongodb": {
      "command": "npx",
      "args": ["-y", "mongodb-mcp-server"],
      "env": {
        "MONGODB_URI": "mongodb://localhost:27017/mydb"
      }
    }
  }
}

Quick Info

Authormongodb
LanguageTypeScript
StatusStable
Stars 580
Last UpdatedFeb 12, 2026

Need a Custom MCP Server?

Our team builds custom MCP servers tailored to your workflow.

Get in Touch

Need a Custom MCP Server?

Our team builds custom MCP servers tailored to your workflow. From proprietary data sources to internal tools, we have you covered.

Contact Us
CortexAgent Customer Service

Want to skip the form?

Our team is available to help you get started with CortexAgent.

This chat may be recorded for quality assurance. You can view our Privacy Policy.