● Сообщество
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).
Зачем использовать
Ключевые функции
- Multi-DB in one server — switch without restarting
- Per-connection auto-generated tools (e.g.
query_prod, schema_analytics) - TimescaleDB-native tools for time-series ops
- Oracle: 10g-23c, RAC, Cloud Wallet
Живое демо
Как выглядит на практике
Сценарии использования
Реальные сценарии: db-mcp-server
Когда использовать: 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
Поток
-
Start the server
Run ./bin/server -t sse -c config.json and confirm both connections come up.✓ Скопировано
→ Server logs 2 connections ok
-
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
Когда использовать: You want to create/inspect hypertables and continuous aggregates without memorizing Timescale DDL.
Поток
-
Inspect existing hypertables
List all hypertables in metrics DB with chunk interval and row count.✓ Скопировано
→ Table of hypertables
-
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.
Когда использовать: Day 1 at a new team; you need a map of the DB.
Поток
-
Dump schema
Use schema_<conn_id> on prod. Return tables, FK graph, and row-count order.✓ Скопировано
→ Schema + FK map
-
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 — эффект 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.✓ Скопировано
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.✓ Скопировано
Стоимость и лимиты
Во что обходится
- Квота 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 Postgres | Single-DB |
| mysql-mcp (community) | You only need MySQL | Single-DB |