MongoDB Lens
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
**MongoDB Lens** is a local Model Context Protocol (MCP) server with full featured access to MongoDB databases using natural language via LLMs to perform queries, run aggregations, optimize performance, and more.
Contents
- Quick Start
- Features
- Installation
- Configuration
- Client Setup
- Data Protection
- Tutorial
- Test Suite
- Disclaimer
- Support
Quick Start
- Install MongoDB Lens
- Configure MongoDB Lens
- Set up your MCP Client (e.g. Claude Desktop, Cursor, etc)
- Explore your MongoDB databases with natural language queries
Features
- Tools
- Resources
- Prompts
- Other
Tools
- add-connection-alias: Add a new MongoDB connection alias
- aggregate-data: Execute aggregation pipelines
- analyze-query-patterns: Analyze live queries and suggest optimizations
- analyze-schema: Automatically infer collection schemas
- bulk-operations: Perform multiple operations efficiently (requires confirmation for destructive operations)
- clear-cache: Clear memory caches to ensure fresh data
- collation-query: Find documents with language-specific collation rules
- compare-schemas: Compare schemas between two collections
- connect-mongodb: Connect to a different MongoDB URI
- connect-original: Connect back to the original MongoDB URI used at startup
- count-documents: Count documents matching specified criteria
- create-collection: Create new collections with custom options
- create-database: Create a new database with option to switch to it
- create-index: Create new indexes for performance optimization
- create-timeseries: Create time series collections for temporal data
- create-user: Create new database users with specific roles
- current-database: Show the current database context
- delete-document: Delete documents matching specified criteria (requires confirmation)
- distinct-values: Extract unique values for any field
- drop-collection: Remove collections from the database (requires confirmation)
- drop-database: Drop a database (requires confirmation)
- drop-index: Remove indexes from collections (requires confirmation)
- drop-user: Remove database users (requires confirmation)
- explain-query: Analyze query execution plans
- export-data: Export query results in JSON or CSV format
- find-documents: Run queries with filters, projections, and sorting
- generate-schema-validator: Generate JSON Schema validators
- geo-query: Perform geospatial queries with various operators
- get-stats: Retrieve database or collection statistics
- gridfs-operation: Manage large files with GridFS buckets
- insert-document: Insert one or more documents into collections
- list-collections: Explore collections in the current database
- list-connections: View all available MongoDB connection aliases
- list-databases: View all accessible databases
- rename-collection: Rename existing collections (requires confirmation when dropping targets)
- shard-status: View sharding configuration for databases and collections
- text-search: Perform full-text search across text-indexed fields
- transaction: Execute multiple operations in a single ACID transaction
- update-document: Update documents matching specified criteria
- use-database: Switch to a specific database context
- validate-collection: Check for data inconsistencies
- watch-changes: Monitor real-time changes to collections
Resources
- collection-indexes: Index information for a collection
- collection-schema: Schema information for a collection
- collection-stats: Performance statistics for a collection
- collection-validation: Validation rules for a collection
- collections: List of collections in the current database
- database-triggers: Database change streams and event triggers configuration
- database-users: Database users and roles in the current database
- databases: List of all accessible databases
- performance-metrics: Real-time performance metrics and profiling data
- replica-status: Replica set status and configuration
- server-status: Server status information
- stored-functions: Stored JavaScript functions in the current database
Prompts
- aggregation-builder: Step-by-step creation of aggregation pipelines
- backup-strategy: Customized backup and recovery recommendations
- data-modeling: Expert advice on MongoDB schema design for specific use cases
- database-health-check: Comprehensive database health assessment and recommendations
- index-recommendation: Get personalized index suggestions based on query patterns
- migration-guide: Step-by-step MongoDB version migration plans
- mongo-shell: Generate MongoDB shell commands with explanations