kiliczsh/mcp-mongo-server logo

kiliczsh/mcp-mongo-server

Free

用于 MongoDB 的模型上下文协议服务器。

FreeFree tier
Type
Open Source

About kiliczsh/mcp-mongo-server

MCP MongoDB Server is a Model Context Protocol (MCP) server that enables LLMs to interact with MongoDB databases. It provides capabilities for inspecting collection schemas and executing MongoDB operations through a standardized interface. The server supports smart ObjectId handling, read-only mode, schema inference, full query and aggregation pipeline support, write operations, and collection completions for LLM integration. It can be installed via npx and configured with environment variables for MongoDB URI and read-only mode.

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

Pros & Cons

Pros
  • Open source and free to use
  • Easy installation via npx with minimal configuration
  • Read-only mode for safe querying in production
  • Automatic schema inference simplifies data understanding for LLMs
  • Supports both read and write operations with optional read-only protection
  • Compatible with multiple MCP hosts (Claude Desktop, Cursor, etc.)
Cons
  • Requires an MCP-compatible host environment
  • Limited to MongoDB databases; no support for other database systems
  • Write operations are disabled in read-only mode
  • Schema inference is sample-based and may not capture complete schema

Best For

Enabling AI assistants to query and analyze MongoDB dataDatabase schema exploration and documentation through natural languageBuilding autonomous agents that can read from and write to MongoDBIntegration with MCP-compatible AI development tools like Claude Desktop, Cursor, and Windsurf