Back to MCP Directory
SQL Analyzer
Model Context Protocol moderate risk

SQL Analyzer

Analyzes, lints, and converts SQL queries between dialects, enhancing SQL workflow accuracy and compatibility.

Connections & Capabilities

Connects To

GitHubPostgreSQLMySQL

Capabilities

readwrite

Quickstart

Install

npx @modelcontextprotocol/inspector

Config

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

Exposed MCP Tools (4)

safe
lint_sql

Validates SQL query syntax and returns any errors.

Read-only operation; only analyzes the SQL string.

moderate
transpile_sql

Converts SQL between different dialects.

May introduce subtle errors during conversion; requires careful review.

safe
get_all_table_references

Extracts table and CTE references from SQL.

Read-only operation; analyzes SQL to extract table names.

safe
get_all_column_references

Extracts column references with table context.

Read-only operation; analyzes SQL to extract column names.

Safety Assessment

This server is generally safe for analyzing and converting SQL queries. However, users should exercise caution when using transpiled SQL in production environments and ensure proper input sanitization to prevent SQL injection vulnerabilities. The risk is moderate due to the potential for incorrect dialect conversion and the need for careful review of transpiled queries.

  • Primarily read-only operations (analysis, linting)
  • No direct database access or modification
  • SQLGlot library is well-established for SQL parsing
  • Limited execution capabilities
  • Potential for SQL injection if user-provided SQL is not properly sanitized by the client
  • Incorrect dialect conversion could lead to unexpected query behavior
  • Reliance on SQLGlot's dialect support; unsupported dialects may cause issues
  • Transpilation could introduce subtle errors if not carefully reviewed