Query Companion
AI-powered natural language interface for PostgreSQL. Ask questions about your database in plain English. Get safe, read-only SQL, results, and natural language summaries — all in your terminal.
$ qcp ask
? What were my top revenue
? generating customers
? last month?
Generated SQL:
SELECT customer_id, SUM(amount)
FROM orders
WHERE date_trunc('month', created_at)
= date_trunc('month', NOW())
GROUP BY customer_id
ORDER BY SUM(amount) DESC
LIMIT 10
Results:
Top customers are Acme Corp, TechStart,
and Global Solutions with a combined
revenue of $245,000 last month.
Installation
Choose your preferred installation method
Homebrew (macOS/Linux)
brew tap moduna-ai/qcp && brew install qcp
curl (macOS/Linux)
curl -fsSL https://raw.githubusercontent.com/Moduna-AI/qcp/main/scripts/install.sh | sh
PowerShell (Windows)
irm https://raw.githubusercontent.com/Moduna-AI/qcp/main/scripts/install.ps1 | iex
Quick Start Guide
Get up and running in minutes after installation
Set up your AI provider (Gemini is free and default)
Connect to your PostgreSQL database
Index your schema locally (data never leaves your machine)
$
qcp ask "What were our top customers last month?"
Ask a question in plain English
Start an interactive multi-question session
Built on Three Principles
Safety, trust, and privacy are non-negotiable
Safety
Read-only enforcement at the AST level. INSERT, UPDATE, DELETE, and DDL are rejected before execution. Every query runs in a READ ONLY transaction.
Trust
Every generated SQL query is shown before execution. You always know what qcp intends to run against your database.
Privacy
Telemetry never includes SQL, schema metadata, row data, connection URLs, or credentials.
Supported AI Providers
Use your preferred AI model
Why Choose qcp?
Compare qcp to other database query tools
| Feature | qcp | Vanna AI (2.0) | Wren AI | Postgres MCP | GUI BI Tools |
|---|---|---|---|---|---|
| Interface | CLI binary | Python lib + web chat | Web UI + CLI | MCP server only | Web dashboard |
| Setup | brew/curl/npm | pip + vector DB | Docker Compose | Server binary | Deploy server + config |
| Schema Understanding | Auto scan (no manual step) | Manual training required | Manual MDL modeling | None - re-reads each time | Manual data modeling |
| LLM Choice | BYOK - Gemini default | Any LLM | OpenAI/Anthropic | Depends on client | Usually fixed vendor |
| Multi-DB Routing | Built-in supervisor agent | Single connection | 20+ connectors | One DB per instance | One connection per source |
| Safety Model | Read-only by default | Executes directly | Executes queries | Inconsistent | Varies by tool |
| Performance Diagnostics | EXPLAIN ANALYZE + suggestions | Not a focus | Not a focus | Query execution only | Limited in most tools |
| MCP Support | Ships MCP server | None | None | This is the product | None |
| License/Cost | Open source, BYOK | Open source (MIT) | Open source core | Open source | Free + paid tiers |
| Best For | Terminal-native devs | Custom chat products | Data warehouse teams | Claude/Cursor users | Analysts/dashboards |
Ready to query your database with natural language?
Get started now or contribute on GitHub