mcp -sql-analyzer
MCP server for SQL static analysis.
claude mcp add --transport stdio j4c0bs-mcp-server-sql-analyzer uvx --from git+https://github.com/j4c0bs/mcp-server-sql-analyzer.git mcp-server-sql-analyzer
How to use
This MCP server provides SQL analysis capabilities, including syntax linting, dialect conversion, and extraction of table/column references. Clients can use the provided tools to validate SQL, transpile between dialects (for example, MySQL to PostgreSQL), and inspect dependencies and references within a query. The server exposes four primary tools: lint_sql for syntax validation, transpile_sql for dialect conversion, get_all_table_references to enumerate table and CTE usage, and get_all_column_references to enumerate column references with their table context. To leverage these, connect via MCP protocol to the sql-analyzer server name and invoke the desired tool with the appropriate input SQL and optional dialects. This enables automated SQL verification and analysis within larger workflows or AI-assisted SQL authoring environments.
How to install
Prerequisites:
- Node.js installed (for general MCP tooling compatibility) or a Python environment capable of running UV/uvx as per your setup
- Access to the internet to install dependencies
Installation steps (recommended approach using uvx):
- Ensure uvx is installed (Python package runner used by MCP):
- With Python 3.8+ and pip available, install uvx via your environment's package manager or pip if applicable:
- pip install uvx (if available for your setup)
- Run the MCP server using the provided configuration (from the README example): uvx --from git+https://github.com/j4c0bs/mcp-server-sql-analyzer.git mcp-server-sql-analyzer
- With Python 3.8+ and pip available, install uvx via your environment's package manager or pip if applicable:
Alternative (if you prefer using uv):
- Clone the repository locally: git clone https://github.com/j4c0bs/mcp-server-sql-analyzer.git
- Run the server from the cloned directory using uv: uv --directory /path/to/mcp-server-sql-analyzer run mcp-server-sql-analyzer
Verification:
- Ensure the MCP client can connect to the sql-analyzer server name defined in your claude_desktop_config.json or equivalent config file.
- Validate that lint_sql, transpile_sql, get_all_table_references, and get_all_column_references respond with expected results for sample queries.
Additional notes
Tips and common considerations:
- When using lint_sql, provide the target dialect if known to improve accuracy (e.g., 'mysql' or 'postgres').
- For transpile_sql, ensure both read_dialect and write_dialect are specified to receive a valid transpiled query.
- The get_all_table_references and get_all_column_references tools return structured results including tables, aliases, and fully qualified names; these are useful for dependency analysis and query comprehension.
- If you encounter environment issues, verify that your uvx/uv installation is compatible with your Python environment and that network access to fetch the git repository is enabled.
- Dialect discovery can be queried via the dialects://all endpoint to enumerate supported dialects for use with the tools.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP