MCP.so
Sign In

MCP Server Sql Analyzer

@j4c0bs

Basic information

Category

Databases

License

MIT

Transports

stdio

Author

j4c0bs

About MCP Server Sql Analyzer

MCP server for SQL static analysis.

MCP Server Sql Analyzer 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"
      ]
    }
  }
}

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

Frequently asked questions

1

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.

2

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`.

3

What dialects are supported?

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

4

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.

5

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