Overview & Architecture
PostgreSQL Safety LayerThe QueryCraft CLI (querycraft) is an autonomous developer firewall, Text-to-SQL query engine, and Model Context Protocol (MCP) server for production PostgreSQL databases. It replaces blind guessing with dry-run cost estimation, schema grounding, and self-healing error repair.
Zero-Hallucination
Grounds prompts strictly in introspected PostgreSQL schemas, UUID types, and foreign key relationships.
Pre-Flight Cost Guard
Dry-runs PostgreSQL EXPLAIN to score query risk (LOW / MED / HIGH) and intercept unindexed sequential scans.
SQL Doctor Critic
Diagnoses PostgreSQL SQLSTATE runtime codes (42703, 42803, 42P01) and self-heals broken queries.
Interactive Terminal Snapshot
querycraft ask demo (zsh)
$querycraft ask "show active users by spend"🧠 QueryCraft AI [Workspace: Production | User: nitindeep65@gmail.com]Grounding live schema... Evaluating safety with Cost Guard...Generated SQL:SELECT u.id, u.name, SUM(o.total_amount) AS total_spentFROM users uJOIN orders o ON u.id = o.user_idWHERE u.is_active = TRUEGROUP BY u.id, u.nameORDER BY total_spent DESCLIMIT 50;Pre-Flight Risk: [LOW RISK] (Cost: 14.2 | Index Scan)Results (5 rows in 11.2ms)
Recommended Next Step
Ready to set up QueryCraft? Continue to or run
querycraft setup for 1-click Cursor/Claude auto-configuration.