A Model Context Protocol (MCP) server that provides SQL analysis, linting, and fixing capabilities using [SQLFluff](https://sqlfluff.com/).
Sqlfluff MCP server exists for a simple reason — assistants are far more useful when they can act on Sqlfluff directly instead of describing what you should do. A Model Context Protocol (MCP) server that provides SQL analysis, linting, and fixing capabilities using SQLFluff.
The sqlfluff MCP server provides tools for analyzing and working with SQL queries. It helps with:
The server ships on npm as @modelcontextprotocol/inspector, so your MCP client can launch it on demand — there is no separate build step. Add the server block to your client's configuration, restart it, and the tools register themselves.
Once Sqlfluff is connected, these are the calls the assistant has available:
Inputs — - sql (string): SQL query to analyzeReturns — - List of linting results, each containing:start_line_no — Line number where the issue startsstart_line_pos — Position in the line where the issue startscode — Error codedescription — Description of the issuename — Name of the linting rulewarning — Whether it's a warning or an errorfixes — List of possible fixesstart_file_pos — Start position in the fileend_line_no — Line number where the issue endsend_line_pos — Position in the line where the issue endsThis sits in the database access group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. Sqlfluff's toolset — Inputs, Returns, start_line_no and 10 more — is a fair guide to whether it matches your workflow. It is maintained by antoprince001; worth a glance at recent repository activity before you build anything load-bearing on it.
This entry was verified against Sqlfluff's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.
| Tool | What it does |
|---|---|
| Inputs | - sql (string): SQL query to analyze. |
| Returns | - List of linting results, each containing: |
| start_line_no | Line number where the issue starts |
| start_line_pos | Position in the line where the issue starts |
| code | Error code |
| description | Description of the issue |
| name | Name of the linting rule |
| warning | Whether it's a warning or an error |
| fixes | List of possible fixes |
| start_file_pos | Start position in the file |
| end_line_no | Line number where the issue ends |
| end_line_pos | Position in the line where the issue ends |
| end_file_pos | End position in the file |
{
"mcpServers": {
"server-sqlfluff": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/inspector"]
}
}
}Add to claude_desktop_config.json, then restart Claude Desktop.
Read-only SQL access to Postgres — let your assistant inspect schemas and answer questions from real data.
Manage your whole Supabase project in conversation — database, auth, storage, Edge Functions and branches.
Query, modify and analyse local SQLite databases in conversation — the fastest way to chat with a data file.
Metabase ships its own MCP endpoint — search your BI content, build and run queries, and save questions and dashboards without leaving the chat.
Official MongoDB server covering data, schemas and Atlas management — from find queries to spinning up clusters.
Serverless Postgres with database branching — point your assistant at Neon and let it work on disposable copies.