Skip to content

Quick Start

Get a REST API, MCP tools, and OpenAPI spec from your Postgres database in under 2 minutes.

  • A stable Rust toolchain (edition 2024) — or use Nix
  • A running PostgreSQL instance
Terminal window
# Build the CLI
cargo build --release --bin pgvis
# Point it at your database and serve
export PGVIS_DSN="postgres://user@localhost/mydb"
./target/release/pgvis serve --bind 0.0.0.0:3000
Terminal window
# List rows from a table in the public schema
curl "http://localhost:3000/api/public/your_table"
# Select specific columns
curl "http://localhost:3000/api/public/items?select=id,name,price"
# Filter rows
curl "http://localhost:3000/api/public/items?price=gte.99.99"
Terminal window
# stdio transport (for Claude Desktop)
pgvis --dsn "postgres://user@localhost/mydb" mcp
# or HTTP transport alongside REST
pgvis --dsn "postgres://user@localhost/mydb" serve --mcp-http
Terminal window
# Drop into a dev shell
nix develop
# Or build directly
nix build