mcpField
S
sqlfmt-mcp

sqlfmt-mcp

Local
github.com/MukundaKattaDeveloper Tools0Updated 20w ago

About sqlfmt-mcp

sqlfmt-mcp is an MCP server for producing consistent SQL formatting across 19 dialects. It is intended for coding agents and downstream tools that need stable SQL output for review and diffs.

Key features

  1. 01Format SQL for 19 dialects
  2. 02Choose keyword case and indentation
  3. 03List supported dialects

Use cases

  1. 01Standardize SQL in code reviews
  2. 02Format queries before generating diffs

MCP support

Exposes `format_sql` and `list_dialects` tools to MCP clients. The tools format SQL and report supported dialects.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"mukundakatta-sqlfmt": {
"command": "npx",
"args": [
"-y",
"@mukundakatta/sqlfmt-mcp"
]
}
}
}
Run commandnpx -y @mukundakatta/sqlfmt-mcp

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm@mukundakatta/sqlfmt-mcp0.1.0

Tools

2

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
sqlstringYesRaw SQL to format.
dialectenumNoGeneric 'sql' covers most ANSI cases; pick specifically for dialect-only syntax.sql | bigquery | db2 | db2i | duckdb | hive | mariadb | mysql | n1ql | plsql | postgresql | redshift | singlestoredb | snowflake | spark | sqlite | tidb | transactsql | trino
use_tabsbooleanNo
tab_widthintegerNo
keyword_caseenumNopreserve | upper | lower

Details

From the project README

@mukundakatta/sqlfmt-mcp

MCP server for deterministic SQL formatting across 19 dialects.

Tools

  • format_sql(sql, dialect?, keyword_case?, tab_width?, use_tabs?) — format with the named dialect (default sql for ANSI). Returns formatted text + line count.
  • list_dialects() — return the list of supported dialects so an LLM can confirm before formatting.

Why this exists

LLMs format SQL inconsistently across turns: same query, different indentation, different keyword casing. Code-review agents and downstream tooling that diffs SQL want one canonical form. Wrapping the well-tested sql-formatter library here gives you that.

Supported dialects

sql, bigquery, db2, db2i, duckdb, hive, mariadb, mysql, n1ql, plsql, postgresql, redshift, singlestoredb, snowflake, spark, sqlite, tidb, transactsql, trino.

Install — Claude Desktop

{
  "mcpServers": {
    "sqlfmt": { "command": "npx", "args": ["-y", "@mukundakatta/sqlfmt-mcp"] }
  }
}

Same shape for Cursor / Cline / Windsurf / Zed.

License

MIT OR Apache-2.0.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.