Serve (Postgres Wire)
Expose your semantic layer over the PostgreSQL wire protocol for BI tools and clients.
sqlctx server postgres starts a PostgreSQL-compatible server that rewrites semantic queries into warehouse SQL.
Install the required extra with uv tool install "sqlctx[serve]", or use the uvx --from command below.
For the browser UI, HTTP API, and MCP on one port, use uvx --from "sqlctx[api,mcp]" sqlctx serve ./models (default port 4400). This guide covers the separate PostgreSQL wire interface.
Basic
sqlctx server postgres ./models --port 5433
uvx --from "sqlctx[serve]" sqlctx server postgres --help
Usage: sqlctx server postgres
Authentication
sqlctx server postgres ./models --username admin --password-file .secrets/pg-password
Network Boundaries and TLS
SQLCtx’s server is intended to run:
- locally for development, or
- behind a reverse proxy / tunnel that terminates TLS and controls network access.
Debugging
- Start with
--demoto validate connectivity:sqlctx server postgres --demo - If BI tools behave oddly, capture:
- the semantic query
- the compiled SQL
- the client’s connection settings