← Discover MCPs and Agents
m
MCPDatabaseGitHub

mcp-mongo-server

A Model Context Protocol Server for MongoDB

Links

README

From the repo.

MCP MongoDB Server


NPM Version NPM Downloads NPM License smithery badge Verified on MseeP

A Model Context Protocol server that enables LLMs to interact with MongoDB databases. This server provides capabilities for inspecting collection schemas and executing MongoDB operations through a standardized interface.

Demo

MCP MongoDB Server Demo | Claude Desktop

Key Features

  • Smart ObjectId Handling - Configurable auto/none/force modes for string-to-ObjectId conversion
  • Read-Only Mode - Protection against write operations, uses secondary read preference
  • Schema Inference - Automatic collection schema detection from document samples
  • Query & Aggregation - Full MongoDB query and aggregation pipeline support with optional explain plans
  • Write Operations - Insert, update, and index creation (when not in read-only mode)
  • Collection Completions - Auto-complete collection names for LLM integration

Installation

npx -y mcp-mongo-server mongodb://localhost:27017/database

Usage

# Start server with MongoDB URI
npx -y mcp-mongo-server mongodb://muhammed:kilic@localhost:27017/database

# Connect in read-only mode
npx -y mcp-mongo-server mongodb://muhammed:kilic@localhost:27017/database --read-only

Environment Variables

VariableDescription
MCP_MONGODB_URIMongoDB connection URI
MCP_MONGODB_READONLYEnable read-only mode ("true")

Documentation

License

MIT - see LICENSE for details.

Collected info

  • 279 stars
  • 55 forks
  • Language: TypeScript
  • Source updated: 6/13/2026

Config for your environment

Replace {MCP_ENDPOINT_URL} with this MCP’s endpoint URL (from its repo or docs above). No API key — you connect directly.

Tool

OS

Config file: ~/.cursor/mcp.json

{
  "mcpServers": {
    "mcp-server": {
      "url": "{MCP_ENDPOINT_URL}"
    }
  }
}

Paste into mcpServers in the config file. Restart Cursor after saving.

If this MCP is also published on mcpchannel.ai, you can subscribe from Browse and use the gateway config there instead.