qcp — Query Companion | AI-Powered PostgreSQL Queries

· qcp

2 min read Original article ↗

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

FeatureqcpVanna AI (2.0)Wren AIPostgres MCPGUI BI Tools
InterfaceCLI binaryPython lib + web chatWeb UI + CLIMCP server onlyWeb dashboard
Setupbrew/curl/npmpip + vector DBDocker ComposeServer binaryDeploy server + config
Schema UnderstandingAuto scan (no manual step)Manual training requiredManual MDL modelingNone - re-reads each timeManual data modeling
LLM ChoiceBYOK - Gemini defaultAny LLMOpenAI/AnthropicDepends on clientUsually fixed vendor
Multi-DB RoutingBuilt-in supervisor agentSingle connection20+ connectorsOne DB per instanceOne connection per source
Safety ModelRead-only by defaultExecutes directlyExecutes queriesInconsistentVaries by tool
Performance DiagnosticsEXPLAIN ANALYZE + suggestionsNot a focusNot a focusQuery execution onlyLimited in most tools
MCP SupportShips MCP serverNoneNoneThis is the productNone
License/CostOpen source, BYOKOpen source (MIT)Open source coreOpen sourceFree + paid tiers
Best ForTerminal-native devsCustom chat productsData warehouse teamsClaude/Cursor usersAnalysts/dashboards

Ready to query your database with natural language?

Get started now or contribute on GitHub