Sqlfluff MCP Server

A Model Context Protocol (MCP) server that provides SQL analysis, linting, and fixing capabilities using [SQLFluff](https://sqlfluff.com/).

Local serverstdio

What is the Sqlfluff MCP Server?

A Model Context Protocol (MCP) server that provides SQL analysis, linting, and fixing capabilities using SQLFluff.

What you get

The sqlfluff MCP server provides tools for analyzing and working with SQL queries. It helps with:

Recorded tools

  • 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

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
Inputs:sql (string): SQL query to parse.
dialectstring, optional): SQL dialect (e.g., 'mysql', 'postgresql').
Returns:Parsed tree as a string.
start_line_noLine number where the issue starts
start_line_posPosition in the line where the issue starts
codeError code
warningWhether it's a warning or an error
fixesList of possible fixes
start_file_posStart position in the file
end_line_noLine number where the issue ends
end_line_posPosition in the line where the issue ends
end_file_posEnd position in the file

How to install the Sqlfluff MCP Server

{
  "mcpServers": {
    "mcp-server-sqlfluff": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/antoprince001/mcp-server-sqlfluff.git",
        "mcp-server-sqlfluff"
      ]
    }
  }
}

From the project documentation. Replace placeholders and example paths before connecting.

Example prompts to try

  • “Use Sqlfluff to Inputs.”
  • “Use Sqlfluff to Returns.”
  • “Use Sqlfluff to start line no.”

Frequently asked questions

A Model Context Protocol (MCP) server that provides SQL analysis, linting, and fixing capabilities using [SQLFluff](https://sqlfluff.com/). Confirm the tools offered by your installed version in the connected client. Tool availability and permissions depend on the server and account configuration.