
Database
This is a static analysis toolkit for SQL that doesn't touch your actual database. It gives Claude five tools: sql_format for prettifying queries, sql_explain for translating SQL into plain English with optimization hints, schema_analyze for parsing CREATE TABLE statements and generating Mermaid ER diagrams, query_build for generating SQL from natural language, and migration_generate for diffing two schemas and producing ALTER TABLE statements with rollback support. Useful when you're working with SQL in documentation, learning queries, or need quick schema visualization without spinning up a database connection. Supports MySQL, PostgreSQL, and SQLite syntax across all tools.
- tools
- 5
- transport
- STDIO
- last updated
- Mar 22, 2026
Tools
5 toolsPublic tool metadata for what this MCP can expose to an agent.
sql_formatFormat and prettify SQL queries with proper indentation, uppercased keywords, and aligned columns. Supports MySQL, PostgreSQL, and SQLite syntax.
Format and prettify SQL queries with proper indentation, uppercased keywords, and aligned columns. Supports MySQL, PostgreSQL, and SQLite syntax.
No parameter schema in public metadata yet.
sql_explainTake a SQL query and explain what it does in plain English, step by step. Identifies query type, tables, columns, conditions, and provides optimization tips.
Take a SQL query and explain what it does in plain English, step by step. Identifies query type, tables, columns, conditions, and provides optimization tips.
No parameter schema in public metadata yet.
schema_analyzeParse CREATE TABLE statements to extract tables, columns, types, constraints, foreign keys, and indexes. Generates an ER diagram in Mermaid format.
Parse CREATE TABLE statements to extract tables, columns, types, constraints, foreign keys, and indexes. Generates an ER diagram in Mermaid format.
No parameter schema in public metadata yet.
query_buildBuild SQL queries from natural language descriptions. Supports common patterns like filtering by date, aggregation, joins, ordering, and pagination.
Build SQL queries from natural language descriptions. Supports common patterns like filtering by date, aggregation, joins, ordering, and pagination.
No parameter schema in public metadata yet.
migration_generateCompare two schemas (old vs new CREATE TABLE statements) and generate ALTER TABLE migration statements. Produces both up (forward) and down (rollback) migrations.
Compare two schemas (old vs new CREATE TABLE statements) and generate ALTER TABLE migration statements. Produces both up (forward) and down (rollback) migrations.
No parameter schema in public metadata yet.
Sponsors
Readme
mcp-database-tools
MCP server providing SQL and database tools for AI agents. All analysis is performed on SQL text — no actual database connection required.
Tools
sql_format
Format and prettify SQL queries with proper indentation, uppercased keywords, and aligned columns. Supports MySQL, PostgreSQL, and SQLite syntax.
sql_explain
Take a SQL query and explain what it does in plain English, step by step. Identifies query type, tables, columns, conditions, and provides optimization tips.
schema_analyze
Parse CREATE TABLE statements to extract tables, columns, types, constraints, foreign keys, and indexes. Generates an ER diagram in Mermaid format.
query_build
Build SQL queries from natural language descriptions. Supports common patterns like filtering by date, aggregation, joins, ordering, and pagination.
migration_generate
Compare two schemas (old vs new CREATE TABLE statements) and generate ALTER TABLE migration statements. Produces both up (forward) and down (rollback) migrations.
Installation
npm install
npm run build
Usage
With Claude Desktop
Add to your Claude Desktop config (claude_desktop_config.json):
Details
- Repository
- github.com/rog0x/mcp-database-tools
- Category
- Databases
- Package
@rog0x/mcp-database-tools- Transport
- STDIO
- Registry
- MCP registry, active