# MCP MongoDB Server

A Model Context Protocol server that lets an AI assistant discover a MongoDB database's collections, infer their schemas, and run queries, aggregations and writes through a standard interface.

MCP MongoDB Server exposes a MongoDB database to tools such as Claude Desktop and Cursor over MCP, so an assistant can explore collections and their inferred schema and reason about the data in plain language. A read-only mode blocks every write path, including inserts, updates, index creation and aggregation stages that could modify data, so an assistant can explore safely.

Other features include configurable conversion between 24-character hex strings and MongoDB ObjectIds, full query and aggregation pipeline support with optional explain plans, a helper that converts Unix timestamps and date strings to UTC, GMT or ISO format, and progress reporting with mid-flight cancellation for long operations. It connects to standalone, replica-set, sharded or Atlas deployments over plain or TLS connections, and runs locally over stdio or as a remote HTTP endpoint, accepting only local or non-browser requests by default.

Website: https://github.com/kiliczsh/mcp-mongo-server
