furey/mongodb-lens logo

furey/mongodb-lens

Free

功能齐全的 MongoDB 数据库 MCP 服务器。

FreeFree tier
Type
Open Source

About furey/mongodb-lens

MongoDB Lens is a local Model Context Protocol (MCP) server that provides full-featured access to MongoDB databases using natural language via large language models. It enables users to perform queries, run aggregation pipelines, optimize performance, infer schemas, manage indexes, and more—all through conversational commands. The tool supports a wide range of operations including document CRUD, schema analysis, geospatial queries, text search, bulk operations, and database administration, with built-in safety confirmations for destructive actions. It integrates with MCP-compatible clients like Claude Desktop and Cursor, and requires local installation and configuration.

Key Features

Natural language querying of MongoDB databases via LLMs
Execute aggregation pipelines and analyze query performance
Automatic schema inference and comparison across collections
Support for geospatial, full-text, and collation queries
Database administration: create/drop databases, collections, indexes, and users
Data export in JSON and CSV formats
GridFS support for managing large files
Bulk operations with safety confirmations for destructive actions
Shard status and sharding configuration viewing
Generate JSON Schema validators from collections

Pros & Cons

Pros
  • Enables non-technical users to interact with MongoDB via plain English
  • Comprehensive set of tools covering almost all MongoDB operations
  • Open-source and free to use with no licensing restrictions
  • Safety confirmations for destructive actions reduce accidental data loss
  • Works with popular MCP clients like Claude Desktop and Cursor
  • Supports multiple MongoDB connection aliases for easy switching
  • Includes a tutorial and test suite for learning and validation
Cons
  • Requires local setup and configuration of the MCP server
  • Dependent on an LLM-based MCP client for natural language interpretation
  • Some operations (e.g., aggregation) may need complex prompts for accurate results
  • Performance may vary based on the underlying LLM's capabilities
  • Limited to MongoDB databases; does not support other database types

Best For

Ad-hoc database exploration and querying using natural languagePerformance optimization through query pattern analysis and indexing suggestionsSchema discovery and validation for MongoDB collectionsData migration and bulk document managementGeospatial and full-text search on MongoDB dataDatabase administration tasks like user management and collection creation

FAQ

What is MongoDB Lens?
MongoDB Lens is a local Model Context Protocol (MCP) server that allows you to interact with MongoDB databases using natural language via large language models. It provides queries, aggregations, performance optimization, and administrative operations.
How do I install MongoDB Lens?
You can install MongoDB Lens by cloning the repository from GitHub and following the configuration instructions in the README. It requires Node.js and an MCP-compatible client.
Which MCP clients are supported?
MongoDB Lens works with any MCP-compatible client, such as Claude Desktop and Cursor.
Is MongoDB Lens free?
Yes, MongoDB Lens is open-source and free to use. The source code is available on GitHub.
Does MongoDB Lens support destructive operations?
Yes, but destructive operations such as delete, drop, and bulk writes require explicit confirmation to prevent accidental data loss.