mcp-server-sql-analyzer

j4c0bs/mcp-server-sql-analyzer

3.5

If you are the rightful owner of mcp-server-sql-analyzer and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

A Model Context Protocol (MCP) server that provides SQL analysis, linting, and dialect conversion capabilities using SQLGlot.

Tools

Functions exposed to the LLM to take actions

lint_sql

Lint SQL query and return syntax errors

Some syntax errors are not detected by the parser like trailing commas

Args: sql: SQL query to analyze dialect: Optional SQL dialect (e.g., 'mysql', 'postgres')

Returns: error message or "No syntax errors" if parsing succeeds

transpile_sql

Transpile SQL statement to another dialect

Args: sql: SQL statement to transpile read_dialect: SQL dialect to read from write_dialect: SQL dialect to write to

Returns: transpiled SQL or syntax error

get_all_table_references

Extract table and CTE names from SQL statement

Args: sql: SQL statement to analyze dialect: Optional SQL dialect (e.g., 'mysql', 'postgres') Returns: JSON object containing tables with catalog, database, and alias attributes CTEs are returned as "cte" type

get_all_column_references

Extract column references from SQL statement with table context

Args: sql: SQL statement to analyze dialect: Optional SQL dialect (e.g., 'mysql', 'postgres') Returns: JSON object containing column references with table context and any errors

Prompts

Interactive templates invoked by user choice

No prompts

Resources

Contextual data attached and managed by the client

list_sql_dialects

URI: dialects://all

MIME: text/plain

List all supported SQL dialects

Returns: list of supported SQL dialects