MongoDB Database Tools

v1.0.0โ€ขDatabasesโ€ขstable

๐Ÿ“‡ ๐Ÿ  - MongoDB Lens: Full Featured MCP Server for MongoDB Databases

aiclaudedatabasellmmcp
Share:
201
Stars
0
Downloads
0
Weekly
0/5

What is MongoDB Database Tools?

MongoDB Database Tools is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to ๐Ÿ“‡ ๐Ÿ  - mongodb lens: full featured mcp server for mongodb databases

๐Ÿ“‡ ๐Ÿ  - MongoDB Lens: Full Featured MCP Server for MongoDB Databases

This server falls under the Databases category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • ๐Ÿ“‡ ๐Ÿ  - MongoDB Lens: Full Featured MCP Server for MongoDB Dat

Use Cases

Query MongoDB databases with NL
Analyze collections and schemas
Full-featured database operations
furey

Maintainer

LicenseMIT License
Languagejavascript
Versionv1.0.0
UpdatedMar 30, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

NPM

npx -y mongodb-lens

Manual Installation

npx -y mongodb-lens

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use MongoDB Database Tools

MongoDB Lens is a full-featured MCP server that gives AI assistants direct, natural-language access to MongoDB databases through more than 60 tools covering queries, aggregations, index management, schema analysis, user administration, and data export. It connects to any MongoDB instance โ€” local, Atlas, or remote โ€” via a standard connection string, and includes safety features like two-step confirmation tokens for destructive operations so you can safely let an AI agent explore and manipulate your data. It also exposes 12 read-only resources (schemas, stats, validation rules) and 14 guided prompts for query building and security audits.

Prerequisites

  • Node.js 18 or higher installed (for npx usage)
  • A running MongoDB instance (local on port 27017, MongoDB Atlas, or any remote host)
  • The MongoDB connection string for your target database
  • An MCP-compatible client (Claude Desktop, Claude Code, or similar)
1

Test the server with npx

Run MongoDB Lens directly with npx to verify it connects to your MongoDB instance before adding it to your client config. Pass your connection string as the first argument.

npx -y mongodb-lens mongodb://localhost:27017
2

Add the server to your MCP client configuration

Open your Claude Desktop config file and add the mongodb-lens entry. Pass your MongoDB connection string as the argument. For authenticated connections, include credentials in the URI.

{
  "mcpServers": {
    "mongodb-lens": {
      "command": "npx",
      "args": ["-y", "mongodb-lens", "mongodb://localhost:27017"]
    }
  }
}
3

Configure for authenticated MongoDB instances

For MongoDB Atlas or password-protected instances, include your credentials in the connection string. Use the CONFIG_MONGO_URI environment variable as an alternative to keep credentials out of args.

{
  "mcpServers": {
    "mongodb-lens": {
      "command": "npx",
      "args": ["-y", "mongodb-lens"],
      "env": {
        "CONFIG_MONGO_URI": "mongodb+srv://username:[email protected]/mydb"
      }
    }
  }
}
4

Restart your MCP client and verify tools

Restart Claude Desktop. The 60+ MongoDB tools should appear, including find-documents, aggregate-data, create-index, and schema analysis tools. Try listing databases to confirm connectivity.

5

Understand destructive operation safety

Operations like drop-database or delete-document require two-step confirmation. The server returns a 4-digit token that expires in 5 minutes โ€” resubmit the command with the token to execute. To disable this for automation, set CONFIG_DISABLE_DESTRUCTIVE_OPERATION_TOKENS=true.

MongoDB Database Tools Examples

Client configuration

Claude Desktop configuration for MongoDB Lens connecting to a local MongoDB instance.

{
  "mcpServers": {
    "mongodb-lens": {
      "command": "npx",
      "args": ["-y", "mongodb-lens", "mongodb://localhost:27017"],
      "env": {
        "CONFIG_LOG_LEVEL": "info"
      }
    }
  }
}

Prompts to try

Example prompts that use MongoDB Lens tools for querying, analysis, and database management.

- "Show me all databases and their collection counts"
- "Find the top 5 documents in the orders collection sorted by total_amount descending"
- "What indexes exist on the users collection and are any of them unused?"
- "Run an aggregation to count orders per customer in the last 30 days"
- "Show me the schema of the products collection with field types and sample values"
- "Explain the query plan for: find users where email contains '@gmail.com'"

Troubleshooting MongoDB Database Tools

Connection refused when connecting to local MongoDB

Verify MongoDB is running with `mongosh --eval 'db.runCommand({ping:1})'`. The default port is 27017. If using Docker, ensure the container port is mapped to the host and use `host.docker.internal` instead of `localhost` in the connection string.

Authentication failed for Atlas or remote connections

URL-encode special characters in passwords within the connection string. Ensure the database user has appropriate roles. For Atlas, verify your IP address is whitelisted in the Network Access settings.

Destructive operations never execute even after confirming

The confirmation token expires after 5 minutes. Re-request the operation to get a fresh token. If you need to disable the two-step flow entirely, set CONFIG_DISABLE_DESTRUCTIVE_OPERATION_TOKENS=true in your env block.

Frequently Asked Questions about MongoDB Database Tools

What is MongoDB Database Tools?

MongoDB Database Tools is a Model Context Protocol (MCP) server that ๐Ÿ“‡ ๐Ÿ  - mongodb lens: full featured mcp server for mongodb databases It connects AI assistants to external tools and data sources through a standardized interface.

How do I install MongoDB Database Tools?

Install via npm with the command: npx -y mongodb-lens. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).

Which AI clients work with MongoDB Database Tools?

MongoDB Database Tools works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is MongoDB Database Tools free to use?

Yes, MongoDB Database Tools is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.

Browse More Databases MCP Servers

Explore all databases servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "mongodb-lens": { "command": "npx", "args": ["-y", "mongodb-lens"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide โ†’

Ready to use MongoDB Database Tools?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides