Database · Developer Tools

MongoDB Lens logo

MongoDB Lens

furey/mongodb-lens

MongoDB Lens is a local Model Context Protocol (MCP) server with full featured access to MongoDB databases using natural language via LLMs to perform queries, run aggregations, optimize performance, and more.

Install

npx -y mongodb-lens

Client configuration

{
  "mcpServers": {
    "mongodb-lens": {
      "command": "/path/to/npx",
      "args": [
        "-y",
        "mongodb-lens@latest",
        "mongodb://your-connection-string"
      ]
    }
  }
}

Environment variables

CONFIG_PATHCONFIG_DISABLE_DESTRUCTIVE_OPERATION_TOKENS
GitHub stars
117
Author
@furey
Category
Database, Developer Tools
License
MIT
Updated
Oct 6, 2026

Tools (40)

  • add-connection-alias

    Add a new MongoDB connection alias

  • aggregate-data

    Execute aggregation pipelines

  • analyze-query-patterns

    Analyze live queries and suggest optimizations

  • analyze-schema

    Automatically infer collection schemas

  • bulk-operations

    Perform multiple operations efficiently (requires confirmation for destructive operations)

  • clear-cache

    Clear memory caches to ensure fresh data

  • collation-query

    Find documents with language-specific collation rules

  • compare-schemas

    Compare schemas between two collections

  • connect-mongodb

    Connect to a different MongoDB URI

  • connect-original

    Connect back to the original MongoDB URI used at startup

  • count-documents

    Count documents matching specified criteria

  • create-collection

    Create new collections with custom options

  • create-database

    Create a new database with option to switch to it

  • create-index

    Create new indexes for performance optimization

  • create-timeseries

    Create time series collections for temporal data

  • create-user

    Create new database users with specific roles

  • current-database

    Show the current database context

  • delete-document

    Delete documents matching specified criteria (requires confirmation)

  • distinct-values

    Extract unique values for any field

  • drop-collection

    Remove collections from the database (requires confirmation)

  • drop-database

    Drop a database (requires confirmation)

  • drop-index

    Remove indexes from collections (requires confirmation)

  • drop-user

    Remove database users (requires confirmation)

  • explain-query

    Analyze query execution plans

  • export-data

    Export query results in JSON or CSV format

  • find-documents

    Run queries with filters, projections, and sorting

  • generate-schema-validator

    Generate JSON Schema validators

  • geo-query

    Perform geospatial queries with various operators

  • get-stats

    Retrieve database or collection statistics

  • gridfs-operation

    Manage large files with GridFS buckets

  • insert-document

    Insert one or more documents into collections

  • list-collections

    Explore collections in the current database

  • list-connections

    View all available MongoDB connection aliases

  • list-databases

    View all accessible databases

  • rename-collection

    Rename existing collections (requires confirmation when dropping targets)

  • shard-status

    View sharding configuration for databases and collections

  • text-search

    Perform full-text search across text-indexed fields

  • transaction

    Execute multiple operations in a single ACID transaction

  • update-document

    Update documents matching specified criteria

  • use-database

    Switch to a specific database context

Details on this page are taken from the project's README. Open README

Supported clients

Clients mentioned in this server's README:

View all
Claude Desktop logo

Claude Desktop

Desktop · Freemium · Proprietary

Anthropic's official Claude AI desktop application. Supports MCP servers to extend functionality.

WindowsMacOS
Cursor logo

Cursor

Desktop · Freemium · Proprietary

The first agentic IDE. The Cursor editor truly merges how developers and AI work together, delivering a magical coding experience.

WindowsMacOSLinux

Related MCP servers

More servers
Supabase MCP logo

Supabase MCP

supabase-community/supabase-mcp

1.3k

The Model Context Protocol (MCP) standardizes how Large Language Models (LLMs) talk to external services like Supabase. It connects AI assistants directly with your Supabase project and allows them to perform tasks like managing tables, fetching config, and querying data. See the full list of tools.

Database
Genai Toolbox logo

Genai Toolbox

googleapis/genai-toolbox

769

MCP Toolbox for Databases is an open source Model Context Protocol (MCP) server that connects your AI agents, IDEs, and applications directly to your enterprise databases.

Database
Supabase MCP Server logo

Supabase MCP Server

alexander-zuev/supabase-mcp-server

677

Query MCP is an open-source MCP server that lets your IDE safely run SQL, manage schema changes, call the Supabase Management API, and use Auth Admin SDK — all with built-in safety controls.

Database
Awesome MCP List logo

Awesome MCP List

MobinX/awesome-mcp-list

645

This is a continuously updated curated list of MCP servers, covering categories such as browser control, arts and culture, cloud platforms, command line, communication, customer data platforms, databases, developer tools, data science tools, file systems, finance and fintech, gaming, knowledge and memory, location services, marketing, monitoring, search and utilities. Each project includes a GitHub link and star count for quick reference and use.

Database
PostgreSQL Model Context Protocol (PG MCP) Server logo

PostgreSQL Model Context Protocol (PG MCP) Server

stuzero/pg-mcp-server

440

PG-MCP is a server implementation of the Model Context Protocol for PostgreSQL databases. It provides a comprehensive API for AI agents to discover, connect to, query, and understand PostgreSQL databases through MCP's resource-oriented architecture.

Database
dbhub logo

dbhub

bytebase/dbhub

332

[!NOTE] If you need an enterprise-level database MCP server with built-in guardrails like approval flow, access control, data masking, and audit logging beyond what DBHub offers, check out Bytebase.

Database