A Model Context Protocol (MCP) server that offers SQL linting, dialect conversion and static-analysis utilities powered by SQLGlot.
https://github.com/j4c0bs/mcp-server-sql-analyzerYou're deep in a migration from MySQL to PostgreSQL, and that complex analytics query you wrote months ago is throwing cryptic syntax errors. Sound familiar? Or maybe you're building queries for multiple database systems and constantly context-switching between dialect-specific quirks.
The mcp-server-sql-analyzer eliminates these daily frustrations by bringing SQLGlot's powerful parsing and transpilation capabilities directly into your Claude workflow through MCP.
Every developer working with SQL faces the same recurring problems:
This MCP server turns these time sinks into instant, automated operations within your existing Claude conversations.
Instant SQL Validation - The lint_sql tool catches syntax errors before you even run your query. No more round trips to your database just to discover a missing comma.
-- This gets validated instantly:
SELECT user_id, COUNT(*) as total
FROM users u
JOIN orders o ON u.id = o.user_id
WHERE created_at > '2024-01-01'
GROUP BY user_id
HAVING total > 5
Effortless Dialect Conversion - The transpile_sql tool handles the heavy lifting of converting queries between database systems. MySQL to PostgreSQL, BigQuery to Snowflake - it understands the nuances.
Deep Query Analysis - Extract every table and column reference from complex queries with get_all_table_references and get_all_column_references. Perfect for understanding legacy queries or building automated documentation.
Comprehensive Dialect Support - Works with all major SQL dialects through SQLGlot's extensive parsing engine.
Database Migration Projects: You're migrating from MySQL to PostgreSQL. Instead of manually converting hundreds of queries and hoping for the best, you paste each query into Claude, ask for PostgreSQL conversion, and get validated, working SQL back instantly.
Multi-Database Applications: Building an analytics platform that needs to work with both Snowflake and BigQuery? Generate your base query in one dialect, then instantly get the equivalent for your other target systems.
Code Review and Analysis: Reviewing a PR with a complex query? Quickly extract all table dependencies and column references to understand the full impact and catch potential issues.
Query Optimization: Before optimizing a slow query, use the analysis tools to understand exactly which tables and columns are involved, making your optimization efforts more targeted.
This isn't another tool you need to remember to use. It plugs directly into Claude through MCP, making SQL validation and conversion part of your natural conversation flow.
Set up is straightforward with uvx - add the server to your Claude configuration and you're immediately getting validated SQL suggestions. The server even supports a helpful tip: configure Claude to automatically validate any SQL it generates using the lint_sql tool.
Most SQL linting tools require you to leave your development environment, learn new CLI commands, or install heavy IDE extensions. Database-specific validators only work for one system. SQLGlot is powerful but requires Python knowledge to use effectively.
This MCP server gives you SQLGlot's full capabilities through simple, conversational interactions. No context switching, no new tools to learn - just better SQL development integrated into how you already work.
The combination of instant validation, cross-dialect conversion, and deep query analysis in one lightweight server makes this a must-have addition to any SQL developer's toolkit. Your future self will thank you for the hours saved debugging syntax errors and manual dialect conversions.