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
Polygon MCP Server
Provides on-chain tools to interact with the Polygon PoS blockchain.
Epitome
Personal AI memory — gives every AI agent shared, persistent memory of you
Advanced Memory Bank MCP
An intelligent memory management server with 14 optimized tools. It provides AI-powered summaries, a clean interface, and supports an optional PostgreSQL database with pgvector.
TON BLOCKCHAIN MCP
Interact with the TON blockchain using natural language.
MCP Trino Server
Integrates with Trino and Iceberg for advanced data exploration, querying, and table maintenance.
Doris-MCP-Lite
A lightweight MCP server for connecting to Apache Doris and other MySQL-compatible databases, providing tools and prompts for LLM applications.
World Bank MCP Server
Interact with the open World Bank data API to list and analyze economic and development indicators for various countries.
Timeplus
Interact with the Timeplus real-time data platform for querying and managing data streams.
LSD MCP server
Access the internet and query data using LSD SQL.
MCP-MySQL-Ops
You are working with the MCP MySQL Operations Server, a powerful tool that provides comprehensive MySQL database monitoring and analysis capabilities through natural language queries. This server offers 19 specialized tools for database administration, performance monitoring, and system analysis.
