codeDB Lens MCP server
2026년 11월 6일 커밋AI 클라이언트를 통해 SQL Server 및 PostgreSQL의 읽기 전용 데이터베이스 상태 점검을 수행하고 데이터 관련 질문에 답변합니다.
다른 이름 codedb-io/codedb-lens, codedb-lens
- 스타
- 8
- Tools
- —
- 다운로드, 30일
- —
- 최신 버전
- 0.9.1
- 마지막 커밋
- 2026년 11월 6일
- 라이선스
- Apache-2.0
codeDB Lens MCP란?
codeDB Lens은(는) MCP server입니다. AI 클라이언트를 통해 SQL Server 및 PostgreSQL의 읽기 전용 데이터베이스 상태 점검을 수행하고 데이터 관련 질문에 답변합니다.
프로젝트 README에서 생성된 요약
codeDB Lens MCP server 정보
codeDB Lens는 SQL Server 및 PostgreSQL에 대한 읽기 전용 데이터베이스 상태 점검 및 데이터 쿼리 기능을 제공합니다. 이 도구는 사용자의 로컬 머신에서 실행되는 MCP server로 작동하며, 저장된 프로필 또는 환경 변수를 통해 데이터베이스 인스턴스에 연결합니다. 이러한 구성 덕분에 데이터베이스 정보가 원격 서비스로 전송되지 않고 사용자의 컴퓨터에 안전하게 유지됩니다.
개발자는 check 명령을 통해 심층 진단을 수행할 수 있으며, 이 명령은 26가지 특정 규칙을 기반으로 A–F 등급 보고서를 생성합니다. 또한 이 서버는 24시간 동안의 인스턴스 상태를 기록하고 비교하는 기능을 지원합니다. Claude Desktop, Cursor 또는 GitHub Copilot과 같은 AI 클라이언트와 함께 사용하면, AI가 정의된 행 및 시간 제한 내에서 단일 SELECT 문을 사용하여 기술적 수정 사항을 설명하거나 특정 데이터 질문에 답변할 수 있습니다.
활용 사례
- 1데이터베이스 상태 진단 수행AI 클라이언트에 전체 상태 점검을 실행하도록 요청하고 데이터베이스에서 수정이 필요한 사항을 설명하도록 합니다.
- 2AI를 통한 특정 데이터 쿼리사용자가 권한을 부여한 특정 테이블을 쿼리하여 AI가 비즈니스 질문에 답변하도록 요청합니다.
- 3시간 경과에 따른 데이터베이스 변경 사항 모니터링record 및 report 도구를 사용하여 인스턴스를 하루 동안 관찰하고 트렌드를 식별합니다.
프로젝트의 README를 바탕으로 작성되었습니다. 모든 활용 사례는 해당 내용의 인용문과 대조하여 확인합니다.
codeDB Lens MCP 설치 방법
형식 확인: 2026년 11월 10일Cursor에 추가Goose에 추가Claude Code에 codeDB Lens MCP 설치
$ claude mcp add --env 'CODEDB_LENS_PASSWORD=<YOUR_CODEDB_LENS_PASSWORD>' codedb-lens -- docker run -i --rm ghcr.io/codedb-io/codedb-lens:0.9.1Cursor에 codeDB Lens MCP 설치
~/.cursor/mcp.json
{
"mcpServers": {
"codedb-lens": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/codedb-io/codedb-lens:0.9.1"
],
"env": {
"CODEDB_LENS_PASSWORD": "<YOUR_CODEDB_LENS_PASSWORD>"
}
}
}
}VS Code에 codeDB Lens MCP 설치
.vscode/mcp.json
{
"servers": {
"codedb-lens": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/codedb-io/codedb-lens:0.9.1"
],
"env": {
"CODEDB_LENS_PASSWORD": "<YOUR_CODEDB_LENS_PASSWORD>"
}
}
}
}VS Code CLI에 codeDB Lens MCP 설치
$ code --add-mcp '{"name":"codedb-lens","type":"stdio","command":"docker","args":["run","-i","--rm","ghcr.io/codedb-io/codedb-lens:0.9.1"],"env":{"CODEDB_LENS_PASSWORD":"<YOUR_CODEDB_LENS_PASSWORD>"}}'Claude Desktop에 codeDB Lens MCP 설치
claude_desktop_config.json
{
"mcpServers": {
"codedb-lens": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/codedb-io/codedb-lens:0.9.1"
],
"env": {
"CODEDB_LENS_PASSWORD": "<YOUR_CODEDB_LENS_PASSWORD>"
}
}
}
}Codex에 codeDB Lens MCP 설치
$ codex mcp add codedb-lens --env 'CODEDB_LENS_PASSWORD=<YOUR_CODEDB_LENS_PASSWORD>' -- docker run -i --rm ghcr.io/codedb-io/codedb-lens:0.9.1Codex config.toml에 codeDB Lens MCP 설치
~/.codex/config.toml
[mcp_servers.codedb-lens] command = "docker" args = ["run", "-i", "--rm", "ghcr.io/codedb-io/codedb-lens:0.9.1"] [mcp_servers.codedb-lens.env] CODEDB_LENS_PASSWORD = "<YOUR_CODEDB_LENS_PASSWORD>"
Gemini CLI에 codeDB Lens MCP 설치
$ gemini mcp add -s user -e 'CODEDB_LENS_PASSWORD=<YOUR_CODEDB_LENS_PASSWORD>' codedb-lens docker -- run -i --rm ghcr.io/codedb-io/codedb-lens:0.9.1Gemini settings.json에 codeDB Lens MCP 설치
~/.gemini/settings.json
{
"mcpServers": {
"codedb-lens": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/codedb-io/codedb-lens:0.9.1"
],
"env": {
"CODEDB_LENS_PASSWORD": "<YOUR_CODEDB_LENS_PASSWORD>"
}
}
}
}구성
CODEDB_LENS_PASSWORD비밀password of the login
| 이름 | 설명 | 유형 |
|---|---|---|
| CODEDB_LENS_PASSWORD | password of the login | 비밀 |
자동 검사
2026년 11월 13일에 실행됨전체 보고서 →아직 인증되지 않았습니다. 서버는 80점 이상의 점수, 심각한 결함 없음, 그리고 검사에 충분한 데이터를 갖추어야 합니다. 검사 방식 · 점수를 높이기 위해 수정할 항목
- 소스 저장소 연결 및 접근 가능통과
- 오픈 소스 라이선스 (OSI)통과
- 최근 1년 내 커밋 또는 릴리스통과
- 패키지 이름이 인기 패키지와 유사하지 않음검사되지 않음
- 원격 엔드포인트가 HTTPS 사용검사되지 않음
- 파괴적인 도구에 라벨 표시됨검사되지 않음
- 모델에 대한 숨겨진 지침 없음통과
- 패키지 및 해당 종속성에 중요한 보안 권고 없음검사되지 않음
README
GitHub에서 보기v0.8:
check(with an executive summary and--redactfor sharing),compare, andrecord+reportto watch an instance for up to 24 hours (how). 26 rules plus 8 for recordings. FAQ and more on the website.
codeDB Lens connects to your instance with a read-only login, runs a catalog of evidence-based rules and writes a self-contained HTML + JSON report with an A–F grade and a coverage seal (the share of rules that could actually run). Nothing about your database leaves your machine.
Install
| Where | How |
|---|---|
| Windows | Installer (per user, no admin) or portable .zip |
| Windows (Scoop) | scoop bucket add codedb https://github.com/codedb-io/codedb-lens then scoop install codedb/codedb-lens |
| Linux | .deb / .rpm from the latest release, or the tarball for x64 / arm64 |
| Docker | docker run --rm -e PG_DSN -v "$PWD:/out" ghcr.io/codedb-io/codedb-lens check --engine pg --dsn-env PG_DSN --out /out |
The Windows binaries are open source but not code-signed yet, so SmartScreen may show a warning. Why, and how to verify the download.
Why another tool?
- Evidence, not opinions. Every finding shows the collected values, the query that produced them and when.
- Honest confidence. Each finding is Confirmed, Hint or No data. A rule that lacks permission never shows up as a false "OK"; it lowers the coverage instead.
- Read-only, always. No DDL, no DML, no agent, no installation on the server.
- Rules are data. Each rule is a YAML file plus a SQL query. Contributions don't touch the engine.
- English and Portuguese (Brazil), in the app, the CLI and the report.
What it checks
| SQL Server | PostgreSQL |
|---|---|
| Missing or old backups | Version out of support |
| No recent clean DBCC CHECKDB | pg_stat_statements not available |
| Failing SQL Agent jobs | A single query dominating execution time |
| Disk or transaction log running out of space | Long and idle-in-transaction sessions |
| Dominant waits, translated | Sessions blocked by locks |
| Sessions blocked right now | Transaction ID wraparound risk |
| A single query dominating CPU | Dead rows and autovacuum falling behind |
| Instance settings left at defaults | Replication slots retaining WAL, replica lag |
| TempDB file layout | Connections near the limit, no pooler |
| Version out of support | Unused, duplicate and invalid indexes |
| High-impact missing indexes | Estimated table bloat |
| Unused and duplicate indexes | Largest tables |
Each rule has a documentation page with what it checks, why it matters, what to do and its limits.
Quick start
On Windows, open codeDB Lens from the Start menu. Pick the engine, enter the server and run the diagnosis. Connection profiles are saved; passwords go to the Windows Credential Manager.
Command line (Windows and Linux):
codedb-lens check --engine mssql --server prod01 --auth windows
codedb-lens check --engine pg --dsn-env PG_DSN
Passwords are never accepted as command-line arguments. Use integrated auth, an environment variable or a saved profile.
Use with AI (MCP)
Ask Claude, GitHub Copilot or Cursor about your database. codedb-lens mcp is a read-only MCP server that your AI
client starts on your computer, with your saved profiles:
- Diagnosis: with the Lens's minimal login, the AI runs the health check, reads recordings and explains what to fix, without reading business data.
- Data: with a login that reads the tables you choose, the AI lists and describes them and answers questions with
one
SELECTat a time, within row and time limits.
codedb-lens mcp install --client claude-desktop --profile prod # or vscode, cursor, claude-code
The app's AI (MCP) screen has the commands ready to copy. Guide: lens.codedb.com.br/mcp.
Minimum permissions
-- SQL Server
CREATE LOGIN codedb_lens WITH PASSWORD = '<strong password>';
GRANT VIEW SERVER STATE TO codedb_lens;
GRANT VIEW ANY DEFINITION TO codedb_lens;
GRANT CONNECT ANY DATABASE TO codedb_lens; -- per-database rules (indexes); no data access
USE msdb;
CREATE USER codedb_lens FOR LOGIN codedb_lens;
ALTER ROLE db_datareader ADD MEMBER codedb_lens;
ALTER ROLE SQLAgentReaderRole ADD MEMBER codedb_lens;
-- PostgreSQL (repeat GRANT CONNECT for each database)
CREATE ROLE codedb_lens LOGIN PASSWORD '<strong password>';
GRANT pg_monitor TO codedb_lens;
GRANT CONNECT ON DATABASE app TO codedb_lens;
Supported versions
| Engine | Supported | Best-effort |
|---|---|---|
| SQL Server | 2017, 2019, 2022, 2025 (Windows and Linux), Azure SQL Managed Instance, Amazon RDS | 2016 and older; Azure SQL Database (6 of 13 rules apply, see permissions) |
| PostgreSQL | 15, 16, 17, 18, Amazon RDS, Aurora, Azure Flexible Server | 14 |
Privacy
No telemetry. Lens makes two kinds of network calls: an optional, once-a-day version check against GitHub Releases
that sends no data (--no-update-check or CODEDB_LENS_NO_UPDATE=1 turns it off), and, only when you ask for the free
key, one registration request with the name and e-mail you type (or, when renewing, only the current key). See SECURITY.md.
Need continuous monitoring?
Lens shows a snapshot. codeDB watches your SQL Server and PostgreSQL instances around the clock, with history, baselines and alerts on Teams, Slack and e-mail.
Windows code signing
Windows binaries are built by GitHub Actions from this repository and are not code-signed yet (certificates are paid and this is a free project). Details, how to verify a download and warning-free alternatives: Why Windows shows a warning.
Contributing
New rules are especially welcome. A rule is a YAML file plus a SQL query, so you don't need to touch the Go code: see CONTRIBUTING.md, or just open an issue with a rule idea.
License
Apache 2.0. The codeDB SaaS and its API are separate, closed-source products.
codeDB Lens MCP 질문
codeDB Lens MCP를 Claude Code에 추가하려면 어떻게 하나요?
터미널에서 claude mcp add --env 'CODEDB_LENS_PASSWORD=<YOUR_CODEDB_LENS_PASSWORD>' codedb-lens -- docker run -i --rm ghcr.io/codedb-io/codedb-lens:0.9.1를 실행합니다. 모든 프로젝트에서 사용할 수 있게 하려면 --scope user를 추가합니다.
codeDB Lens MCP를 Cursor에 추가하려면 어떻게 하나요?
~/.cursor/mcp.json를 열고 mcpServers 아래에 서버를 추가합니다. 위 설치 섹션에 표시된 Cursor 구성을 사용합니다.
codeDB Lens를 제 데이터에 안전하게 사용할 수 있나요?
네, 읽기 전용 로그인을 사용하며 데이터베이스의 어떤 정보도 사용자의 로컬 머신을 벗어나지 않습니다.
AI 어시스턴트와 함께 codeDB Lens를 사용할 수 있나요?
네, MCP server를 제공하여 Claude, GitHub Copilot 또는 Cursor와 같은 AI 클라이언트가 상태 점검을 수행하고 데이터 질문에 답변할 수 있도록 지원합니다.
도구가 텔레메트리를 수집하나요?
아니요, 도구는 텔레메트리를 수집하지 않습니다.
어떤 종류의 보고서를 생성하나요?
A–F 등급과 커버리지 인증이 포함된 독립형 HTML 및 JSON 보고서를 작성합니다.