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.
相关服务器
MSSQL MCP Server
Connect to and interact with Microsoft SQL Server databases.
Kollektiv MCP
Build and access a personal LLM knowledge base from your editor or client without any infrastructure setup.
dbt
Official MCP server for dbt (data build tool) providing integration with dbt Core/Cloud CLI, project metadata discovery, model information, and semantic layer querying capabilities.
ParticlePhysics MCP Server
Provides seamless access to particle physics data from the Particle Data Group (PDG) for AI assistants and applications.
GeoServer MCP Server
Connects Large Language Models to the GeoServer REST API, enabling AI assistants to interact with geospatial data and services.
Redis
A server for interacting with Redis databases.
Alpha Vantage
Provides real-time financial market data using the Alpha Vantage API.
Hydrolix
Hydrolix time-series datalake integration providing schema exploration and query capabilities to LLM-based workflows.
SQL Analyzer
Analyze, lint, and convert SQL dialects using SQLGlot.
German Family Business Knowledge Graph
Query a Neo4j graph database containing a knowledge graph of German family businesses.
