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

Use with Cursor

Connect Cursor to PostgreSQL through pREST’s read-only MCP tools. The agent can discover schemas and query data via your running pREST instance.

pREST speaks MCP over HTTP at /_mcp. Cursor launches stdio MCP servers, so you need the official prest-mcp adapter as a bridge.

Requires pREST v2.1.0+.

For Cursor rules and skills (separate from MCP), see pREST for Cursor plugin.


Prerequisites

  • pREST running locally or on a reachable host (see Get pREST)

  • prest-mcp installed (Homebrew, Go, or Docker)

  • Cursor with MCP support enabled

Verify the HTTP endpoint before configuring Cursor:

curl -s http://localhost:3000/_mcp | head

You should see JSON with "name": "prest" and a tools array. If auth is enabled, include your usual Authorization header.

Prefer a read-only PostgreSQL role for AI access.


Install the adapter

brew install prest/tap/prest-mcp

Other options: Install pREST MCP Adapter. Confirm the binary is on your PATH:


Configure Cursor

Create or edit .cursor/mcp.json in your project root:

With authentication

When auth is enabled on pREST:

Prefer injecting the token from your environment or a secret store rather than committing JWTs to git. If you must keep secrets out of the repo, use Cursor’s user-level MCP settings instead of the project file.

Absolute path

If Cursor cannot find prest-mcp on PATH:

On Intel Mac Homebrew installs, the path is often /usr/local/bin/prest-mcp.


Verify in Cursor

  1. Restart Cursor or reload MCP servers from Settings β†’ MCP.

  2. Confirm the prest server shows as connected.

  3. Ask the agent something that needs catalog access, for example:

    • β€œList databases available through pREST.”

    • β€œDescribe the public.users table.”

    • β€œSelect the first 5 rows from public.orders ordered by id.”

The agent should call tools such as prest.list_databases, prest.describe_table, or prest.select.{database}.{schema}.{table}. Tool behavior and limits are documented in MCP over HTTP.


Optional: Docker-backed adapter

If you prefer not to install a local binary:

host.docker.internal reaches pREST on the host from Docker Desktop (macOS/Windows). On Linux you may need --add-host=host.docker.internal:host-gateway or the host’s LAN IP.


Troubleshooting

Symptom
Fix

Server fails to start

Ensure prest-mcp is installed and the command path is correct

Tools never appear

Confirm curl to /_mcp works; check ACL / empty catalog

Auth errors

Set PREST_MCP_TOKEN to a valid JWT

Connection refused

Start pREST; match host/port in PREST_MCP_URL

Stale tools after schema change

Restart pREST (schema-aware tools are generated at startup)

More detail: Install pREST MCP Adapter and MCP over HTTP.


Next steps

Last updated