# GoSQLX

> GoSQLX is an open-source MCP server for databases. SQL parsing, formatting, linting and injection checks for 8 dialects, as an MCP server. It runs as a hosted remote server, so there is nothing to install locally.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** API, CLI, vscode, jetbrains, Linux, macOS, Windows
- **Website:** https://gosqlx.dev
- **Repository:** https://github.com/ajitpratap0/gosqlx
- **MCP Registry name:** io.github.ajitpratap0/gosqlx
- **Categories:** databases, developer tools
- **Listing updated:** 2026-11-14

## About

GoSQLX is a pure-Go SQL parser, and its MCP server hands seven of its capabilities to an assistant: parse, format, validate, lint, analyze, detect injection and list dialects. The hosted endpoint needs no install or API key, and a Claude Code plugin and a ChatGPT connector with an analysis widget are described in the README.

The same engine ships as a Go library, a CLI, a VS Code extension, a language server for Neovim and JetBrains, a GitHub Action and a WASM playground. It handles PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, SQLite, Snowflake and ClickHouse. The site reports a hand-written 2,813-statement corpus that parses, formats and round-trips across the eight, 30 lint rules and over 3,100 tests, with the parser reaching about 2.8 million simple SELECTs a second at the parse stage on an Apple M4.

Those speed figures are the project's own benchmarks of the parse stage only, and the README puts SQL-99 coverage at an estimated 80 to 85 percent. It suits developers who want an assistant to check SQL before it ships.

## Features

- **Multi-dialect parsing:** Selects one of eight dialects with a single dialect string.
- **Format and transpile:** Dialect-aware formatting that keeps comments and optimizer hints, plus transpiling between dialects.
- **Linting:** 30 lint rules for style and correctness.
- **Injection detection:** Security scanner that classifies SQL injection by severity.
- **Editor support:** Language server for real-time checks in VS Code, Neovim and JetBrains.
- **CI action:** GitHub Action to validate SQL files.

## Good for

- Validate generated SQL before running it
- Format queries across mixed dialects
- Scan SQL for injection patterns
- Lint SQL in CI
- List which dialects an assistant can target

## Install

### Claude Code (Terminal)

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

### Claude Desktop (Settings → Connectors → Add custom connector)

```sh
https://mcp.gosqlx.dev/mcp
```

### Cursor (~/.cursor/mcp.json)

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

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "gosqlx": {
      "type": "http",
      "url": "https://mcp.gosqlx.dev/mcp"
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

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

### Other clients (your client's MCP settings (most use this shape))

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

## Tools

- `parse_sql`: Parses SQL
- `format_sql`: Formats SQL
- `validate_sql`: Validates SQL
- `lint_sql`: Lints SQL against rules
- `analyze_sql`: Analyzes SQL and extracts metadata
- `detect_injection`: Detects SQL injection patterns
- `list_dialects`: Lists supported dialects

## FAQ

### How do I add it to Claude Code?

Run claude mcp add --transport http gosqlx https://mcp.gosqlx.dev/mcp; no API key is needed.

### Which dialects are supported?

PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, SQLite, Snowflake and ClickHouse.

### Is it thread-safe?

The project says it is race-detector clean in CI.

### Can I use it without MCP?

Yes, as a Go library, CLI, VS Code extension or GitHub Action.

### Is GoSQLX free?

Yes. GoSQLX is open source, so you can use and self-host it for free.

### How do I add GoSQLX to Claude Code?

Run this command in your terminal: claude mcp add --transport http gosqlx https://mcp.gosqlx.dev/mcp

### What are the best alternatives to GoSQLX?

The closest alternatives to GoSQLX are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Ouroboros](https://ai-powered.com/mcp/ouroboros): Ouroboros is an open-source MCP server for developer tools.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [Concord MCP](https://ai-powered.com/mcp/concord-mcp): Concord MCP is a freemium MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/gosqlx
