/ 디렉터리 / 플레이그라운드 / db-mcp-server
● 커뮤니티 FreePeak ⚡ 바로 사용

db-mcp-server

제작: FreePeak · FreePeak/db-mcp-server

One MCP server, many databases — MySQL, Postgres, SQLite, Oracle, TimescaleDB. Each connection gets its own query/schema/perf toolset.

db-mcp-server (FreePeak) connects to multiple databases simultaneously. For each configured connection it auto-generates query/execute/transaction/schema/performance tools. Supports TimescaleDB (hypertables, continuous aggregates) and Oracle specifics (RAC, wallet).

왜 쓰나요

핵심 기능

라이브 데모

실제 사용 모습

db.replay ▶ 준비됨
0/0

설치

클라이언트 선택

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "db": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/FreePeak/db-mcp-server"
      ],
      "_inferred": true
    }
  }
}

Claude Desktop → Settings → Developer → Edit Config 열기. 저장 후 앱 재시작.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "db": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/FreePeak/db-mcp-server"
      ],
      "_inferred": true
    }
  }
}

Cursor는 Claude Desktop과 동일한 mcpServers 스키마 사용. 프로젝트 설정이 전역보다 우선.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "db": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/FreePeak/db-mcp-server"
      ],
      "_inferred": true
    }
  }
}

Cline 사이드바의 MCP Servers 아이콘 클릭 후 "Edit Configuration" 선택.

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "db": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/FreePeak/db-mcp-server"
      ],
      "_inferred": true
    }
  }
}

Claude Desktop과 같은 형식. Windsurf 재시작 후 적용.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "db",
      "command": "TODO",
      "args": [
        "See README: https://github.com/FreePeak/db-mcp-server"
      ]
    }
  ]
}

Continue는 맵이 아닌 서버 오브젝트 배열 사용.

~/.config/zed/settings.json
{
  "context_servers": {
    "db": {
      "command": {
        "path": "TODO",
        "args": [
          "See README: https://github.com/FreePeak/db-mcp-server"
        ]
      }
    }
  }
}

context_servers에 추가. 저장 시 Zed가 핫 리로드.

claude mcp add db -- TODO 'See README: https://github.com/FreePeak/db-mcp-server'

한 줄 명령. claude mcp list로 확인, claude mcp remove로 제거.

사용 사례

실전 활용법: db-mcp-server

Run cross-database analysis from Claude

👤 Data engineers ⏱ ~25 min intermediate

언제 쓸까: You need to pull from Postgres (app) AND MySQL (legacy) in one conversation without switching tools.

사전 조건
  • config.json with both connections — Repo docs show the shape; store credentials in env refs, not inline
흐름
  1. Start the server
    Run ./bin/server -t sse -c config.json and confirm both connections come up.✓ 복사됨
    → Server logs 2 connections ok
  2. Query each
    From prod (Postgres): users signed up last week. From legacy (MySQL): orders attributed to them. Join in memory.✓ 복사됨
    → Combined dataset

결과: Cross-system insights without a data warehouse.

함정
  • Read-only assumption breaks — agent runs INSERTs — Use DB-level read-only users per connection; don't rely on agent discipline
함께 쓰기: google-sheets

Manage TimescaleDB hypertables from Claude

👤 Observability / IoT teams ⏱ ~20 min advanced

언제 쓸까: You want to create/inspect hypertables and continuous aggregates without memorizing Timescale DDL.

흐름
  1. Inspect existing hypertables
    List all hypertables in metrics DB with chunk interval and row count.✓ 복사됨
    → Table of hypertables
  2. Create a continuous aggregate
    Create a 1-hour rollup on sensor_readings grouping by device_id, avg + max + min.✓ 복사됨
    → CAgg created; refresh policy configured

결과: Timescale ops in minutes, not Google searches.

Explain an unfamiliar schema to get onboarded fast

👤 Engineers inheriting a database ⏱ ~30 min beginner

언제 쓸까: Day 1 at a new team; you need a map of the DB.

흐름
  1. Dump schema
    Use schema_<conn_id> on prod. Return tables, FK graph, and row-count order.✓ 복사됨
    → Schema + FK map
  2. Generate a glossary
    For each table, infer a 1-line description from column names and sample rows (limit 5 per table).✓ 복사됨
    → Onboarding cheat sheet

결과: Working mental model in 30 min.

조합

다른 MCP와 조합해 10배 효율

Export a query result into a shared Sheet for non-tech stakeholders

Query top 50 customers by LTV from prod; write to the 'Top LTV' sheet.✓ 복사됨

Cross-check DB slow-query findings with DB-level Prometheus metrics

For the slow query found via performance_prod, show the pg_stat_statements metrics from Prometheus for the same window.✓ 복사됨

도구

이 MCP가 노출하는 것

도구입력언제 호출비용
query_<db_id> sql: str (SELECT) Read data 1 query
execute_<db_id> sql: str (DDL/DML) Writes — guarded by DB permissions 1 query
transaction_<db_id> statements: str[] Multi-statement atomic changes 1 tx
schema_<db_id> table?: str Discovery / onboarding metadata query
generate_schema_<db_id> format: sql|json Export for docs/version control metadata queries
performance_<db_id> sql?: str Tune a slow query plan + stats

비용 및 제한

운영 비용

API 쿼터
Your DBs' capacity
호출당 토큰
Large result sets burn tokens fast — LIMIT aggressively
금액
Free MCP; DB hosting costs are yours
Always add LIMIT / cap output; stream to a file via filesystem MCP for bigger pulls

보안

권한, 시크릿, 파급범위

최소 스코프: DB-level read-only user recommended for exploration
자격 증명 저장: config.json references env vars; never commit with inline passwords
데이터 외부 송신: Only to configured DB hosts
절대 부여 금지: DB superuser to the MCP connection unless absolutely needed

문제 해결

자주 발생하는 오류와 해결

Connection pool exhausted

Tune pool size in config.json; kill zombie sessions on DB side; verify no runaway agent loops

확인: SELECT * FROM pg_stat_activity (for Postgres)
Oracle wallet auth fails

TNS_ADMIN path must be readable by the MCP process; on mac/linux watch for SELinux/AppArmor

Tool names don't appear for one DB

That connection likely failed to init; check server logs — usually wrong creds or firewall

대안

db-mcp-server 다른 것과 비교

대안언제 쓰나단점/장점
postgres-mcp (official)You only need PostgresSingle-DB
mysql-mcp (community)You only need MySQLSingle-DB

더 보기

리소스

📖 GitHub에서 공식 README 읽기

🐙 열린 이슈 보기

🔍 400+ MCP 서버 및 Skills 전체 보기