For the complete documentation index, see llms.txt. This page is also available as Markdown.

PostgreSQL

Expose PostgreSQL as a REST and MCP API with pREST β€” native adapter, auto CRUD, auth, ACL, and read-only MCP at /_mcp.

pREST turns a PostgreSQL database into an instant REST API and (from v2.1.0) a read-only MCP endpoint. PostgreSQL is the Native adapter β€” the first and primary dialect implementation.

Last updated: July 11, 2026 Β· Label: Native


Supported features

Capability
Status

Connection

supported

Schema discovery

supported

CRUD

supported

Filtering / ordering / pagination

supported

Transactions

supported

Scripts (/_QUERIES)

supported

MCP (/_mcp)

supported (v2.1.0+)

ACL / permissions

supported

pgvector KNN / distance filtering (_korder, :vecdist)

supported (v2.4.0+, requires pgvector extension) β€” see Parameters


Connection

export PREST_VERSION=2
export PREST_PG_URL='postgres://user:pass@localhost:5432/mydb?sslmode=disable'
# or discrete PREST_PG_HOST / PREST_PG_USER / PREST_PG_PASS / PREST_PG_DATABASE

TOML [pg] and multi-database [[databases]] are documented in Configuring pREST and Multi-database.


Quick CRUD example

REST (Representational State Transfer) maps HTTP verbs to CRUD on SQL tables at /{database}/{schema}/{table} β€” API Reference.

See also Parameters.


MCP

MCP (Model Context Protocol) is an open standard for connecting AI apps and agents to tools and data. On PostgreSQL, pREST exposes read-only MCP at /_mcp on the same server as REST β€” MCP over HTTP.

AI client setup: docs.prestd.com/ai.


Known limitations

  • Requires PostgreSQL 9.5+ (project baseline).

  • SQL dialect features beyond what the adapter generates (exotic types, some extensions) may need custom queries.

  • Other SQL engines are not this adapter β€” see roadmap.


Last updated