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.
เซิร์ฟเวอร์ที่เกี่ยวข้อง
MySQL MCP Server
A read-only MySQL database server for LLMs to inspect schemas and execute queries.
Weaviate MCP Client
An MCP client for connecting to and interacting with a Weaviate vector database.
MySQL MCP Server
Provides tools for AI assistants to interact with a MySQL database.
FRED Economic Data
Access economic data from the Federal Reserve Bank of St. Louis (FRED).
Node MSSQL
A server for interacting with Microsoft SQL Server databases using the node-mssql library.
AWS Athena
Run SQL queries on data in Amazon S3 using AWS Athena.
MotherDuck
Query and analyze data with MotherDuck and local DuckDB
Redis
A server for interacting with Redis databases.
MCP Toolbox for Databases
Open source MCP server specializing in easy, fast, and secure tools for Databases.
a2db
Multi-database agent access (PostgreSQL, SQLite, MySQL, Oracle, SQL Server) with batch queries, pre-configured connections, and SQLGlot-enforced read-only safety
