The MCP MongoDB Server enables large language models to interact with MongoDB databases through a standardized protocol, providing tools for schema inspection, querying, aggregation, and write operations. It offers features including configurable ObjectId handling, read-only mode for safe operations, automatic schema inference from document samples, and full support for MongoDB queries and aggregation pipelines. This server solves the problem of giving LLMs safe, structured access to MongoDB data while maintaining control over read/write permissions and query execution.
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.
npx -y mcp-mongo-server mongodb://localhost:27017/database
# 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
| Variable | Description |
|---|---|
MCP_MONGODB_URI | MongoDB connection URI |
MCP_MONGODB_READONLY | Enable read-only mode ("true") |
MIT - see LICENSE for details.
hovecapital/read-only-local-postgres-mcp-server
cocaxcode/database-mcp
io.github.infoinlet-marketplace/mcp-mysql
io.github.cybeleri/database-admin
io.github.yash-0620/postgres-mcp-secured