Add it to Claude Code
claude mcp add gosqlx -- curl https://mcp.gosqlx.dev/mcpMake your agent remember this setup
gosqlx's config, env vars, and the gotchas you hit — recalled in every future Claude Code, Cursor, and Codex session.
npx conare@latestFree · one command · indexes the sessions already on disk. Set up in the browser instead →
What it does
- 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
Tools 5
validateValidates SQL syntax for supported dialectsformatFormats SQL queries for readabilitylintAnalyzes SQL for best practices and potential issuessecurity_scanScans SQL for potential security vulnerabilitiesparseParses SQL into a structured ASTTry it
Original README from ajitpratap0/GoSQLX
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)
", 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
<table> <tr> <td width="50%">📦 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
</td>
<td width="50%">
💻 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 →
</td> </tr> </table>