MongoDB MCP Server

Databasestdiohttp-streamingv1.11.0
Repository

Official MCP server for interacting with MongoDB databases and MongoDB Atlas. Enables AI agents to query collections, run aggregations, manage indexes, inspect schemas, and perform CRUD operations. Also supports Atlas cloud management including cluster provisioning, database user management, performance advisor, and stream processing. Supports read-only mode for safe exploration.

Connect

Add this configuration to .claude/mcp.json

Transport:
{
  "mcpServers": {
    "mongodb": {
      "command": "npx",
      "args": [
        "-y",
        "mongodb-mcp-server",
        "--readOnly"
      ],
      "env": {
        "MDB_MCP_CONNECTION_STRING": "<YOUR_MDB_MCP_CONNECTION_STRING>",
        "MDB_MCP_API_CLIENT_ID": "<YOUR_MDB_MCP_API_CLIENT_ID>",
        "MDB_MCP_API_CLIENT_SECRET": "<YOUR_MDB_MCP_API_CLIENT_SECRET>"
      }
    }
  }
}

Tools (6)

find

Run a find query against a MongoDB collection with optional filter, projection, sort, and limit.

{
  "type": "object",
  "required": [
    "database",
    "collection"
  ],
  "properties": {
    "sort": {
      "type": "object",
      "description": "Sort specification"
    },
    "limit": {
      "type": "integer",
      "description": "Maximum number of documents to return"
    },
    "filter": {
      "type": "object",
      "description": "MongoDB query filter document"
    },
    "database": {
      "type": "string",
      "description": "Database name"
    },
    "collection": {
      "type": "string",
      "description": "Collection name"
    },
    "projection": {
      "type": "object",
      "description": "Fields to include or exclude"
    }
  }
}

aggregate

Run an aggregation pipeline against a MongoDB collection.

{
  "type": "object",
  "required": [
    "database",
    "collection",
    "pipeline"
  ],
  "properties": {
    "database": {
      "type": "string",
      "description": "Database name"
    },
    "pipeline": {
      "type": "array",
      "description": "Array of aggregation pipeline stages"
    },
    "collection": {
      "type": "string",
      "description": "Collection name"
    }
  }
}

list-databases

List all databases on the connected MongoDB instance.

{
  "type": "object",
  "properties": {}
}

list-collections

List all collections in a given database.

{
  "type": "object",
  "required": [
    "database"
  ],
  "properties": {
    "database": {
      "type": "string",
      "description": "Database name"
    }
  }
}

collection-schema

Infer and describe the schema for a MongoDB collection by sampling documents.

{
  "type": "object",
  "required": [
    "database",
    "collection"
  ],
  "properties": {
    "database": {
      "type": "string",
      "description": "Database name"
    },
    "collection": {
      "type": "string",
      "description": "Collection name"
    }
  }
}

insert-many

Insert an array of documents into a MongoDB collection.

{
  "type": "object",
  "required": [
    "database",
    "collection",
    "documents"
  ],
  "properties": {
    "database": {
      "type": "string",
      "description": "Database name"
    },
    "documents": {
      "type": "array",
      "description": "Array of documents to insert"
    },
    "collection": {
      "type": "string",
      "description": "Collection name"
    }
  }
}

Resources

This server does not expose any resources.

Prompts

This server does not expose any prompts.

Server Information

Author
MongoDB (@mongodb-js)
Repository
https://github.com/mongodb-js/mongodb-mcp-server
License
Apache-2.0
Version
1.11.0
Stars
1,000
Last Updated
May 22, 2026