# j4c0bs/mcp-server-sql-analyzer [Health: Active]

**Category:** 🗄️ Databases  
**Repository:** https://github.com/j4c0bs/mcp-server-sql-analyzer  
**GitHub Stars:** 32  
**Views:** 3  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/j4c0bs-mcp-server-sql-analyzer

## Description
MCP server that provides SQL analysis, linting, and dialect conversion using SQLGlot

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "mcp-server-sql-analyzer": {
    "command": "uvx",
    "args": ["--from","git+https://github.com/j4c0bs/mcp-server-sql-analyzer.git","mcp-server-sql-analyzer"]
  }
}
```

## Documentation

## What j4c0bs/mcp-server-sql-analyzer MCP server does

j4c0bs/mcp-server-sql-analyzer MCP server gives MCP clients static analysis tools for SQL. It does not execute queries or connect to a live database. Instead, it parses SQL through SQLGlot and reports whether analysis or conversion succeeded.

The server supports four main operations:

- `lint_sql` checks syntax and returns validity, a status or error message, and an optional line and column position.
- `transpile_sql` converts a statement from one specified dialect to another and returns the converted SQL when successful.
- `get_all_table_references` identifies tables and common table expressions, including catalog, database, table, alias, and fully qualified name details.
- `get_all_column_references` lists referenced columns together with their table context and fully qualified names.

These tools are useful for validating generated SQL, preparing statements for another database dialect, and examining query structure before review or migration.

## How it works

Each operation receives SQL as a string. The linting and reference-analysis tools accept an optional dialect, while transpilation requires both a source dialect and a target dialect. SQLGlot performs the parsing and dialect handling, and the server returns structured results containing validity, messages, and operation-specific data.

A `dialects://all` resource lists the SQL dialects available to the tools. Agents can use that resource to discover valid dialect names before requesting validation, reference extraction, or conversion.

## Setup and configuration

j4c0bs/mcp-server-sql-analyzer can be configured as a local stdio server in Claude Desktop. The recommended approach uses `uvx` to fetch and run the project directly from its Git repository:

```json
{
  "mcpServers": {
    "sql-analyzer": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/j4c0bs/mcp-server-sql-analyzer.git",
        "mcp-server-sql-analyzer"
      ]
    }
  }
}
```

Alternatively, clone the repository and configure `uv` with the project directory and `run mcp-server-sql-analyzer`. Development instructions use the MCP Inspector with the same `uv` command. The repository documents `uv run pytest .` for running its unit tests. No environment variables are specified in the provided configuration.

## Tools and capabilities

The SQL tools return structured responses rather than only plain text. A failed parse or conversion includes a message, while successful reference analysis returns arrays of discovered tables or columns. Dialect conversion requires the caller to identify both sides of the conversion; validation and reference extraction can omit the dialect when the default parsing behavior is sufficient.

j4c0bs/mcp-server-sql-analyzer is suited to agents that need SQL-focused inspection without database credentials. For example, an agent can lint a generated query before showing it to a user, convert MySQL syntax toward PostgreSQL syntax, or identify which tables and columns appear in a complex statement.

## Limitations and notes

It does not document query execution, schema lookup, database connections, optimization recommendations, or guaranteed semantic equivalence after dialect conversion. Conversion and analysis results should therefore be reviewed for database-specific behavior.

The README provides a Claude Desktop configuration and does not document client-specific settings for other MCP hosts. Dialect names should be taken from the dialect discovery resource or from SQLGlot's supported dialect set rather than assumed.

_Full upstream README: https://allmcps.com/mcp/j4c0bs-mcp-server-sql-analyzer/readme_

