mcp-database-tools
mcp-database-tools
Servidor MCP que proporciona herramientas SQL y de base de datos para agentes de IA. Todo el análisis se realiza sobre texto SQL; no se requiere conexión real a la base de datos.
Herramientas
sql_format
Formatea y embellece consultas SQL con sangría adecuada, palabras clave en mayúsculas y columnas alineadas. Admite sintaxis de MySQL, PostgreSQL y SQLite.
sql_explain
Toma una consulta SQL y explica qué hace en lenguaje sencillo, paso a paso. Identifica el tipo de consulta, tablas, columnas, condiciones y proporciona consejos de optimización.
schema_analyze
Analiza sentencias CREATE TABLE para extraer tablas, columnas, tipos, restricciones, claves foráneas e índices. Genera un diagrama ER en formato Mermaid.
query_build
Construye consultas SQL a partir de descripciones en lenguaje natural. Admite patrones comunes como filtrado por fecha, agregación, uniones, ordenamiento y paginación.
migration_generate
Compara dos esquemas (sentencias CREATE TABLE antiguas vs nuevas) y genera sentencias de migración ALTER TABLE. Produce migraciones tanto hacia arriba (avance) como hacia abajo (reversión).
Related MCP server: MCP Data Analyst
Instalación
npm install
npm run buildUso
Con Claude Desktop
Agrega a tu configuración de Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"database-tools": {
"command": "node",
"args": ["path/to/mcp-database-tools/dist/index.js"]
}
}
}Independiente
npm startDesarrollo
npm run build # Compile TypeScript
npm start # Run the serverLicencia
MIT
Available Tools
5 toolsmigration_generateA
Compare two schemas (old vs new CREATE TABLE statements) and generate ALTER TABLE migration statements with both up and down migrations.
Inputs: new_schema (required), old_schema (required), dialect.
query_buildC
Build SQL queries from natural language descriptions. Example: "get all users who signed up this month and have at least 3 orders" generates the corresponding SQL.
Inputs: description (required), dialect, schema_hint.
schema_analyzeA
Parse CREATE TABLE statements to extract tables, columns, types, constraints, foreign keys, and indexes. Generates an ER diagram in Mermaid format.
Inputs: sql (required).
sql_explainA
Take a SQL query and explain what it does in plain English, step by step. Identifies tables, columns, conditions, and provides optimization tips.
Inputs: sql (required).
sql_formatA
Format and prettify SQL queries with proper indentation, uppercased keywords, and aligned columns. Supports MySQL, PostgreSQL, and SQLite syntax.
Inputs: sql (required), dialect, uppercase, indent_size, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool addresses a distinct aspect of database work: formatting, natural language query building, explaining SQL, schema analysis, and migration generation. No two tools overlap in purpose, making selection unambiguous.
All tool names follow a consistent '<domain>_<action>' pattern (e.g., sql_format, schema_analyze), with noun-first ordering and snake_case throughout. This creates a predictable and readable convention.
With 5 tools, the set is concise and well-scoped for a database utility server. Each tool covers a core workflow (format, build, explain, analyze, migrate) without redundancy or bloat.
The tool set covers the full lifecycle of SQL development: creating/formatting queries, building from natural language, understanding, analyzing schema, and generating schema migrations. No critical gaps are apparent for the stated purpose.
Related MCP Connectors
Query Postgres, MySQL, SQL Server, Oracle, BigQuery, ClickHouse and Redshift from your AI client.
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.
Deterministic safety, correctness & cost gate that vets Postgres SQL before your AI agent runs it.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to query databases using natural language, with automatic schema discovery and SQL compilation.4,182 npm3,243Apache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables natural language querying of SQL databases using AI, supporting multiple database types and automatic schema discovery.1MIT
- FlicenseAqualityCmaintenanceEnables AI agents to interact with PostgreSQL or MySQL databases using natural language. Supports SQL queries, schema discovery, and pre-built aggregations without writing SQL.3-
- FlicenseNot gradedqualityAmaintenanceEnables LLM agents to connect to multiple database types, retrieve normalized schemas, and execute optimized SQL queries through a unified API.-