Skip to content

Choose a tag to compare

@ajitpratap0 ajitpratap0 released this 13 Mar 17:44
· 108 commits to main since this release
241b46e

MCP Server — All SQL Tools as Model Context Protocol Tools

GoSQLX v1.10.0 adds a full MCP Server that exposes all GoSQLX SQL capabilities as Model Context Protocol tools over streamable HTTP. Integrate GoSQLX into Claude, Cursor, and any MCP-compatible AI assistant.

✨ New Features

  • MCP Server (pkg/mcp/, cmd/gosqlx-mcp/): 7 SQL tools over streamable HTTP
    • validate_sql — validate SQL syntax with optional dialect
    • format_sql — format SQL with configurable indentation and keyword casing
    • parse_sql — parse SQL and return AST summary (statement count and types)
    • extract_metadata — extract tables, columns, and functions referenced in SQL
    • security_scan — scan SQL for injection patterns (tautologies, UNION attacks, stacked queries, comment bypasses)
    • lint_sql — lint SQL against all 10 GoSQLX style rules (L001–L010)
    • analyze_sql — run all 6 tools concurrently and return a composite report
  • Bearer Token Auth: Optional authentication via GOSQLX_MCP_AUTH_TOKEN environment variable
  • Multi-Dialect: Validate against postgresql, mysql, sqlite, sqlserver, oracle, snowflake, or generic

📝 Documentation

  • docs/MCP_GUIDE.md — comprehensive MCP server guide
  • Architecture diagram updated with MCP layer
  • API reference updated with pkg/mcp package
  • Configuration guide updated with MCP environment variables

🔧 Build

  • Go minimum bumped to 1.23.0 (required by github.com/mark3labs/mcp-go v0.45.0)
  • Taskfile: mcp, mcp:build, mcp:test, mcp:install tasks added

Quick Start

# Install
go install github.com/ajitpratap0/GoSQLX/cmd/gosqlx-mcp@v1.10.0

# Run
gosqlx-mcp                                    # default :8080
GOSQLX_MCP_PORT=9090 gosqlx-mcp               # custom port
GOSQLX_MCP_AUTH_TOKEN=secret gosqlx-mcp        # with auth

Claude Desktop Configuration

{
  "mcpServers": {
    "gosqlx": {
      "command": "gosqlx-mcp",
      "env": { "GOSQLX_MCP_PORT": "8080" }
    }
  }
}

Full Changelog: v1.9.3...v1.10.0