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

aiclaudedatabasellmmcpmodel-context-protocolmongodb
Stars
205โ˜…
Forks
31
Language
JavaScript
License
MIT
Created
2025-03-09
Last push
2025-04-23