SQLFluff MCP Server
About
MCP server exposing SQLFluff's lint/fix/parse over the Model Context Protocol
Details
- Author
- gswartwood
- Categories
- Database
Jump to
Setup
Install SQLFluff MCP Server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/gswartwood/sqlfluff-mcp-server
Follow the installation instructions in the repository README, then restart your MCP client.
AnMCPserver that exposesSQLFluff's linting, fixing, and parsing over the Model Context Protocol, so any MCP-aware client (Claude, other agents, IDE integrations) can lint and fix SQL directly.
This project is independent of the SQLFluff maintainers — it's a thin wrapper around the publicsqlfluffPython package.
The_filetools honor project config the same way thesqlfluffCLI does (viaFluffConfig.from_path, which walks up the directory tree looking for.sqlfluff,pyproject.toml,setup.cfg, ortox.ini). The_sqltools are for content that hasn't been written to disk (e.g. streamed from an editor buffer) and require you to passdialectexplicitly since there's no file location to resolve config from.
SQLFluff caches the contents of config files it reads while walking a directory tree, for the lifetime of the process. Because this server is long-running (unlike thesqlfluffCLI, which is a fresh process per invocation), editing a.sqlflufffile after the server has started won't be picked up bylint_file/fix_file/parse_fileuntil you callclear_config_cache. Call it whenever config on disk changes, or just proactively before a lint/fix/parse call if you're unsure.
- Python 3.10+
- uv(recommended) orpipx/pip
- mcp>=2.0.0,<3.0.0 andsqlfluff>=3.0.0 (installed automatically as dependencies — seeNotes on dependencies)
This package is published onPyPI, so there's nothing to clone or install ahead of time. Point your MCP client's config (e.g..claude.json/.mcp.jsonfor Claude Code, or Claude Desktop's config file) at it viauvx, and it's fetched into an isolated cache and launched on demand:
{ "mcpServers": { "sqlfluff": { "command": "uvx", "args": ["sqlfluff-mcp-server"] } } }
Nouv?pipx run sqlfluff-mcp-serveras thecommand/argsworks the same way.
For stdio-based servers like this one, the client itself launches the process — automatically, when the client session starts, not when a prompt first needs it. Once it's registered, just ask the client to lint or fix a SQL file; the server is already running in the background and the tools are already available. If the server process crashes, the client restarts it for you.
Running it manually (for local testing/debugging)
This starts the server over stdio and blocks, waiting for an MCP client to speak the protocol to it on stdin/stdout — it's not something you'd run interactively day to day, just useful for sanity-checking the install or piping through theMCP Inspector.
Clone the repo to work on the server itself (rather than just consuming it viauvx):
git clone <this-repo-url> cd sqlfluff-mcp-server uv sync --extra dev uv run pytest uv run ruff check .
To point an MCP client at your local checkout instead of the PyPI release (e.g. to test unreleased changes):
{ "mcpServers": { "sqlfluff": { "command": "uv", "args": ["--directory", "/path/to/sqlfluff-mcp-server", "run", "sqlfluff-mcp-server"] } } }
- mcpis pinned to>=2.0.0,<3.0.0. The SDK's 2.0 line renamedmcp.server.fastmcp.FastMCPtomcp.server.mcpserver.MCPServerand moved transport selection torun(transport=...); the@mcp.tool()decorator API is unchanged.
- sqlfluffis left unpinned above3.0.0— SQLFluff releases fairly often and this server only depends on its stableLinter/FluffConfigAPI.
Official Airtable MCP server and skills for working with bases, records, workflows, and business operations from AI agents.
MCP Server For Apache Doris, an MPP-based real-time data warehouse.
Official MCP Server from Atlan which enables you to bring the power of metadata to your AI tools
Query Onchain data, like ERC20 tokens, transaction history, smart contract state.
Read and write access to your Baserow tables.
Introspect and query your apps deployed to Convex.
Interact with the data stored in Couchbase clusters using natural language.
Maritime intelligence for tracking vessels, analysing ports, and exploring ship data.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



