MCP Directory

How to add SQL Analyzer to Cursor

SQL static analysis, linting, and dialect conversion for your AI assistant, powered by SQLGlot. Paste the config into ~/.cursor/mcp.json and restart Cursor.

Last updated June 14, 2026 · 31 · stdio · no auth

Cursor config for SQL Analyzer

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

Requires `uv` (the Python package runner). Install it from https://docs.astral.sh/uv/ if `uvx` is not found.

Setup steps

  1. 1Open Cursor → Settings → MCP → Add new MCP server (or edit ~/.cursor/mcp.json directly).
  2. 2Paste the SQL Analyzer config below into the "mcpServers" object.
  3. 3Fill in placeholder secrets, then save.
  4. 4Cursor reloads MCP servers automatically — check Settings → MCP for a green status dot.
  5. 5Ask Cursor to use one of SQL Analyzer's tools to confirm it's connected.

Before you start

  • uv / uvx (Astral) to run the server
  • Python (server is implemented in Python)

What SQL Analyzer can do in Cursor

lint_sql

Validates SQL query syntax and returns any errors. Inputs: sql (string), dialect (string, optional). Returns a ParseResult with is_valid (boolean), message (string), and optional position (line and column of error).

transpile_sql

Converts SQL between different dialects. Inputs: sql (string), read_dialect (string, source dialect), write_dialect (string, target dialect). Returns a TranspileResult with is_valid (boolean), message (string), and sql (the transpiled SQL if successful).

get_all_table_references

Extracts table and CTE references from SQL. Inputs: sql (string), dialect (string, optional). Returns a TableReferencesResult with is_valid, message, and tables (list of references with type, catalog, database, table name, alias, and fully qualified name).

get_all_column_references

Extracts column references with table context. Inputs: sql (string), dialect (string, optional). Returns a ColumnReferencesResult with is_valid, message, and columns (list of references with column name, table name, and fully qualified name).

SQL Analyzer + Cursor FAQ

Where is the Cursor config file?

Cursor reads MCP servers from ~/.cursor/mcp.json. Paste the SQL Analyzer config there under the "mcpServers" key and restart the client.

Does it connect to my database?

No. The server performs static analysis of SQL text using SQLGlot. It does not connect to or query any database, and requires no credentials.

How do I discover supported dialects?

The server exposes a resource at dialects://all that returns a list of all supported SQL dialects for use in the tools.

Can I run it from a local clone instead of git?

Yes. The README documents a uv-based config using --directory /path/to/mcp-server-sql-analyzer run mcp-server-sql-analyzer after cloning the repo, as an alternative to the recommended uvx install.

View repo Full SQL Analyzer page