MongoDB
A Model Context Protocol Server for MongoDB
MCP MongoDB Server
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
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
| Variable | Description |
|---|---|
MCP_MONGODB_URI | MongoDB connection URI |
MCP_MONGODB_READONLY | Enable read-only mode ("true") |
Documentation
- Integration Guide - Claude Desktop, Windsurf, Cursor, Docker
- Available Tools - Query, aggregate, update, insert, and more
- Development - Setup, scripts, and debugging
- Contributing
License
MIT - see LICENSE for details.
Related Servers
Secret Network
Provides secure access to Secret Network blockchain functionality, designed for deployment in Trusted Execution Environments (TEEs).
Pinterest by CData
A read-only MCP server for querying live Pinterest data, powered by the CData JDBC Driver.
Claude Conversation Memory System
Provides searchable local storage for Claude conversation history, enabling context retrieval during sessions.
MySQL MCP Server
Provides AI agents with direct access to query, search, and analyze MySQL databases.
Subgraph MCP Server
Allows LLMs to interact with Subgraphs available on The Graph Network.
Redash
Execute queries and retrieve results using the Redash API.
XiYan MCP Server
A server that enables natural language queries to databases using XiyanSQL.
SSI Stock Data MCP
Query Vietnam stock intraday data using the SSI FastConnect API.
Cloudera Iceberg MCP Server (via Impala)
Provides read-only access to Apache Iceberg tables using Apache Impala.
CRM MCP Server
A production-ready MCP server for Customer Relationship Management (CRM) functionality, built with TypeScript and SQLite.
