{"type":"mcp_server","name":"mongodb-lens","description":"MongoDB Lens is a local Model Context Protocol server that enables natural language interaction with MongoDB databases. It allows users to perform queries, run aggregations, and optimize performance using LLMs.","category":"Database","language":"JavaScript","stars":204,"forks":1,"owner":"furey","github_url":"https://github.com/furey/mongodb-lens","homepage":"https://www.npmjs.com/package/mongodb-lens","setup":"## Setup\n\n1.  Install MongoDB Lens using NPX, Docker Hub, Node.js from Source, or Docker from Source.\n2.  Configure MongoDB Lens by setting the MongoDB connection string, using a config file, or environment variables.\n3.  Set up your MCP Client (e.g., Claude Desktop, Cursor) by configuring the connection to MongoDB Lens.\n4.  Explore your MongoDB databases with natural language queries.","tools":"## Available Tools\n\n1.  `aggregate-data`: Execute aggregation pipelines.\n2.  `analyze-query-patterns`: Analyze live queries and suggest optimizations.\n3.  `analyze-schema`: Automatically infer collection schemas.\n4.  `bulk-operations`: Perform multiple operations efficiently.\n5.  `collation-query`: Find documents with language-specific collation rules.\n6.  `compare-schemas`: Compare schemas between two collections.\n7.  `connect-mongodb`: Connect to a different MongoDB URI.\n8.  `connect-original`: Connect back to the original MongoDB URI used at startup.\n9.  `count-documents`: Count documents matching specified criteria.\n10. `create-collection`: Create new collections with custom options.\n11. `create-database`: Create a new database with option to switch to it.\n12. `create-index`: Create new indexes for performance optimization.\n13. `create-timeseries`: Create time series collections for temporal data.\n14. `create-user`: Create new database users with specific roles.\n15. `current-database`: Show the current database context.\n16. `delete-document`: Delete documents matching specified criteria.\n17. `distinct-values`: Extract unique values for any field.\n18. `drop-collection`: Remove collections from the database.\n19. `drop-database`: Drop a database.\n20. `drop-index`: Remove indexes from collections.\n21. `drop-user`: Remove database users.\n22. `explain-query`: Analyze query execution plans.\n23. `export-data`: Export query results in JSON or CSV format.\n24. `find-documents`: Run queries with filters, projections, and sorting.\n25. `generate-schema-validator`: Generate JSON Schema validators.\n26. `geo-query`: Perform geospatial queries with various operators.\n27. `get-stats`: Retrieve database or collection statistics.\n28. `gridfs-operation`: Manage large files with GridFS buckets.\n29. `list-collections`: Explore collections in the current database.\n30. `list-connections`: View all available MongoDB connection aliases.\n31. `list-databases`: View all accessible databases.\n32. `map-reduce`: Run MapReduce operations for complex data processing.\n33. `modify-document`: Insert or update specific documents.\n34. `rename-collection`: Rename existing collections.\n35. `shard-status`: View sharding configuration for databases and collections.\n36. `text-search`: Perform full-text search across text-indexed fields.\n37. `transaction`: Execute multiple operations in a single ACID transaction.\n38. `use-database`: Switch to a specific database context.\n39. `validate-collection`: Check for data inconsistencies.\n40. `watch-changes`: Monitor real-time changes to collections.\n41. `collection-indexes`: Get index information for a collection.\n42. `collection-schema`: Get schema information for a collection.\n43. `collection-stats`: Get performance statistics for a collection.\n44. `collection-validation`: Get validation rules for a collection.\n45. `collections`: List of collections in the current database.\n46. `database-triggers`: Get database change streams and event triggers configuration.\n47. `database-users`: Get database users and roles in the current database.\n48. `databases`: List of all accessible databases.\n49. `performance-metrics`: Get real-time performance metrics and profiling data.\n50. `replica-status`: Get replica set status and configuration.\n51. `server-status`: Get server status information.\n52. `stored-functions`: Get stored JavaScript functions in the current database.\n53. `aggregation-builder`: Step-by-step creation of aggregation pipelines.\n54. `backup-strategy`: Customized backup and recovery recommendations.\n55. `data-modeling`: Expert advice on MongoDB schema design for specific use cases.\n56. `database-health-check`: Comprehensive database health assessment and recommendations.\n57. `index-recommendation`: Get personalized index suggestions based on query patterns.\n58. `migration-guide`: Step-by-step MongoDB version migration plans.\n59. `mongo-shell`: Generate MongoDB shell commands with explanations.\n60. `multi-tenant-design`: Design MongoDB multi-tenant database architecture.\n61. `query-builder`: Interactive guidance for constructing MongoDB queries.\n62. `query-optimizer`: Optimization recommendations for slow queries.\n63. `schema-analysis`: Detailed collection schema analysis with recommendations.\n64. `schema-versioning`: Manage schema evolution in MongoDB applications.\n65. `security-audit`: Database security analysis and improvement recommendations.\n66. `sql-to-mongodb`: Convert SQL queries to MongoDB aggregation pipelines.","faq":null,"created_at":"2025-03-09T05:39:54+00:00","updated_at":"2025-03-28T21:38:45+00:00","source_url":"https://model-context-protocol.com/servers/mongodb-natural-language-mongodb-database-queries","related_articles":[]}