/ Verzeichnis / Playground / DBHub
● Offiziell bytebase 🔑 Eigener Schlüssel nötig

DBHub

von bytebase · bytebase/dbhub

One MCP, many databases — Postgres, MySQL, SQL Server, SQLite, Oracle — in a read-only-by-default query interface.

Bytebase's DBHub is a zero-dependency MCP that speaks to multiple relational databases through a single npx @bytebase/dbhub binary. Pass the DSN for your DB flavor, get schema browsing, table sampling, and SQL execution. Runs in read-only mode by default, making it safe for exploratory production sessions.

Warum nutzen

Hauptfunktionen

Live-Demo

In der Praxis

dbhub.replay ▶ bereit
0/0

Installieren

Wählen Sie Ihren Client

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "dbhub": {
      "command": "npx",
      "args": [
        "-y",
        "@bytebase/dbhub"
      ]
    }
  }
}

Öffne Claude Desktop → Settings → Developer → Edit Config. Nach dem Speichern neu starten.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "dbhub": {
      "command": "npx",
      "args": [
        "-y",
        "@bytebase/dbhub"
      ]
    }
  }
}

Cursor nutzt das gleiche mcpServers-Schema wie Claude Desktop. Projektkonfiguration schlägt die globale.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "dbhub": {
      "command": "npx",
      "args": [
        "-y",
        "@bytebase/dbhub"
      ]
    }
  }
}

Klicken Sie auf das MCP-Servers-Symbol in der Cline-Seitenleiste, dann "Edit Configuration".

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "dbhub": {
      "command": "npx",
      "args": [
        "-y",
        "@bytebase/dbhub"
      ]
    }
  }
}

Gleiche Struktur wie Claude Desktop. Windsurf neu starten zum Übernehmen.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "dbhub",
      "command": "npx",
      "args": [
        "-y",
        "@bytebase/dbhub"
      ]
    }
  ]
}

Continue nutzt ein Array von Serverobjekten statt einer Map.

~/.config/zed/settings.json
{
  "context_servers": {
    "dbhub": {
      "command": {
        "path": "npx",
        "args": [
          "-y",
          "@bytebase/dbhub"
        ]
      }
    }
  }
}

In context_servers hinzufügen. Zed lädt beim Speichern neu.

claude mcp add dbhub -- npx -y @bytebase/dbhub

Einzeiler. Prüfen mit claude mcp list. Entfernen mit claude mcp remove.

Anwendungsfälle

Praxisnahe Nutzung: DBHub

Query 3 different databases in one session

👤 Engineers whose stack has >1 relational DB ⏱ ~20 min intermediate

Wann einsetzen: Your stack has Postgres for primary data, MySQL for a legacy service, and SQL Server for a reporting copy — and you want one AI assistant across all.

Voraussetzungen
  • DSN for each DB with read-only creds — postgres://, mysql://, sqlserver://, sqlite://, oracle:// formats
Ablauf
  1. Configure multiple DSNs
    Show me which DB I'm currently pointed at. If needed, switch to the MySQL DSN.✓ Kopiert
    → Clear active-DB indicator
  2. Inspect schema
    List tables in the current DB with approximate row counts.✓ Kopiert
    → Table catalog
  3. Cross-reference across DBs
    Query Postgres for user emails, then query MySQL legacy_users for the same emails, tell me who's in one but not the other.✓ Kopiert
    → Reconciliation report

Ergebnis: A single workflow across heterogeneous DBs without juggling different MCP servers.

Fallstricke
  • SQL dialect differences trip Claude (e.g. LIMIT vs TOP) — Tell Claude explicitly which DB flavor the current query targets, or split into DB-specific turns
Kombinieren mit: filesystem

Analyze a SQLite file someone sent you

👤 Engineers / analysts handed an opaque .db file ⏱ ~10 min beginner

Wann einsetzen: A customer sent a sqlite dump and wants it eyeballed.

Ablauf
  1. Point DBHub at the file
    Use DSN sqlite:///path/to/data.db. List tables + row counts.✓ Kopiert
    → Table inventory
  2. Sample each
    For each non-trivial table, show 5 sample rows and infer the purpose.✓ Kopiert
    → Per-table summary
  3. Answer the customer's question
    Customer asks: <question>. Write SQL, run, return answer.✓ Kopiert
    → Query + result

Ergebnis: Fast exploration of an unfamiliar sqlite file without extracting it into another tool.

Fallstricke
  • Large sqlite tables have no indexes — full scans can lock the file — Open with read-only; avoid aggregations across >1M rows in a single query
Kombinieren mit: filesystem

Run reporting queries against a read-replica safely

👤 BI / analytics ⏱ ~15 min beginner

Wann einsetzen: You have a replica for analytics and want AI-driven ad-hoc reports without exposing the primary.

Voraussetzungen
  • Read-only DSN against the replica — Replica-only credentials; statement_timeout enforced in DSN
Ablauf
  1. Verify it's the replica
    Confirm the current connection is read-only and points at the replica host.✓ Kopiert
    → Host string + read-only flag verified
  2. Run the report
    [paste business question]. Translate to SQL, run, return results.✓ Kopiert
    → Result set
  3. Persist for re-use
    Save this SQL to /reports/<name>.sql with a comment explaining the question.✓ Kopiert
    → SQL file saved

Ergebnis: Ad-hoc BI without risk to prod primary.

Fallstricke
  • Heavy queries slow the replica and create replication lag — Set statement_timeout and run big queries off-peak
Kombinieren mit: filesystem · antv-chart

Audit SQL Server stored procedures for a migration

👤 Teams migrating off SQL Server ⏱ ~30 min advanced

Wann einsetzen: You need a list of every stored procedure, its lines of code, and last-modified date.

Ablauf
  1. List procs
    Query sys.procedures + sys.sql_modules to list all procs with name, schema, lines, and last modified date.✓ Kopiert
    → Proc inventory
  2. Classify complexity
    Bucket procs by line count: trivial (<50), medium (50-300), complex (>300). Count each bucket.✓ Kopiert
    → Complexity histogram
  3. Surface MSSQL-specific features
    For complex procs, flag usage of MSSQL-specific constructs (CROSS APPLY, CTE recursion, TOP, GETDATE) — these are the hard migration items.✓ Kopiert
    → Migration-risk list

Ergebnis: A stored-procedure migration plan grounded in real counts.

Fallstricke
  • Some procs contain dynamic SQL that's hard to classify — Flag any proc with EXEC sp_executesql for manual review
Kombinieren mit: filesystem

Kombinationen

Mit anderen MCPs für 10-fache Wirkung

dbhub + antv-chart

Run SQL then chart the result directly

Query weekly revenue from the Postgres replica via DBHub, then render as an AntV line chart.✓ Kopiert
dbhub + filesystem

Save queries + results for reproducibility

Run the weekly KPI query, save SQL to /sql/weekly.sql and result CSV to /data/weekly-<date>.csv.✓ Kopiert
dbhub + notion

Post a SQL-backed report to Notion

Run the top-customers query, create a Notion page with the result as a table.✓ Kopiert

Werkzeuge

Was dieses MCP bereitstellt

WerkzeugEingabenWann aufrufenKosten
list_databases First exploration step free
list_tables database? Catalog before queries free
describe_table table, schema? Inspect schema before querying free
execute_sql sql, params? Read or write SQL (write requires flag) depends on query
execute_read_sql sql, params? Explicit read-only execution depends

Kosten & Limits

Was der Betrieb kostet

API-Kontingent
Bounded by your DB connection limits
Tokens pro Aufruf
Depends on result size; cap with LIMIT
Kosten in €
Free — costs are your DB hosting only
Tipp
Set a statement_timeout in the DSN; AI-written queries can be enthusiastic about full scans.

Sicherheit

Rechte, Secrets, Reichweite

Minimale Scopes: SELECT on target tables
Credential-Speicherung: DSN in env (DSN or per-flavor env var)
Datenabfluss: Direct to your DB; no third-party proxy
Niemals gewähren: CREATE/DROP/ALTER in the connection role unless needed for the session

Fehlerbehebung

Häufige Fehler und Lösungen

Authentication failed / access denied

DSN credentials wrong or lacking SELECT. Recheck DSN format for each flavor.

Prüfen: Connect with the DB's native client using the same DSN
Unsupported SQL feature / syntax error

Flavor mismatch — tell Claude which DB dialect is active, or re-check the DSN prefix.

Connection pool exhausted

Lower concurrency or increase pool size; long-running queries are usually the real cause.

Writes rejected (read-only)

DBHub is in default read-only. Restart with --readonly=false for this session.

Alternativen

DBHub vs. andere

AlternativeWann stattdessenKompromiss
Postgres MCPYou only use Postgres; deeper Postgres-specific featuresSingle-flavor
MongoDB MCPYou need Mongo alongside relationalDifferent data model
Supabase MCPYou're on Supabase and want project+DB managementTied to Supabase

Mehr

Ressourcen

📖 Offizielle README auf GitHub lesen

🐙 Offene Issues ansehen

🔍 Alle 400+ MCP-Server und Skills durchsuchen