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

Use with VS Code and Copilot

Connect GitHub Copilot in Visual Studio Code to PostgreSQL through pRESTโ€™s read-only MCP tools. In Agent mode, Copilot can discover schemas and query data via your running pREST instance.

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

Requires pREST v2.1.0+.

Official VS Code MCP docs: Add and manage MCP servers.

The pREST for Cursor plugin does not apply to VS Code. You still get full MCP tools through prest-mcp; only Cursor-specific rules and skills are unavailable here.


Prerequisites

Verify the HTTP endpoint before configuring VS Code:

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

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


Configure VS Code

VS Code MCP config uses a top-level servers key (not mcpServers). Each server entry includes "type": "stdio".

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

User config

For a global setup that applies across workspaces, run MCP: Open User Configuration from the Command Palette and add the same servers.prest block.

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. Use user-level MCP configuration when you need secrets out of the repo.

Absolute path

If VS Code cannot find prest-mcp on PATH:

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


VS Code can install servers from the MCP gallery or registry. The published package name is io.github.prest/prest.

After installing from the gallery, set PREST_MCP_URL (and PREST_MCP_TOKEN if needed) in the serverโ€™s environment so the adapter can reach your pREST instance. Details: Install pREST MCP Adapter.


Verify in Copilot Agent mode

  1. Start or restart the prest MCP server from the VS Code MCP UI (or reload the window).

  2. Open Copilot Chat and switch to Agent mode.

  3. Confirm the prest tools are available to the agent.

  4. Ask 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

Config ignored / wrong shape

Use "servers" (not mcpServers) and include "type": "stdio"

Tools never appear

Confirm curl to /_mcp works; check ACL / empty catalog; use Agent mode

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. VS Code reference: MCP servers in VS Code.


Next steps

Last updated