# codedb-io/codedb-lens [Health: Active]

**Category:** 🗄️ Databases  
**Repository:** https://github.com/codedb-io/codedb-lens  
**GitHub Stars:** 8  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/codedb-io-codedb-lens

## Description
Read-only health check for SQL Server and PostgreSQL: A–F grade with evidence and next actions, 24-hour recordings, schema tools and guarded single-SELECT queries within per-profile row and time limits. Uses your saved profiles; passwords stay in the OS keychain.

## Claude Desktop Quick Installation
Remote MCP endpoint (confidence: high). Install path detected from listing signals. Add as a URL/SSE server in your client:

```json
"mcpServers": {
  "codedb-lens": {
    "url": "https://lens.codedb.com.br/mcp/"
  }
}
```

## Documentation

## 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`.

_Full upstream README: https://allmcps.com/mcp/codedb-io-codedb-lens/readme_

