Validates SQL query syntax and returns any errors
Converts SQL between different dialects
Extracts table and CTE references from SQL
Extracts column references with table context
SQL Analyzer provides powerful tools for working with SQL queries across different database dialects. It leverages SQLGlot to offer syntax validation, linting, dialect conversion, and comprehensive analysis of table and column references. This MCP server enhances Claude's ability to work with SQL by ensuring queries are valid before suggesting them to users, converting between dialects accurately, analyzing complex query structures, and maintaining compatibility with database-specific features. It's an essential tool for anyone working with SQL across multiple database systems.
SQL Analyzer is a Model Context Protocol (MCP) server that provides comprehensive SQL analysis capabilities powered by SQLGlot. It helps with validating SQL syntax, converting queries between different database dialects, and analyzing table and column relationships within queries.
This server enhances Claude's ability to work with SQL by:
Add the following configuration to your claude_desktop_config.json
:
{
"mcpServers": {
"sql-analyzer": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/j4c0bs/mcp-server-sql-analyzer.git",
"mcp-server-sql-analyzer"
]
}
}
}
After cloning the repository, add this to your claude_desktop_config.json
:
{
"mcpServers": {
"sql-analyzer": {
"command": "uv",
"args": [
"--directory",
"/path/to/mcp-server-sql-analyzer",
"run",
"mcp-server-sql-analyzer"
]
}
}
}
Once installed, Claude can use the SQL Analyzer tools to help with various SQL-related tasks. You can ask Claude to:
To discover all supported SQL dialects, use the following resource:
dialects://all
This will return a list of all supported SQL dialects that can be used with the tools.
For the best experience, update your personal preferences in Claude Desktop settings to request that generated SQL is first validated using the lint_sql
tool. This ensures that any SQL Claude provides is syntactically correct for your target database system.