# ajitpratap0/GoSQLX [Health: Active]

**Category:** 🗄️ Databases  
**Repository:** https://github.com/ajitpratap0/GoSQLX  
**GitHub Stars:** 127  
**Views:** 4  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/ajitpratap0-gosqlx

## Description
7 SQL tools (validate, format, parse, lint, security scan, metadata extraction, full analysis) over Streamable HTTP. Public remote server at mcp.gosqlx.dev - no install needed. 1.25M+ ops/sec, 6 SQL dialects.

## Tools
Capabilities this server exposes over MCP:

- **analyze_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.
- **extract_metadata** — 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}.
- **format_sql** — Use this when the user wants SQL pretty-printed or reformatted: one clause per line, optional upper-case keywords and trailing semicolon. Comments are preserved; unplaceable optimizer hints are refused. Returns {formatted_sql, options}.
- **lint_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}.
- **parse_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, optionally for a specific dialect. GO batch separators are excluded from the count.
- **security_scan** — 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.
- **validate_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}.

## Claude Desktop Quick Installation
Remote MCP endpoint (confidence: high). Install path detected from listing signals. Add as a URL/SSE server in your client:

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

## Documentation

## What ajitpratap0/GoSQLX MCP server does

ajitpratap0/GoSQLX brings GoSQLX’s SQL parser and analysis functions into MCP-compatible assistants. It processes SQL text rather than executing queries against a database. The server can check syntax, summarize parsed statements, reformat queries, report style violations, identify injection patterns, extract referenced objects, or combine these checks into one report.

The implementation is based on GoSQLX, a pure-Go parser that builds SQL abstract syntax trees. Supported dialects include PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, SQLite, Snowflake, and ClickHouse. Dialect selection matters most for validation and parsing behavior; validation can also be run without selecting a specific dialect.

## How it works

Clients send SQL and tool parameters over MCP using Streamable HTTP. The hosted endpoint is `https://mcp.gosqlx.dev/mcp`, so a client can use the service without compiling Go code or running a local process. The combined analysis operation runs validation, parsing, metadata extraction, security scanning, linting, and formatting concurrently, then returns a composite result. MCP Apps-capable hosts can render that result as an interactive report.

GoSQLX analyzes query text locally within the service’s SQL-processing workflow. Its tools report structural and textual findings; they are not database execution or schema inspection operations.

## Setup and configuration

Add the remote endpoint to an MCP client that supports Streamable HTTP. For Claude, the documented command is:

```bash
claude mcp add --transport http gosqlx https://mcp.gosqlx.dev/mcp
```

The public service requires no local installation. The repository also provides a Claude Code plugin with skills, slash commands, and a SQL reviewer agent. A ChatGPT connector can use the same endpoint in developer mode, where the interactive analysis widget is available.

## Tools and capabilities

- `validate_sql` checks whether SQL is syntactically valid and can target a selected dialect. It returns validity and an error when parsing fails.
- `parse_sql` returns a compact AST-oriented summary, including statement count and statement types.
- `format_sql` lays out clauses for readability, with options for uppercase keywords and a trailing semicolon. Formatting removes comments.
- `lint_sql` reports style issues such as whitespace, indentation, line length, keyword case, comma placement, alias consistency, and alignment.
- `security_scan` looks for injection-related patterns, including tautologies, UNION attacks, stacked queries, and comment bypasses, with severity counts.
- `extract_metadata` lists referenced tables, columns, and functions for lineage or impact analysis.
- `analyze_sql` combines all six analysis stages into one response.

## Limitations and notes

The server analyzes SQL text but does not run queries or connect to a database. Formatting does not preserve comments. The repository describes dialect-specific grammar for eight database systems, while generic, BigQuery, and Redshift names are also accepted by the underlying library with capability-gated grammar rather than dedicated dialect keyword sets.

_Full upstream README: https://allmcps.com/mcp/ajitpratap0-gosqlx/readme_

