furey/mongodb-lens
View on GitHub โ๐๐ MongoDB Lens: Full Featured MCP Server for MongoDB Databases
205 โ
31 forksJavaScriptUpdated 1y ago
What you need to know
A local MCP server with full-featured access to MongoDB databases using natural language via LLMs โ queries, aggregations, schema analysis, performance optimization, indexes, transactions and more, with data-protection controls.
Install
npx -y mongodb-lens # default mongodb://localhost:27017 npx -y mongodb-lens mongodb://your-connection-string docker run --rm -i --network=host furey/mongodb-lens mongodb://your-connection-string
Usage
- โขAsk things like 'Show me all users older than 30' โ the client picks find-documents, aggregate-data, etc.
- โขManage connections with named aliases in ~/.mongodb-lens.jsonc (multiple MongoDB URIs)
- โขDestructive operations are gated by a two-step 4-digit confirmation token
Key features
- โ40+ tools: find, insert, update, delete, aggregate, schema analysis, explain-query, index management, transactions, watch-changes, GridFS
- โResources (schemas, indexes, stats, replica status) and prompts (query-builder, query-optimizer, security-audit, sql-to-mongodb)
- โMultiple connections, smart caching, auto-reconnection, credential obfuscation and a token-based confirmation system
- โRuns via NPX, Docker Hub image, or from source; supports older MongoDB via driver pinning
Best for
Developers and DBAs who want to query, explore and optimize MongoDB through natural language from their MCP client.
Caveats
- โ Data flows to your remote LLM provider โ use projection, read-only users and backup instances for sensitive data
- โ Confirmation bypass (CONFIG_DISABLE_DESTRUCTIVE_OPERATION_TOKENS) removes a safety mechanism
- โ Inserted metadata collection persists in each newly created database until manually dropped
Platforms: macOS ยท Linux ยท Windows ยท DockerClients: Claude Desktop ยท Cursor ยท MCP Inspector ยท MCP clients
Reviewed 2026-08-11
Topics
- Stars
- 205โ
- Forks
- 31
- Language
- JavaScript
- License
- MIT
- Created
- 2025-03-09
- Last push
- 2025-04-23