Repository navigation
v1.0.0 — Initial Public Release (PostgreSQL & MySQL Strict Read-Only MCP Server)
See through your database with AI — without ever breaking it.
KacaSQL v1.0.0 is the initial public release of a strict read-only, multi-connection Model Context Protocol (MCP) server for PostgreSQL and MySQL, purpose-built for backend developers.
Highlights
- 2-Layer Strict Read-Only Guardrails
- Layer 1 — AST Validation (
sqlglot): Dialect-aware (postgres&mysql) query validation blocking multi-statement SQL, DML/DDL, write-CTEs (WITH ... DELETE/INSERT/UPDATE),SELECT INTO/INTO OUTFILE,LOAD DATA INFILE,FOR UPDATE, and dangerous DB functions (pg_read_file,set_config,dblink*,LOAD_FILE,GET_LOCK,BENCHMARK, etc.). - Layer 2 — Database Session Guard: Every query executes inside a strict read-only transaction with statement timeout (
BEGIN TRANSACTION READ ONLY+statement_timeouton PostgreSQL;START TRANSACTION READ ONLY+max_execution_timeon MySQL) and always ends inROLLBACK.
- Layer 1 — AST Validation (
- Multi-Engine & Multi-Connection Support
- Connect to multiple PostgreSQL (
psycopgv3 async pool) and MySQL (aiomysql) databases acrosslocal,staging, andprod-replicavia declarative YAML (connections.yaml) with lazy connection pooling.
- Connect to multiple PostgreSQL (
- Zero Credential Leakage & PII Protection
- DSNs are loaded lazily from environment variables and scrubbed from all logs and error responses.
- Automatic glob-based PII masking (
*password*,*secret*,*token*,api_key*,credit_card*,nik, plus per-connection overrides), configurable hard row caps, and long-cell truncation.
- Focused MCP Surface Area
- 9 Tools:
list_connections,list_schemas,list_tables,search_schema,describe_table,get_table_relationships,get_table_sample,execute_read_query,explain_query. - 1 Resource:
db://{connection_id}/overview. - 2 Prompts:
debug-slow-query,explore-table-context.
- 9 Tools:
- Verified & CI-Ready
- Supports Python 3.11, 3.12, and 3.13 with
uv. - Full unit test suite + Docker PostgreSQL 16 & MySQL 8.4 integration tests.
- Supports Python 3.11, 3.12, and 3.13 with
Quick Start
See the README for Antigravity IDE and Claude Desktop MCP setup instructions.