by FreePeak
A powerful multi-database server implementing the Model Context Protocol (MCP) to provide AI assistants with structured access to databases.
# Add to your Claude Code skills
git clone https://github.com/FreePeak/db-mcp-serverGuides for using ai agents skills like db-mcp-server.
Last scanned: 5/24/2026
{
"issues": [],
"status": "PASSED",
"scannedAt": "2026-05-24T07:23:37.891Z",
"semgrepRan": false,
"npmAuditRan": true,
"pipAuditRan": true
}db-mcp-server is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by FreePeak. A powerful multi-database server implementing the Model Context Protocol (MCP) to provide AI assistants with structured access to databases. It has 480 GitHub stars.
Yes. db-mcp-server passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
Clone the repository with "git clone https://github.com/FreePeak/db-mcp-server" and add it to your Claude Code skills directory (see the Installation section above).
db-mcp-server is primarily written in Go. It is open-source under FreePeak on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh db-mcp-server against similar tools.
No comments yet. Be the first to share your thoughts!
From $49 · 30 days · terms & refunds
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM is an informational directory and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
Automated security scan — not a certification.
The DB MCP Server provides a standardized way for AI models to interact with multiple databases simultaneously. Built on the FreePeak/cortex framework, it enables AI assistants to execute SQL queries, manage transactions, explore schemas, and analyze performance across different database systems through a unified interface.
Unlike traditional database connectors, DB MCP Server can connect to and interact with multiple databases concurrently:
{
"connections": [
{
"id": "mysql1",
"type": "mysql",
"host": "localhost",
"port": 3306,
"name": "db1",
"user": "user1",
"password": "password1"
},
{
"id": "postgres1",
"type": "postgres",
"host": "localhost",
"port": 5432,
"name": "db2",
"user": "user2",
"password": "password2"
},
{
"id": "oracle1",
"type": "oracle",
"host": "localhost",
"port": 1521,
"service_name": "XEPDB1",
"user": "user3",
"password": "password3"
}
]
}
For each connected database, the server automatically generates specialized tools:
// For a database with ID "mysql1", these tools are generated:
query_mysql1 // Execute SQL queries
execute_mysql1 // Run data modification statements
transaction_mysql1 // Manage transactions
schema_mysql1 // Explore database schema
performance_mysql1 // Analyze query performance
The server follows Clean Architecture principles with these layers:
--lazy-loading flag)read_only enforcement (blocks writes through both query_* and execute_* tools), max_rows result truncation with explicit notices, and per-query timeoutsProtect agent sessions against runaway queries and accidental writes:
| Setting | Scope | Effect |
|---|---|---|
"read_only": true |
per database | Blocks write statements (INSERT, UPDATE, DELETE, DDL, data-modifying CTEs, stacked writes) through both query and execute tools, and enforces rejection at the database engine itself on PostgreSQL/TimescaleDB (default_transaction_read_only=on) and MySQL (transaction_read_only=1); SQLite opens mode=ro. Classification strips comments and string literals and defaults to deny for unrecognized statements. |
"max_rows": 1000 |
per database | Truncates result sets at N rows and appends an explicit [Truncated] notice so the model knows to refine its query instead of losing context. 0 (default) means unlimited. |
"masking_rules": [...] |
per database | Masks values of result columns whose name matches a rule's regex before they leave the server — applies to every query shape including SELECT *. Strategies: "fixed_string" (replace with value), "null", and "partial" (keep_last trailing characters visible; shorter values fully masked). First matching rule wins; invalid patterns or unknown strategies abort config load (fail closed); masked-cell counts are reported in the result footer. Renaming a column with an alias bypasses name matching by design. See docs/design/column-masking-scoping.md. |
"mask_pii": true |
per database | Redacts PII in query results by content shape, not just column name: emails, phone numbers, credit-card numbers (Luhn-checked), SSNs, IPv4 addresses and 19+ digit identifiers are replaced with [EMAIL]/[PHONE]/[CREDIT_CARD]/[SSN]/[IP_ADDRESS]/[LONG_NUMBER] wherever they appear — including inside free-text columns no rule covers. Column names like email/card_number/iban are redacted whole. Operator-controlled: once set, an agent cannot turn it off (the per-query mask_pii parameter is additive only). Composes with masking_rules. |
"query_timeout": 30 |
per database | Cancels statements that exceed the timeout in seconds; enforced at the repository layer for every tool (queries, statements, transactions, explain, schema inspection). Unset defaults to 30s; -1 disables. Env-only deployments can set QUERY_TIMEOUT_SECONDS to fill connections without an explicit value (JSON keeps precedence). |
| DB_MCP_AUDIT_LOG=/path/audit.jsonl | process | Appends one JSONL record per executed statement — timestamp, op (query/execute/tx_*), database, statement (capped at 10k chars), duration, error. Includes rejected attempts against read-only databases. Best-effort writes never fail a query; file is created with 0600. |
Defense in depth: read-only is enforced in three layers — application classifier, engine session defaults, and (recommended) least-privilege database users. Oracle currently relies on the classifier plus user privileges.
| Database | Status | Features |
|---|---|---|
| MySQL | ✅ Full Support | Queries, Transactions, Schema Analysis, Performance Insights |
| PostgreSQL | ✅ Full Support (v9.6-17) | Queries, Transactions, Schema Analysis, Performance Insights |
| SQLite | ✅ Full Support | File-based & In-memory databases, SQLCipher encryption support |
| Oracle | ✅ Full Support (10g-23c) | Queries, Transactions, Schema Analysis, RAC, Cloud Wallet, TNS |
| TimescaleDB | ✅ Full Support | Time-Series Queries, Hypertable Discovery (write policies via SQL) |
The safest local integration is STDIO. HTTP transports are still under hardening; do not expose the current server directly to a shared network.
# Build from the audited source revision
make build
# Use a private, single-connection config
./bin/server -t stdio -c /absolute/path/to/config.local.json
For Cursor, point the client at the actual build output and use absolute paths:
{
"mcpServers": {
"local-db": {
"command": "/absolute/path/to/db-mcp-server/bin/server",
"args": ["-t", "stdio", "-c", "/absolute/path/to/config.local.json"]
}
}
}
Use a read-only database account and a bounded query_timeout for a personal
PostgreSQL/MySQL connection. For SQLite, use an absolute database_path and
"read_only": true when the agent only needs to inspect data.
The historical Cortex SSE transport has no built-in authentication. It is disabled by default and must only be enabled explicitly behind a trusted private reverse proxy:
./bin/server -t sse -h 127.0.0.1 -p 9092 \
-allow-insecure-sse -c /absolute/path/to/config.local.json
Do not use this mode for a shared deployment. The legacy endpoint does not
apply DB_MCP_API_KEY; terminate TLS, authentication, and network policy at the
proxy. A future release will replace it with a maintained Streamable HTTP
implementation.
The streamable endpoint is backed by the maintained Go MCP SDK and supports
stateful sessions, JSON or SSE responses, notifications, GET/DELETE session
lifecycle, and JSON-RPC dispatch. The process refuses to start it without
DB_MCP_API_KEY; keep it