MCP Overview
Last updated
pREST exposes a PostgreSQL MCP server over HTTP so AI agents can discover schemas and read data through the same process that serves your REST API.
Requires pREST v2.1.0+.
HTTP MCP endpoint
/_mcp on prestd
Implements MCP tools, catalog discovery, and read queries
Stdio adapter
prest-mcp binary
Forwards JSON-RPC between stdin/stdout and POST /_mcp
The adapter is a transport bridge only. It does not introspect schemas, generate SQL, or implement tools β those live in pREST.
MCP client / AI IDE
β stdio (NDJSON JSON-RPC)
prest-mcp
β HTTP POST
http://localhost:3000/_mcp
β
pREST β PostgreSQLConcern
Native /_mcp
prest-mcp adapter
Transport
HTTP on the pREST server
Stdio process that proxies to HTTP
Tools / SQL
Implemented in pREST
None β forwards JSON-RPC as-is
When to use
HTTP-capable MCP clients
Clients that only launch stdio servers
Extra process
No
Yes β one lightweight binary
Prefer a read-only PostgreSQL role for agent workflows β see Read-only PostgreSQL for AI.
MCP tools in v2.1.0 are read-only (no insert/update/delete/DDL). REST may still allow writes on the same server.
Do not expose unauthenticated /_mcp publicly.
Prefer local or private-network pREST for development.
When auth is enabled, pass a JWT via PREST_MCP_TOKEN (adapter) or Authorization (HTTP).
PREST_MCP_URL
yes
β
URL of the HTTP MCP endpoint, e.g. http://localhost:3000/_mcp
PREST_MCP_TOKEN
no
β
Bearer token when pREST auth is enabled
PREST_MCP_TIMEOUT_MS
no
30000
HTTP timeout in milliseconds
Protocol and tools reference: MCP over HTTP
Last updated