MongoDB Lens
🍃🔎 MongoDB Lens: Full Featured MCP Server for MongoDB Databases
Overview
MongoDB Lens is a local Model Context Protocol (MCP) server that provides full-featured access to MongoDB databases using natural language queries via LLMs. It allows users to perform queries, run aggregations, and optimize performance effortlessly.
To use MongoDB Lens, clone the repository, install the dependencies, configure the server with your MongoDB connection string, and set up your MCP client (e.g., Claude Desktop). You can then start exploring your MongoDB databases using natural language queries.
- Execute aggregation pipelines and analyze schemas. - Perform bulk operations efficiently. - Create and manage collections and indexes. - Monitor real-time changes and get performance metrics. - Utilize various tools for data analysis and optimization.
- Analyzing and optimizing MongoDB database performance.
- Running complex queries using natural language.
- Managing and monitoring MongoDB collections and databases.
- Performing data migrations and schema analysis.
Add to your AI client
Use these steps to connect MongoDB Lens in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.
Cursor
Add this to your .cursor/mcp.json file in your project root, then restart Cursor.
.cursor/mcp.json
{
"mcpServers": {
"mongodb-lens-furey": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mongodb-lens-furey"
]
}
}
}Claude Desktop
Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
{
"mcpServers": {
"mongodb-lens-furey": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mongodb-lens-furey"
]
}
}
}Claude Code
Add this to your project's .mcp.json file. Claude Code will detect it automatically.
.mcp.json (project root)
{
"mcpServers": {
"mongodb-lens-furey": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mongodb-lens-furey"
]
}
}
}VS Code (Copilot)
Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.
.vscode/mcp.json
{
"servers": {
"mongodb-lens-furey": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mongodb-lens-furey"
]
}
}
}Windsurf
Add this to your Windsurf MCP config file, then restart Windsurf.
~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"mongodb-lens-furey": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mongodb-lens-furey"
]
}
}
}Cline
Open Cline settings, navigate to MCP Servers, and add this server configuration.
Cline MCP Settings (via UI)
{
"mcpServers": {
"mongodb-lens-furey": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mongodb-lens-furey"
]
}
}
}FAQ
Can MongoDB Lens be used with any MongoDB version?
Yes, MongoDB Lens is compatible with various MongoDB versions as long as the connection string is correctly configured.
Is MongoDB Lens free to use?
Yes, MongoDB Lens is open-source and free to use for everyone.
How can I install MongoDB Lens?
You can install MongoDB Lens using NPX, Docker, or by building from source.7:["$","div",null,{"className":"container mx-auto flex flex-col gap-4","children":["$L26","$L27",["$","$L28",null,{"currentProject":{"id":2320,"uuid":"5154da9f-a992-41a2-b794-7b3c86ab572f","name":"MongoDB Lens","title":"MongoDB Lens","description":"🍃🔎 MongoDB Lens: Full Featured MCP Server for MongoDB Databases","avatar_url":null,"created_at":"2025-03-09T15:33:08.969Z","updated_at":"2025-03-13T00:20:07.851Z","status":"created","author_name":"furey","author_avatar_url":null,"tags":"mongodb,database,mcp-server","category":"developer-tools","is_featured":false,"sort":1,"url":"https://github.com/furey/mongodb-lens","target":"_self","content":"$29","summary":"$2a","img_url":null,"type":null,"metadata":null,"user_uuid":"6def73ae-4bb7-4456-adcf-5cca43e932f9","tools":null,"sse_url":null,"sse_provider":null,"sse_params":null,"is_official":false,"server_command":null,"server_params":null,"server_config":null,"allow_call":false,"is_innovation":false,"is_dxt":false,"dxt_manifest":null,"dxt_file_url":null,"is_audit":false},"randomProjects":[],"currentServerKey":"$undefined"}]]}]