PostgreSQL
Expose PostgreSQL as a REST and MCP API with pREST β native adapter, auto CRUD, auth, ACL, and read-only MCP at /_mcp.
Last updated
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
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
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_DATABASETOML [pg] and multi-database [[databases]] are documented in Configuring pREST and Multi-database.
REST (Representational State Transfer) maps HTTP verbs to CRUD on SQL tables at /{database}/{schema}/{table} β API Reference.
See also Parameters.
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.
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
GET /mydb/public/users
POST /mydb/public/users
Content-Type: application/json
{"name": "ada"}GET /_mcp
POST /_mcp