MCP.so
Sign In

mcp-server-sql-analyzer

@j4c0bs

About mcp-server-sql-analyzer

MCP server for SQL static analysis.

Basic information

Category

Databases

License

MIT

Runtime

python

Transports

stdio

Publisher

j4c0bs

Config

Add this server to your MCP-compatible client using the configuration below.

{
  "mcpServers": {
    "mcp-server-sql-analyzer": {
      "command": "npx",
      "args": [
        "@modelcontextprotocol/inspector",
        "uv",
        "--directory",
        "/path/to/mcp-server-sql-analyzer",
        "run",
        "mcp-server-sql-analyzer"
      ]
    }
  }
}

Tools

8

sql (string): SQL query to analyze

ParseResult containing:

sql (string): SQL statement to transpile

TranspileResult containing:

sql (string): SQL statement to analyze

TableReferencesResult containing:

sql (string): SQL statement to analyze

ColumnReferencesResult containing:

Overview

What is mcp-server-sql-analyzer?

mcp-server-sql-analyzer is a Model Context Protocol (MCP) server that provides SQL analysis, linting, and dialect conversion using SQLGlot. It is designed for AI assistants like Claude to validate, convert, and analyze SQL queries.

How to use mcp-server-sql-analyzer?

Install the server by adding it to claude_desktop_config.json using uvx (recommended) or uv. Invoke its tools—lint_sql, transpile_sql, get_all_table_references, get_all_column_references—with SQL statements and optional dialect parameters.

Key features of mcp-server-sql-analyzer

  • SQL syntax validation and linting
  • Query conversion between different SQL dialects
  • Extract table references and dependencies
  • Identify column usage and relationships
  • Discover all supported SQL dialects

Use cases of mcp-server-sql-analyzer

  • Validate SQL syntax before suggesting queries to users
  • Convert queries when migrating between database systems
  • Analyze complex queries to understand structure and dependencies
  • Check dialect compatibility for database-specific best practices

FAQ from mcp-server-sql-analyzer

What does the lint_sql tool do?

It validates SQL query syntax and returns any errors, including the line and column position of the issue.

How do I convert SQL between dialects?

Use the transpile_sql tool, specifying the source dialect with read_dialect and the target dialect with write_dialect.

What dialects are supported?

Use the dialects://all resource to retrieve a complete list of all supported SQL dialects.

What are the dependencies and runtime requirements?

The server requires SQLGlot and is installed via uvx from a git repository or uv from a local clone. No other runtime dependencies are mentioned.

How is the server configured?

Add the server to your claude_desktop_config.json under mcpServers with either the uvx or uv command, as shown in the README.

Comments

More Databases MCP servers