MongoDB Lens v9.1.4 is a full-featured Model Context Protocol (MCP) server that provides natural language access to MongoDB databases via LLMs like Claude. It enables querying, aggregation, schema analysis, performance optimization, and data manipulation through MCP tools, resources, and prompts. The package is actively maintained with regular releases on npm and Docker. Key differentiators include a comprehensive set of tools (over 30), built-in data protection with confirmation for destructive operations, memory caching, and support for multiple connection aliases. It requires Node.js >=18 and the MongoDB driver.
npm install mongodb-lensNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Starts the MongoDB Lens MCP server with a MongoDB URI and allowed databases.
Use import syntax or set 'type': 'module' in package.json.
Set a custom port in the configuration object.
Ensure your MCP client supports user confirmation prompts.
Define connection aliases in the configuration object instead.
Run npm install mongodb-lens@latest and ensure you are using import syntax.
Use import { startServer } from 'mongodb-lens' or import startServer from 'mongodb-lens'.Set MONGO_URI to a valid MongoDB connection string, e.g., mongodb://localhost:27017/mydb