lint_sqlLABSCO SUMMARY
SQLFluff's own verdict on a query, instead of a model's opinion of it.
The answers are deterministic: lint_sql returns SQLFluff's rule codes and positions, and fix_sql returns SQL that SQLFluff itself produced. Pass the dialect and the check matches the database you are actually writing for, rather than generic SQL.
What it is
A server that runs SQLFluff over SQL you pass in: linting with rule names and positions, an auto-fixed version, and the parse tree.
What you get
- Syntax errors and rule violations with start and end position, error code, description, rule name and the fixes SQLFluff can apply (lint_sql)
- Problems a parser alone misses, trailing commas among them
- The corrected query returned as SQL you can paste back (fix_sql)
- The parse tree for a query, for when the problem is structural (parse_sql)
- A dialect argument on all three tools, plus a dialects://all resource listing every dialect supported
Requirements
uvx or uv. The published config runs it straight from the Git repository, so there is nothing to install first.
Setup effort
One command — uvx --from git+https://github.com/antoprince001/mcp-server-sqlfluff.git mcp-server-sqlfluff
USE CASES
Finding out why a query will not run
Lint it and read back the rule code, the description and the exact position of each problem.
Cleaning up SQL to match house style
Run the fixer and get corrected SQL back rather than a list of complaints.
Understanding how a long query is structured
Parse it and read the tree, so nesting and scope are visible.
Checking SQL written for one database against another
Lint the same statement under a different dialect and see what stops being valid.
3 tools
Listed in project docs. Your client may show a different list.
fix_sqlparse_sqlBEFORE YOU INSTALL
What to know first
Tools you get
3 tools named in the project's documentation.
INSTALLATION
Connect your client
Add the block to your client, or run the command directly.
Server setup
Configuration file
{
"mcpServers": {
"mcp-server-sqlfluff": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/antoprince001/mcp-server-sqlfluff.git",
"mcp-server-sqlfluff"
]
}
}
}uvx
uvx --from git+https://github.com/antoprince001/mcp-server-sqlfluff.git mcp-server-sqlfluff