Codedb Lens logo

Codedb Lens

by codedb-io

Read-only MCP health checks and guarded SQL queries for SQL Server and PostgreSQL.

Install Codedb Lens

Pick your client, then add it in one click or paste the config.

Streamable HTTP (Remote)
Server URL
https://lens.codedb.com.br/mcp/

Remote servers are added in the app, not the config file: Customize → Connectors → Add custom connector, then paste this URL.

Claude Code command
claude mcp add --transport http codedb-io-codedb-lens https://lens.codedb.com.br/mcp/

Run in your terminal, then run /mcp in Claude Code to sign in if the server asks.

Overview

codedb-io/codedb-lens connects AI clients to saved SQL Server and PostgreSQL profiles through a read-only MCP interface. It exposes database diagnosis, recorded health data, schema inspection, and single-SELECT queries constrained by profile-specific row and execution-time limits. Reach for it when an agent needs operational database context or limited business-data answers without write access. Health findings include evidence, confidence, an A–F grade, and next actions.

Use cases

  • Run a read-only health check on a production SQL Server
  • Inspect PostgreSQL blocking, bloat, vacuum, or replication findings
  • Ask an AI client about selected database tables
  • Record database health signals for up to 24 hours

Key features

  • A–F health grades with evidence and coverage
  • Read-only SQL Server and PostgreSQL access
  • Schema inspection through MCP
  • Guarded single-SELECT queries
  • HTML and JSON reports
  • Up to 24-hour recordings

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

5/5 checks healthy over the last 19d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars8Stargazers on the source repository.
Last commit4d agoMost recent push to the default branch.

How Codedb Lens works

What codedb-io/codedb-lens does

codedb-io/codedb-lens gives MCP-compatible AI clients read-only access to selected SQL Server and PostgreSQL profiles. Its main use is database health analysis: the client can run Lens checks, inspect findings, explain recommended fixes, and review recordings collected for up to 24 hours.

The server also supports a separate data-access path. With a profile that can read the chosen tables, an AI client can list and describe schema objects and answer questions using one guarded SELECT at a time. This keeps the MCP data tools distinct from the lower-permission diagnosis workflow.

Health reports contain an A–F grade, collected values, the query behind each finding, timestamps, and a coverage seal showing how much of the rule set actually ran. Findings are classified as Confirmed, Hint, or No data rather than treating unavailable permissions as a successful check.

How it works

Run codedb-lens mcp locally and configure an MCP client to start it. The server uses saved connection profiles; passwords remain in the operating system keychain. Passwords are not accepted as command-line arguments. Profiles can use integrated authentication, an environment variable, or stored credentials.

The diagnosis workflow uses the minimal database login needed for health checks and avoids reading business data. The data workflow requires a login with access to the tables the client should inspect. Every database connection is read-only: the tool does not perform DDL or DML and does not install an agent on the database server.

Setup and configuration

Install the application from the latest release using the Windows installer or portable archive, Linux packages or tarballs, or the published Docker image. The command-line examples include:

bash
codedb-lens check --engine mssql --server prod01 --auth windows
codedb-lens check --engine pg --dsn-env PG_DSN

To add the MCP server to a supported client with a saved profile, use a command such as:

bash
codedb-lens mcp install --client claude-desktop --profile prod

The same installation command supports client values for VS Code, Cursor, and Claude Code. The application’s AI (MCP) screen also provides commands to copy. For PostgreSQL, the Docker example passes PG_DSN into the container and writes output to a mounted directory.

Tools and capabilities

  • Run evidence-based health checks for SQL Server and PostgreSQL.
  • Read findings, coverage information, and recorded observations through MCP.
  • Inspect database schemas and describe available tables.
  • Answer data questions with single SELECT statements.
  • Enforce per-profile row and query-time limits on guarded data access.
  • Produce self-contained HTML and JSON health reports outside the MCP workflow.

Checks cover areas including backups, database consistency, jobs, waits, blocking, storage, versions, indexes, PostgreSQL vacuum and bloat, replication lag, connection limits, and SQL Server TempDB layout. Recordings add time-based observations for supported rules.

Limitations and notes

Database access is read-only, and the available findings depend on granted permissions. SQL Server diagnosis can use permissions such as VIEW SERVER STATE, VIEW ANY DEFINITION, database connectivity, and selected reader roles; PostgreSQL diagnosis uses the pg_monitor role and database CONNECT privileges. Azure SQL Database has reduced rule coverage, while older engine versions are supported on a best-effort basis.

The tool is designed for snapshots and recordings rather than continuous monitoring. Recordings can watch an instance for up to 24 hours. Windows binaries are not code-signed, so SmartScreen may display a warning. Lens makes no telemetry calls; an optional daily GitHub Releases version check can be disabled with --no-update-check or CODEDB_LENS_NO_UPDATE=1.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Codedb Lens

codedb-io/codedb-lens is an MCP server that connects AI clients to saved, read-only SQL Server and PostgreSQL profiles. Its main tools run health diagnoses, read recorded findings, inspect schemas, and answer data questions with guarded single-SELECT queries subject to row and time limits.

Install the application, save a database profile, then run `codedb-lens mcp install --client <client> --profile <profile>`. The command supports Claude Desktop, VS Code, Cursor, and Claude Code; the application’s AI (MCP) screen provides ready-to-copy commands.

Yes, codedb-io/codedb-lens supports Cursor through its MCP installation command. Use `codedb-lens mcp install --client cursor --profile <profile>` after installing the application and creating the saved profile.

No, codedb-io/codedb-lens uses read-only database access and does not perform DDL or DML. Its data workflow issues one guarded `SELECT` at a time, with per-profile row and execution-time limits.

codedb-io/codedb-lens supports SQL Server and PostgreSQL, including listed managed offerings such as Azure SQL Managed Instance, Amazon RDS, Aurora, and Azure Flexible Server. Azure SQL Database has limited rule coverage, and some older versions are best-effort.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewCodedb Lens AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/codedb-io-codedb-lens?style=directory)](https://allmcps.com/mcp/codedb-io-codedb-lens)
HTML Embed
<a href="https://allmcps.com/mcp/codedb-io-codedb-lens"><img src="https://allmcps.com/api/badge/codedb-io-codedb-lens?style=directory" alt="Codedb Lens on AllMCPs" /></a>