MongoDB Lens
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
add-connection-alias: Add a new MongoDB connection aliasaggregate-data: Execute aggregation pipelinesanalyze-query-patterns: Analyze live queries and suggest optimizationsanalyze-schema: Automatically infer collection schemasbulk-operations: Perform multiple operations efficiently (requires confirmation for destructive operations)clear-cache: Clear memory caches to ensure fresh datacollation-query: Find documents with language-specific collation rulescompare-schemas: Compare schemas between two collectionsconnect-mongodb: Connect to a different MongoDB URIconnect-original: Connect back to the original MongoDB URI used at startupcount-documents: Count documents matching specified criteriacreate-collection: Create new collections with custom optionscreate-database: Create a new database with option to switch to itcreate-index: Create new indexes for performance optimizationcreate-timeseries: Create time series collections for temporal datacreate-user: Create new database users with specific rolescurrent-database: Show the current database contextdelete-document: Delete documents matching specified criteria (requires confirmation)distinct-values: Extract unique values for any fielddrop-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 plansexport-data: Export query results in JSON or CSV formatfind-documents: Run queries with filters, projections, and sortinggenerate-schema-validator: Generate JSON Schema validatorsgeo-query: Perform geospatial queries with various operatorsget-stats: Retrieve database or collection statisticsgridfs-operation: Manage large files with GridFS bucketsinsert-document: Insert one or more documents into collectionslist-collections: Explore collections in the current databaselist-connections: View all available MongoDB connection aliaseslist-databases: View all accessible databasesrename-collection: Rename existing collections (requires confirmation when dropping targets)shard-status: View sharding configuration for databases and collectionstext-search: Perform full-text search across text-indexed fieldstransaction: Execute multiple operations in a single ACID transactionupdate-document: Update documents matching specified criteriause-database: Switch to a specific database contextvalidate-collection: Check for data inconsistencieswatch-changes: Monitor real-time changes to collections
Resources
collection-indexes: Index information for a collectioncollection-schema: Schema information for a collectioncollection-stats: Performance statistics for a collectioncollection-validation: Validation rules for a collectioncollections: List of collections in the current databasedatabase-triggers: Database change streams and event triggers configurationdatabase-users: Database users and roles in the current databasedatabases: List of all accessible databasesperformance-metrics: Real-time performance metrics and profiling datareplica-status: Replica set status and configuration- [
server-status](https://github.com/search?type=code&q=repo%3Afurey%2Fmongodb-lens+%2Fserver%5C.resource%5C%28%5Cs*%27server-status%27%2C%
…