/ Annuaire / Playground / db-mcp-server
● Communauté FreePeak ⚡ Instantané

db-mcp-server

par 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).

Pourquoi l'utiliser

Fonctionnalités clés

Démo en direct

Aperçu en pratique

db.replay ▶ prêt
0/0

Installer

Choisissez votre client

~/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
    }
  }
}

Ouvrez Claude Desktop → Settings → Developer → Edit Config. Redémarrez après avoir enregistré.

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

Cursor utilise le même schéma mcpServers que Claude Desktop. La config projet l'emporte sur la globale.

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

Cliquez sur l'icône MCP Servers dans la barre latérale Cline, puis "Edit Configuration".

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

Même format que Claude Desktop. Redémarrez Windsurf pour appliquer.

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

Continue utilise un tableau d'objets serveur plutôt qu'une map.

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

Ajoutez dans context_servers. Zed recharge à chaud à la sauvegarde.

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

Une seule ligne. Vérifiez avec claude mcp list. Supprimez avec claude mcp remove.

Cas d'usage

Usages concrets : db-mcp-server

Run cross-database analysis from Claude

👤 Data engineers ⏱ ~25 min intermediate

Quand l'utiliser : You need to pull from Postgres (app) AND MySQL (legacy) in one conversation without switching tools.

Prérequis
  • config.json with both connections — Repo docs show the shape; store credentials in env refs, not inline
Déroulement
  1. Start the server
    Run ./bin/server -t sse -c config.json and confirm both connections come up.✓ Copié
    → 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.✓ Copié
    → Combined dataset

Résultat : Cross-system insights without a data warehouse.

Pièges
  • Read-only assumption breaks — agent runs INSERTs — Use DB-level read-only users per connection; don't rely on agent discipline
Combiner avec : google-sheets

Manage TimescaleDB hypertables from Claude

👤 Observability / IoT teams ⏱ ~20 min advanced

Quand l'utiliser : You want to create/inspect hypertables and continuous aggregates without memorizing Timescale DDL.

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

Résultat : Timescale ops in minutes, not Google searches.

Explain an unfamiliar schema to get onboarded fast

👤 Engineers inheriting a database ⏱ ~30 min beginner

Quand l'utiliser : Day 1 at a new team; you need a map of the DB.

Déroulement
  1. Dump schema
    Use schema_<conn_id> on prod. Return tables, FK graph, and row-count order.✓ Copié
    → 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).✓ Copié
    → Onboarding cheat sheet

Résultat : Working mental model in 30 min.

Combinaisons

Associez-le à d'autres MCPs pour un effet X10

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.✓ Copié

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.✓ Copié

Outils

Ce que ce MCP expose

OutilEntréesQuand appelerCoût
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

Coût et limites

Coût d'exécution

Quota d'API
Your DBs' capacity
Tokens par appel
Large result sets burn tokens fast — LIMIT aggressively
Monétaire
Free MCP; DB hosting costs are yours
Astuce
Always add LIMIT / cap output; stream to a file via filesystem MCP for bigger pulls

Sécurité

Permissions, secrets, portée

Portées minimales : DB-level read-only user recommended for exploration
Stockage des identifiants : config.json references env vars; never commit with inline passwords
Sortie de données : Only to configured DB hosts
Ne jamais accorder : DB superuser to the MCP connection unless absolutely needed

Dépannage

Erreurs courantes et correctifs

Connection pool exhausted

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

Vérifier : 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

Alternatives

db-mcp-server vs autres

AlternativeQuand l'utiliserCompromis
postgres-mcp (official)You only need PostgresSingle-DB
mysql-mcp (community)You only need MySQLSingle-DB

Plus

Ressources

📖 Lire le README officiel sur GitHub

🐙 Voir les issues ouvertes

🔍 Parcourir les 400+ serveurs MCP et Skills