← Back to Blog

pREST AI Tooling — MCP Adapter, Cursor Plugin, and OpenClaw Skills

pREST v2.1.0+ ships a full AI stack for PostgreSQL: a read-only HTTP MCP endpoint at /_mcp, the official prest-mcp stdio adapter for Cursor and other MCP clients, and optional Cursor and OpenClaw plugins that add rules, skills, and security guidance. Use the same server that already exposes your REST API — no separate query service. Full install and client guides live at docs.prestd.com/ai.

pREST v2 series: Architecture (rc6)v2.0.0 / v2.1.0 GAMCP tutorialThis post (AI plugins)

Table of Contents

The pREST AI stack

pREST connects AI agents and IDEs to PostgreSQL through a layered design. Tools and SQL live in pREST; the adapter is transport only; plugins add agent guidance.

Cursor / VS Code / Claude / OpenClaw / Cline / Continue
        ↓ stdio (NDJSON JSON-RPC)
   prest-mcp
        ↓ HTTP POST
   prestd /_mcp
        ↓
   PostgreSQL
Piece Role
pREST /_mcp Read-only MCP tools: list databases/schemas/tables, describe columns, select rows (max 100)
prest-mcp adapter Stdio ↔ HTTP bridge only — does not introspect schemas, generate SQL, or implement tools
pREST for Cursor Optional Cursor plugin (rules and skills) — separate from the MCP binary
pREST for OpenClaw Optional OpenClaw plugin (skills and examples) — separate from the MCP binary

The HTTP MCP endpoint implements catalog discovery and read queries on the same process that serves your REST API. The prest-mcp binary forwards JSON-RPC between stdin/stdout and POST /_mcp — nothing more.

prest-mcp — official MCP adapter

prest-mcp is the official stdio adapter for pREST’s HTTP MCP endpoint. Use it when your MCP client expects a stdio process instead of calling /_mcp directly.

Homebrew (macOS):

brew install prest/tap/prest-mcp

Go:

go install github.com/prest/prest-mcp-adapter/cmd/prest-mcp@latest

Docker:

docker pull ghcr.io/prest/prest-mcp-adapter:0.1.3

Environment variables:

Variable Required Default Description
PREST_MCP_URL yes Full MCP URL, 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

MCP Registry name: io.github.prest/prest

Canonical Cursor config (project .cursor/mcp.json):

{
  "mcpServers": {
    "prest": {
      "command": "prest-mcp",
      "env": {
        "PREST_MCP_URL": "http://localhost:3000/_mcp"
      }
    }
  }
}

With auth enabled, add PREST_MCP_TOKEN. If prest-mcp is not on PATH, set "command" to the absolute binary path (Homebrew on Apple Silicon: typically /opt/homebrew/bin/prest-mcp).

Install details: Install pREST MCP Adapter.

pREST for Cursor plugin

pREST for Cursor (prest/prest-cursor) is a Cursor plugin with rules, skills, and examples that help the agent work with pREST. It is not the MCP binary.

What the plugin provides:

  • Rules for configuring and using pREST MCP safely
  • Skills for common setup steps (including MCP)
  • Examples such as a read-only Postgres role for AI access

Install from the Cursor plugin marketplace or follow the prest-cursor README. After install, still configure MCP separately — the plugin does not replace prest-mcp.

Task Use
Agent calls prest.list_databases / select tools MCP via prest-mcp/_mcp
Agent follows pREST-specific rules and skills prest-cursor plugin
Least-privilege DB access Read-only PostgreSQL for AI

pREST for OpenClaw plugin

pREST for OpenClaw (@prest/prest-openclaw on ClawHub) provides skills, examples, and security guidance for building PostgreSQL-backed APIs with pREST. It does not run pREST or PostgreSQL.

Install:

openclaw plugins install clawhub:@prest/prest-openclaw
openclaw plugins inspect prest

Enable the plugin in your OpenClaw config if needed, then restart the gateway:

openclaw gateway restart

Skills:

Skill Purpose
generate-config Generate prest.toml, .env.example, optional Docker Compose
generate-sql-route Parameterized SQL under /_QUERIES/
review-security Audit configs, SQL, auth, and MCP exposure
setup-mcp Wire prest-mcp and read-only Postgres for agents
explain-config Plain-language prest.toml walkthrough
prest-core-guidance Core pREST development rules
prest-security-guidance Security defaults and warnings
prest-mcp-guidance MCP and prest-mcp connection patterns
agent-prompts Copy-paste prompts for common tasks

Examples include Docker Compose setups, SQL template routes, multi-database configs, and a read-only MCP workflow (examples/mcp-readonly/).

Example MCP config shape (from the plugin repo):

{
  "mcpServers": {
    "prest": {
      "command": "prest-mcp",
      "env": {
        "PREST_MCP_URL": "${PREST_MCP_URL}",
        "PREST_MCP_TOKEN": "${PREST_MCP_TOKEN}"
      }
    }
  }
}
Task Use
Agent calls prest.list_databases / select tools MCP via prest-mcp/_mcp
Agent follows pREST skills (config, SQL routes, security) prest-openclaw plugin
Least-privilege DB access Read-only PostgreSQL role

Adapter vs plugins — when to use what

  • Need live database queries — install prest-mcp and run pREST v2.1.0+ with /_mcp available. The adapter is required for stdio-only clients (Cursor, Claude Desktop, VS Code Copilot, Cline, Continue).
  • Need config, SQL route, or security guidance — install the Cursor or OpenClaw plugin. Plugins do not replace MCP; they teach the agent how to work with pREST safely.
  • HTTP-capable MCP clients — can call /_mcp directly without prest-mcp. See the MCP tutorial curl walkthrough.
  • Best practice — use prest-mcp for live tools and the matching plugin for rules/skills. Both together give agents query access plus pREST-specific workflows.

Quick start paths

Cursor

  1. Run pREST v2.1.0+ with /_mcp reachable — verify with curl -s http://localhost:3000/_mcp | head
  2. brew install prest/tap/prest-mcp
  3. Add .cursor/mcp.json with the stdio config above
  4. Restart Cursor; confirm prest server is connected in Settings → MCP
  5. Optional: install prest-cursor for rules and skills

OpenClaw

  1. openclaw plugins install clawhub:@prest/prest-openclaw
  2. Run pREST v2.1.0+ with /_mcp available
  3. brew install prest/tap/prest-mcp
  4. Set PREST_MCP_URL=http://localhost:3000/_mcp (and PREST_MCP_TOKEN if auth is on)
  5. Wire MCP in OpenClaw config using prest-mcp; restart gateway

End-to-end walkthrough: PostgreSQL to AI agent.

Security defaults

  • Prefer a read-only PostgreSQL role for agent workflows
  • 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
  • Set access.restrict = true with explicit [[access.tables]] in production
  • Use environment variables for secrets — never commit real credentials or JWTs to git

FAQ

What is the prest-mcp adapter?

prest-mcp is the official stdio adapter for pREST’s HTTP MCP endpoint at /_mcp. It forwards JSON-RPC between stdin/stdout and POST /_mcp. It is a transport bridge only — tools, catalog discovery, and SQL live in pREST, not in the adapter.

What is the difference between prest-mcp and pREST plugins?

prest-mcp enables live MCP tool calls (list tables, describe columns, select rows). Cursor and OpenClaw plugins provide rules, skills, and examples that guide agents on pREST configuration, SQL routes, and security. Plugins do not implement MCP tools or replace the adapter.

How do I connect Cursor to PostgreSQL via pREST?

Run pREST v2.1.0+, install prest-mcp (brew install prest/tap/prest-mcp), and add a stdio entry in .cursor/mcp.json with PREST_MCP_URL pointing to http://localhost:3000/_mcp. Restart Cursor and verify tools appear. Optionally install the prest-cursor plugin for additional guidance.

What skills does the OpenClaw plugin include?

Nine skills: generate-config, generate-sql-route, review-security, setup-mcp, explain-config, prest-core-guidance, prest-security-guidance, prest-mcp-guidance, and agent-prompts. Examples cover Docker Compose, SQL routes, multi-database configs, and read-only MCP workflows.

Do I need prest-mcp if my client supports HTTP MCP?

No. HTTP-capable clients can POST JSON-RPC directly to /_mcp. Use prest-mcp when your client only launches stdio MCP servers — Cursor, Claude Desktop, VS Code Copilot, and most IDE integrations fall in this category.

Where is the official pREST AI documentation?

docs.prestd.com/ai — MCP overview, adapter install, per-client guides (Cursor, VS Code, Claude, other tools), read-only Postgres setup, and plugin docs for Cursor and OpenClaw.

Also from Insurgency Labs

Teams wiring read-only agent access to Postgres via pREST MCP may also want read-only delivery metrics from GitHub — DeliveryCompass surfaces PR cycle time and review patterns for engineering managers without write access to repos. See the DeliveryCompass overview. Free during Early Access; not a Jira replacement and does not measure deploy-based DORA.