Skip to content
MCP server

codeDB Lens

Read-only health checks and data questions for SQL Server and PostgreSQL

Runs locallyStatus and history
Pricing
Free
Platforms
Windows, Linux, CLI
Runs
Locally
Version
0.9.1
Listing updated
2 days ago

About codeDB Lens

codeDB Lens is a free MCP server for databases. It runs locally on your machine and is started by your AI client.

Database diagnosis usually means running a pile of scripts by hand. codeDB Lens does it with a read-only login and a catalog of evidence-based rules, then produces an A to F grade with a coverage seal showing how many rules could actually run. The README lists 26 rules plus 8 for recordings, covering things like missing backups, failing SQL Agent jobs, blocked sessions, unused indexes, replication lag and transaction ID wraparound risk.

The MCP server is started by your AI client on your own computer, opens no port and installs nothing on the database server. The login you give decides its use. A minimal login lets the assistant run the health check, read recordings and explain what to fix without reading business data. A login that can read chosen tables lets it list tables, describe them and run SELECT queries to answer questions or compare periods.

Saved connection profiles keep passwords out of the AI's view, and a redact flag masks host, database and object names. The Lens itself makes no network call, though your AI client sends results to its model provider. The installer commands target Claude Desktop, VS Code, Cursor and Claude Code, and three prompts are provided: diagnose, incident and explore_data.

Install

Run in a terminal

claude mcp add codedb-lens --env CODEDB_LENS_PASSWORD='<CODEDB_LENS_PASSWORD>' -- docker run -i --rm -e CODEDB_LENS_PASSWORD ghcr.io/codedb-io/codedb-lens:0.9.1

Add to claude_desktop_config.json

{
  "mcpServers": {
    "codedb-lens": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "CODEDB_LENS_PASSWORD",
        "ghcr.io/codedb-io/codedb-lens:0.9.1"
      ],
      "env": {
        "CODEDB_LENS_PASSWORD": "<CODEDB_LENS_PASSWORD>"
      }
    }
  }
}

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "codedb-lens": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "CODEDB_LENS_PASSWORD",
        "ghcr.io/codedb-io/codedb-lens:0.9.1"
      ],
      "env": {
        "CODEDB_LENS_PASSWORD": "<CODEDB_LENS_PASSWORD>"
      }
    }
  }
}

Add to .vscode/mcp.json

{
  "servers": {
    "codedb-lens": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "CODEDB_LENS_PASSWORD",
        "ghcr.io/codedb-io/codedb-lens:0.9.1"
      ],
      "env": {
        "CODEDB_LENS_PASSWORD": "<CODEDB_LENS_PASSWORD>"
      }
    }
  }
}

Add to ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "codedb-lens": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "CODEDB_LENS_PASSWORD",
        "ghcr.io/codedb-io/codedb-lens:0.9.1"
      ],
      "env": {
        "CODEDB_LENS_PASSWORD": "<CODEDB_LENS_PASSWORD>"
      }
    }
  }
}

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "codedb-lens": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "CODEDB_LENS_PASSWORD",
        "ghcr.io/codedb-io/codedb-lens:0.9.1"
      ],
      "env": {
        "CODEDB_LENS_PASSWORD": "<CODEDB_LENS_PASSWORD>"
      }
    }
  }
}

Configuration

  • CODEDB_LENS_PASSWORDpassword of the login

Tools this server provides (13)

Taken from the project documentation; the running server may differ.

list_profiles
Profiles the AI may use, never passwords
check
Run the health check and save the report
get_finding
One rule of a saved run with its evidence rows
history
List saved runs
compare
New, resolved and persisting findings between two runs
list_rules
The rule catalog
explain_rule
What a rule measures, its SQL and documentation
list_recordings
List recordings
recording_report
Report of a recorded period
record_command
The record command to run in a terminal
list_databases
List databases
list_tables
List tables
describe
Describe a table

What it does

Graded health check
Runs rules and returns an A to F grade with a coverage seal.
Evidence for findings
Each finding shows collected values, the query behind it and when it ran.
Run comparison
Compares saved runs for new, resolved and persisting findings.
Recordings
Reports on a period recorded from an instance, such as an earlier slowdown.
Two login modes
A minimal login for diagnosis, or a table-reading login for data questions.
Redaction
A flag masks host, database, object, login and file names in results.
Client installer
Adds itself to Claude Desktop, VS Code, Cursor or prints the Claude Code command.

Good for

  • Ask what to fix first on a production SQL Server
  • Find out what caused yesterday's slowdown
  • Answer sales questions from a PostgreSQL table with a read-only login
  • Compare this month's orders with last year's

Pricing

Free

Free health check; run comparison needs a free key

Prices change. Check lens.codedb.com.br before you buy.

codeDB Lens FAQ

Can it change my database?

The README says it is read-only: no DDL, no DML and no agent on the server.

Does the AI see my passwords?

No. Saved profiles hold passwords, and the AI never sees them.

Which databases are supported?

SQL Server and PostgreSQL.

Is data sent anywhere?

The Lens makes no network call, but your AI client sends what it returns to the model provider.

Is codeDB Lens free?

Yes. codeDB Lens is free to use.

How do I add codeDB Lens to Claude Code?

Run this command in your terminal: claude mcp add codedb-lens --env CODEDB_LENS_PASSWORD='<CODEDB_LENS_PASSWORD>' -- docker run -i --rm -e CODEDB_LENS_PASSWORD ghcr.io/codedb-io/codedb-lens:0.9.1

What are the best alternatives to codeDB Lens?

The closest alternatives to codeDB Lens are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.

Alternatives to codeDB Lens

  1. REA

    MCP server

    CLI and MCP server that lets coding agents reverse engineer apps and binaries

    Runs locally
    • Open source
    • 464K GitHub stars
    • Developer tools
  2. Codebase Memory

    MCP server

    Local MCP server that builds a code knowledge graph for AI coding agents

    Runs locally
    • Open source
    • 48.7K GitHub stars
    • Knowledge and memory
  3. GitHub

    MCP server

    Official MCP server connecting AI assistants to GitHub repos, issues and workflows

    Not checked yet
    • Remote
    • Open source
    • 34.5K GitHub stars
    • Developer tools
  4. MCP toolkit giving coding agents symbol-level code retrieval and editing

    Runs locally
    • Open source
    • 31.5K GitHub stars
    • Developer tools
  5. XERJ

    MCP server

    Local search engine for AI agents with cited answers over your code and docs

    Runs locally
    • Open source
    • 19.2K GitHub stars
    • Knowledge and memory
  6. Ouroboros

    MCP server

    Spec-first layer that pins requirements and verifies results of AI coding agent work

    Runs locally
    • Open source
    • 6.4K GitHub stars
    • Developer tools