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 487 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 lists this project for discovery 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 checks (best-effort, applied to both query_* and execute_* tools; use least-privilege database users for a hard guarantee), 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 | Best-effort defense in depth, not a security boundary. A textual check runs for both query and execute tools and rejects statements it does not recognize. Functions called from a SELECT may not be recognized, so the check can miss a write. Engine session defaults are a second layer, not a security boundary on their own: PostgreSQL/TimescaleDB sessions start with default_transaction_read_only=on, MySQL with transaction_read_only=1, and SQLite opens mode=ro. Oracle has no session-level read-only switch; the connector refuses to connect with credentials that hold write privileges. For strong guarantees, connect with a database account that only has SELECT privileges. |
"max_rows": 1000 |
per database | Truncates result sets at N rows and appends an explicit Truncated: showing first N rows (max_rows=N) notice so the model knows to refine its query instead of losing context. 0 (default) means unlimited. LIMIT max_rows+1 is added where the statement can be rewritten (PostgreSQL/TimescaleDB, MySQL, SQLite), so the database stops at the cap; otherwise the result is truncated after N rows. Select-list functions with side effects (for example nextval()) run for at most max_rows+1 rows. |
"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. masking_rules match the result column name returned by the database; mask_pii also detects common PII formats in values. 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, Luhn-valid card numbers, SSNs, IPv4 addresses and 19+ digit identifiers are replaced with [EMAIL]/[PHONE]/[CREDIT_CARD]/[SSN]/[IP_ADDRESS]/[LONG_NUMBER] when they appear as a whole pattern inside a single cell, including free-text columns. Best-effort: values split across columns, non-standard formats, and names or addresses are not detected, and masking runs after the database has returned the data. Columns named 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). |
"max_query_cost": 50000 |
per database | Denies a SELECT or WITH through the query tool when its EXPLAIN planner-cost estimate is above the limit. Explain with analyze=true is estimated first and refused above the limit. PostgreSQL, TimescaleDB and MySQL only; startup fails on other engines and on a negative value. An estimate that cannot be obtained or read denies the query. 0 (default) means off. A caller limit from an agent key or OIDC role can lower it further. See docs/governance.md. |
DB_MCP_API_KEY or DB_MCP_API_KEY_FILE |
process | Shared Bearer key for Streamable HTTP. Set exactly one source (flag, env or file); Streamable HTTP refuses to start without authentication. Calls with this key use the principal api-key. The key file is read once at startup. |
DB_MCP_OIDC_ISSUER + DB_MCP_OIDC_AUDIENCE |
process | OIDC bearer tokens on Streamable HTTP: discovery at startup, signature, issuer and audience checks, and the sub claim as the principal. When set, OIDC replaces the shared key. |
DB_MCP_API_SCOPES |
process | Scopes granted to the shared key (default db:read) and required on every request under OIDC, except that a roles file supplies each token's scopes instead. Each tool call also needs its own scope: db:read, db:write or db:admin. See Tool scopes. |
DB_MCP_AGENT_KEYS_FILE |
process | Per-agent keys: each agent gets a digest, an id (its audit principal), scopes and a database allowlist. Streamable HTTP only; cannot be combined with OIDC. Every agent key, "*" included, uses the unified tools only, so the server needs -unified-tools. |
DB_MCP_OIDC_ROLES_FILE |
process | Maps one token claim to a grant (scopes, databases, optional max_query_cost). The first matching role in file order applies; a token that matches no role is denied everything. Requires DB_MCP_OIDC_ISSUER and -unified-tools. |
DB_MCP_RESOURCE_URL |
process | Serves RFC 9728 protected resource metadata at /.well-known/oauth-protected-resource and adds a WWW-Authenticate challenge to /mcp 401 and 403 responses. Requires DB_MCP_OIDC_ISSUER. |
DB_MCP_AUDIT_LOG=/path/audit.jsonl |
process |