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.
Servidores relacionados
TON BLOCKCHAIN MCP
Interact with the TON blockchain using natural language.
MCP Yahoo Finance
Access real-time stock prices, company information, and financial data from Yahoo Finance.
CData MCP Server for Microsoft SQL Server
An MCP server for Microsoft SQL Server by CData. Requires a separately licensed CData JDBC Driver.
Charity MCP Server
Access charity and nonprofit organization data from the IRS database via CharityAPI.org.
Strapi MCP
An MCP server for Strapi CMS, providing access to content types and entries through the MCP protocol.
AITable
Provides read and write access to AITable.ai, a collaborative database and spreadsheet platform.
ローカルNeo4jコンテナ
Manages personal knowledge using a local Neo4j container, with data imported from JSON files.
Aptos Blockchain MCP
Interact with the Aptos blockchain, supporting both testnet and mainnet for AI applications.
OpenSearch MCP Server
An MCP server for interacting with OpenSearch clusters, configured via environment variables.
PostgreSQL
Provides read-only access to PostgreSQL databases, allowing LLMs to inspect schemas and execute queries.
