GoSQLX MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
git clone https://github.com/ajitpratap0/GoSQLX
cd GoSQLX

Then follow the repository README for any remaining dependency or build steps before continuing.

2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add gosqlx -- node "<FULL_PATH_TO_GOSQLX>/dist/index.js"

Replace <FULL_PATH_TO_GOSQLX>/dist/index.js with the actual folder you prepared in step 1.

README.md

Production-ready SQL parsing SDK for Go with 7 SQL tools

GoSQLX

Parse SQL at the speed of Go

๐ŸŒ Try the Playground  ยท  ๐Ÿ“– Read the Docs  ยท  ๐Ÿš€ Get Started  ยท  ๐Ÿ“Š Benchmarks

1.38M+ ops/sec <1ฮผs latency 85% SQL-99 7 dialects 0 race conditions

What is GoSQLX?

GoSQLX is a production-ready SQL parsing SDK for Go. It tokenizes, parses, and generates ASTs from SQL with zero-copy optimizations and intelligent object pooling - handling 1.38M+ operations per second with sub-microsecond latency.

ast, _ := gosqlx.Parse("SELECT u.name, COUNT(*) FROM users u JOIN orders o ON u.id = o.user_id GROUP BY u.name")
// โ†’ Full AST with statements, columns, joins, grouping - ready for analysis, transformation, or formatting

Why GoSQLX?

  • Not an ORM - a parser. You get the AST, you decide what to do with it.
  • Not slow - zero-copy tokenization, sync.Pool recycling, no allocations on hot paths.
  • Not limited - PostgreSQL, MySQL, SQL Server, Oracle, SQLite, Snowflake, ClickHouse. CTEs, window functions, MERGE, set operations.
  • Not just a library - CLI, VS Code extension, GitHub Action, MCP server, WASM playground, Python bindings.

Get Started in 60 Seconds

go get github.com/ajitpratap0/GoSQLX
package main

import (
    "fmt"
    "github.com/ajitpratap0/GoSQLX/pkg/gosqlx"
)

func main() {
    // Parse any SQL dialect
    ast, _ := gosqlx.Parse("SELECT * FROM users WHERE active = true")
    fmt.Printf("%d statement(s)\n", len(ast.Statements))

    // Format messy SQL
    clean, _ := gosqlx.Format("select id,name from users where id=1", gosqlx.DefaultFormatOptions())
    fmt.Println(clean)
    // SELECT
    //   id,
    //   name
    // FROM users
    // WHERE id = 1

    // Catch errors before production
    if err := gosqlx.Validate("SELECT * FROM"); err != nil {
        fmt.Println(err) // โ†’ expected table name
    }
}

Install Everywhere

๐Ÿ“ฆ Go Library

go get github.com/ajitpratap0/GoSQLX

๐Ÿ–ฅ๏ธ CLI Tool

go install github.com/ajitpratap0/GoSQLX/cmd/gosqlx@latest
gosqlx validate "SELECT * FROM users"
gosqlx format query.sql
gosqlx lint query.sql

๐Ÿ’ป VS Code Extension

code --install-extension ajitpratap0.gosqlx

Bundles the binary - zero setup. Learn more โ†’

๐Ÿค– MCP Server (AI Integration)

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

7 SQL tools in Claude, Cursor, or any MCP client. Guide โ†’

Features at a Glance

โšก Parser

Zero-copy tokenizerRecursive descent parserFull AST generation

Tools (5)

validateValidates SQL syntax for supported dialects
formatFormats SQL queries for readability
lintAnalyzes SQL for best practices and potential issues
security_scanScans SQL for potential security vulnerabilities
parseParses SQL into a structured AST

Configuration

claude_desktop_config.json
{"mcpServers": {"gosqlx": {"command": "curl", "args": ["https://mcp.gosqlx.dev/mcp"]}}}

Try it

โ†’Validate this SQL query for PostgreSQL syntax: SELECT * FROM users WHERE id = 1
โ†’Format the following messy SQL query to make it readable: select id,name from users where id=1
โ†’Perform a security scan on this SQL query to check for potential injection risks: SELECT * FROM users WHERE name = '$USER_INPUT'
โ†’Parse this SQL statement and return the AST structure: SELECT u.name, COUNT(*) FROM users u JOIN orders o ON u.id = o.user_id GROUP BY u.name

Frequently Asked Questions

What are the key features of GoSQLX?

Zero-copy SQL tokenization and parsing. Support for 7 SQL dialects including PostgreSQL, MySQL, and SQLite. Full AST generation for complex SQL analysis. Built-in SQL validation, formatting, and linting. High-performance architecture handling 1.38M+ ops/sec.

What can I use GoSQLX for?

Automating SQL code review and linting in development workflows. Standardizing SQL formatting across large codebases. Detecting potential SQL injection vulnerabilities during development. Building AI-powered SQL query builders and analyzers.

How do I install GoSQLX?

Install GoSQLX by running: claude mcp add --transport http gosqlx https://mcp.gosqlx.dev/mcp

What MCP clients work with GoSQLX?

GoSQLX works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep GoSQLX docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare