GoSQLX

SQL validation, formatting, parsing, metadata extraction, linting, and security analysis.

我該用這個嗎

品質與安全性

A
說明品質
100%
結構描述完整度
100%
命名品質
91%
汙染風險
100%
權限相符程度
100%
協定合規性
100%

根據工具定義與協定合規性的自動化分析。

上下文成本

~1,041Token(工具定義)
~728 B典型回應大小
中等的注意力影響(128k 上下文的 0.81%)

這是每次將伺服器的工具載入模型上下文時所消耗的約略 token 數量。數量越高,可用於其他工作的注意力就越少。

安裝

一鍵安裝

將以下內容加入你的 `claude_desktop_config.json` 檔案:

{
  "mcpServers": {
    "gosqlx": {
      "url": "https://mcp.gosqlx.dev/mcp"
    }
  }
}

遠端端點

https://mcp.gosqlx.dev/mcpstreamable-http

它能做什麼

工具清單

工具(7)

🟢 唯讀🟡 寫入🔴 刪除⚪ 未知
🟢analyze_sql(sql)

Use this when the user wants a complete review of a SQL query. Runs validate, parse, metadata, security, lint, and format concurrently and returns one composite report; hosts that support MCP Apps render it as an interactive report.

輸入結構描述

{
  "type": "object",
  "properties": {
    "sql": {
      "description": "The SQL string to analyze",
      "type": "string"
    }
  },
  "required": [
    "sql"
  ]
}
🟢extract_metadata(sql)

Use this when the user wants the tables, columns, and functions a SQL query references (e.g. for lineage or impact analysis). Returns {tables, columns, functions}.

輸入結構描述

{
  "type": "object",
  "properties": {
    "sql": {
      "description": "The SQL string to analyze",
      "type": "string"
    }
  },
  "required": [
    "sql"
  ]
}
🟢format_sql(add_semicolon, indent_size, sql, uppercase_keywords)

Use this when the user wants SQL pretty-printed or reformatted: one clause per line, optional upper-case keywords and trailing semicolon. Comments are not kept. Returns {formatted_sql, options}.

輸入結構描述

{
  "type": "object",
  "properties": {
    "add_semicolon": {
      "description": "Append a trailing semicolon (default: false)",
      "type": "boolean"
    },
    "indent_size": {
      "description": "Spaces per indent level for nested blocks such as CREATE TABLE columns; clauses always start at column 0. 0 puts each statement on one line (default: 2)",
      "type": "number"
    },
    "sql": {
      "description": "The SQL string to format",
      "type": "string"
    },
    "uppercase_keywords": {
      "description": "true upper-cases all SQL keywords (AND, IN, CASE, ...), but not data type names. false keeps the formatter's casing: clause keywords (SELECT, FROM, WHERE, ...) upper-case, other keywords (e.g. and, or) may keep their input case (default: false)",
      "type": "boolean"
    }
  },
  "required": [
    "sql"
  ]
}
🟢lint_sql(sql)

Use this when the user wants SQL style feedback. Applies the same 10 rules as `gosqlx lint`: L001 trailing whitespace, L002 mixed indentation, L003 consecutive blank lines, L004 indentation depth, L005 line length (>100), L006 column alignment, L007 keyword case (upper), L008 comma placement (trailing), L009 aliasing consistency, L010 redundant whitespace. Returns {violation_count, violations}.

輸入結構描述

{
  "type": "object",
  "properties": {
    "sql": {
      "description": "The SQL string to lint",
      "type": "string"
    }
  },
  "required": [
    "sql"
  ]
}
🟢parse_sql(sql)

Use this when the user wants to know how SQL parses: returns an AST summary with the statement count and the type of each statement.

輸入結構描述

{
  "type": "object",
  "properties": {
    "sql": {
      "description": "The SQL string to parse",
      "type": "string"
    }
  },
  "required": [
    "sql"
  ]
}
🟢security_scan(sql)

Use this when the user wants SQL checked for injection patterns: tautologies, UNION attacks, stacked queries, comment bypasses, and more. Returns findings with severity counts.

輸入結構描述

{
  "type": "object",
  "properties": {
    "sql": {
      "description": "The SQL string to scan",
      "type": "string"
    }
  },
  "required": [
    "sql"
  ]
}
🟢validate_sql(dialect, sql)

Use this when the user wants to know whether a SQL statement is syntactically valid, optionally for a specific dialect. Returns {valid: bool, error?: string, dialect?: string}.

輸入結構描述

{
  "type": "object",
  "properties": {
    "dialect": {
      "description": "SQL dialect: generic, postgresql, mysql, mariadb, sqlserver, oracle, sqlite, snowflake, bigquery, redshift, clickhouse",
      "enum": [
        "generic",
        "postgresql",
        "mysql",
        "mariadb",
        "sqlserver",
        "oracle",
        "sqlite",
        "snowflake",
        "bigquery",
        "redshift",
        "clickhouse"
      ],
      "type": "string"
    },
    "sql": {
      "description": "The SQL string to validate",
      "type": "string"
    }
  },
  "required": [
    "sql"
  ]
}

社群

為此伺服器評分

證據

近期觀測

已驗證未記錄版本7 個工具