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.
Похожие серверы
CData WooCommerce
A read-only MCP server for querying live WooCommerce data using the CData JDBC Driver.
ClickHouse
Query your ClickHouse database server.
Elasticsearch Security Solution
An Elasticsearch server focused on security and threat analysis. Requires a valid Elasticsearch license (trial, platinum, or enterprise) for connection.
Mongo-MCP
An MCP server for interacting with a MongoDB database.
CData Reckon
A read-only MCP server for Reckon, enabling LLMs to query live data using the CData JDBC Driver.
Redis MCP Server
An MCP server for interacting with Redis databases, enabling LLMs to access key-value stores.
UK Crime MCP
An MCP server for accessing UK police crime data, deployable on Cloudflare Workers.
Weaviate MCP Client
An MCP client for connecting to and interacting with a Weaviate vector database.
Data Mesh Manager MCP
Discover data products and request access in Data Mesh Manager.
OrionBelt Analytics
Analyzes relational database schemas (PostgreSQL, Snowflake, and Dremio) and automatically generates comprehensive ontologies in RDF/Turtle format with direct SQL mappings.
