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
pREST running locally or on a reachable host (see Get pREST)
VS Code with GitHub Copilot Chat and Agent mode available
Verify the HTTP endpoint before configuring VS Code:
curl -s http://localhost:3000/_mcp | headYou 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".
Workspace config (recommended)
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.
Optional: MCP gallery / registry
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
Start or restart the
prestMCP server from the VS Code MCP UI (or reload the window).Open Copilot Chat and switch to Agent mode.
Confirm the
presttools are available to the agent.Ask something that needs catalog access, for example:
โList databases available through pREST.โ
โDescribe the
public.userstable.โโSelect the first 5 rows from
public.ordersordered byid.โ
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
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
Related documentation
Last updated