
SQL Analyzer
SQL static analysis, linting, and dialect conversion for your AI assistant, powered by SQLGlot.
Add to your client
Copy the config for your MCP client and paste it into its config file.
Paste into ~/Library/Application Support/Claude/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"
]
}
}
}Requires `uv` (the Python package runner). Install it from https://docs.astral.sh/uv/ if `uvx` is not found.
Step-by-step guides: Add to Claude Desktop · Add to Cursor · Add to Windsurf
Before you start
- uv / uvx (Astral) to run the server
- Python (server is implemented in Python)
About SQL Analyzer
An MCP server for SQL static analysis built on SQLGlot. It exposes tools to lint SQL syntax, transpile queries between dialects, and extract table and column references, plus a resource that lists all supported SQL dialects. It runs locally over stdio and requires no authentication or database connection — analysis is purely static.
Tools & capabilities (4)
lint_sqlValidates SQL query syntax and returns any errors. Inputs: sql (string), dialect (string, optional). Returns a ParseResult with is_valid (boolean), message (string), and optional position (line and column of error).
transpile_sqlConverts SQL between different dialects. Inputs: sql (string), read_dialect (string, source dialect), write_dialect (string, target dialect). Returns a TranspileResult with is_valid (boolean), message (string), and sql (the transpiled SQL if successful).
get_all_table_referencesExtracts table and CTE references from SQL. Inputs: sql (string), dialect (string, optional). Returns a TableReferencesResult with is_valid, message, and tables (list of references with type, catalog, database, table name, alias, and fully qualified name).
get_all_column_referencesExtracts column references with table context. Inputs: sql (string), dialect (string, optional). Returns a ColumnReferencesResult with is_valid, message, and columns (list of references with column name, table name, and fully qualified name).
What this server can do
SQL Analyzer provides tools for these capabilities — tap one to see every MCP server that does the same:
When to use it
- Validate generated SQL syntax before running or suggesting it
- Migrate queries between database systems (e.g., MySQL to PostgreSQL) via dialect transpilation
- Analyze table, CTE, and column dependencies in complex queries
- Discover which SQL dialects are supported for a given task
SQL Analyzer FAQ
Does it connect to my database?
No. The server performs static analysis of SQL text using SQLGlot. It does not connect to or query any database, and requires no credentials.
How do I discover supported dialects?
The server exposes a resource at dialects://all that returns a list of all supported SQL dialects for use in the tools.
Can I run it from a local clone instead of git?
Yes. The README documents a uv-based config using --directory /path/to/mcp-server-sql-analyzer run mcp-server-sql-analyzer after cloning the repo, as an alternative to the recommended uvx install.
Alternatives to SQL Analyzer
Compare all alternatives →Google's official MCP server with prebuilt BigQuery tools, querying datasets via Application Default Credentials.
Create, manage, and query your InstantDB apps, schemas, permissions, and data from your AI editor.
Compare SQL Analyzer with: