MCP.so
登录

mcp-server-sql-analyzer

@j4c0bs

关于 mcp-server-sql-analyzer

MCP server for SQL static analysis.

基本信息

分类

数据库

许可证

MIT

运行时

python

传输方式

stdio

发布者

j4c0bs

配置

使用下面的配置,将此服务器添加到你的 MCP 客户端。

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

工具

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:

概览

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.

评论

数据库 分类下的更多 MCP 服务器