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.
Máy chủ liên quan
SqlAugur
MCP server providing AI assistants with safe, read-only access to SQL Server databases. Built with C#/.NET 10, it uses AST-based query validation (Microsoft's T-SQL parser) to ensure only SELECT statements execute - blocking INSERT/UPDATE/DELETE/DROP/EXEC at the syntax tree level. Features include schema exploration, PlantUML/Mermaid ER diagram generation, rate limiting, and integrated DBA diagnostic toolsets (First Responder Kit, DarlingData, sp_WhoIsActive).
NEPSE Stock Data MCP Server
Access comprehensive stock market data from the Nepal Stock Exchange (NEPSE) via the ShareBazaar API.
PubChem MCP Server
Provides comprehensive access to PubChem's chemical information database via the PubChem PUG REST API.
Supabase
Interact with Supabase databases, storage, and edge functions.
PostgreSQL MCP
Transforms PostgreSQL databases from "I have tables and I don't know what they do" into "I understand the entire database structure, relationships, and best practices"
CData Reckon
A read-only MCP server for Reckon, enabling LLMs to query live data using the CData JDBC Driver.
Microsoft SQL Server
A server for secure interaction with Microsoft SQL Server databases using environment variables for configuration.
ORMCP
ORMCP provides a curated, object-oriented, MCP-compliant view of relational data in any JDBC-compliant database (e.g., PostgreSQL, MySQL, Oracle, SQL Server, DB2, SQLite) — improving reasoning clarity, reducing token usage, and establishing a clear governance boundary.
AWS PostgreSQL MCP Server
A read-only MCP server for querying AWS PostgreSQL databases.
ADO.NET MCP Server
A C# MCP server for interacting with databases via ADO.NET, compatible with Virtuoso.
