PostgREST
MCP server for PostgREST — REST API layer for PostgreSQL databases.
What it can do
- Pg Get Schema: Get the PostgREST OpenAPI schema — lists all available tables, views, functions, and their columns/types. Use this first to discover the database structure.
- Pg Describe Table: Get detailed column information for a table/view — column names, types, formats, required fields, defaults, and constraints. Parsed from the OpenAPI schema.
- Pg List Records: List records from a table/view with filtering, column selection, ordering, and pagination. Filter syntax (PostgREST operators): age=gt.18 — greater than status=eq.active — equals name
What data it sees
Do you need an account
An API key from the service settings is required
MCP server for PostgREST — REST API layer for PostgreSQL databases.
Features
- Discover database schema (tables, views, functions, columns)
- Query records with PostgREST filter syntax (eq, gt, like, in, fts, or)
- Resource embedding — JOIN related tables via select parameter
- Full CRUD operations (insert, update, upsert, delete, replace)
- Call stored PostgreSQL functions via RPC
- Count records with exact, planned, or estimated methods
10 Tools
Schema: get OpenAPI schema, describe table columns/types Read: list records with filters/select/order/pagination, count records, call functions (RPC) Write: insert, update, upsert (merge/ignore duplicates), delete, replace (PUT)
Configuration
- POSTGREST_URL — Your PostgREST server URL (e.g. http://localhost:3000)
- POSTGREST_TOKEN — JWT token for authenticated requests (optional)
How to connect
How to connect PostgREST to Claude
The server address to paste into Claude settings:
https://postgrest--node2flow.run.tools
- Open Claude (claude.ai or the desktop app).
- Go to Settings → Connectors.
- Click Add custom connector.
- Paste the server address copied below into Remote MCP server URL and click Add.
- In a chat, click + → Connectors and switch the new connector on.
Custom connectors are available on Free, Pro, Max, Team and Enterprise plans (Free is limited to one). On Team and Enterprise an organization Owner adds the connector first under Organization settings → Connectors.
Authorization
After you click Add, a sign-in window for the service opens. Sign in with your own account and approve access. Claude never sees your password.
How to connect PostgREST to ChatGPT
The server address to paste into ChatGPT settings:
https://postgrest--node2flow.run.tools
- Open ChatGPT in a browser (chatgpt.com). A Plus, Pro, Business, Enterprise or Edu plan is required.
- Turn on developer mode once: Settings → Apps → Advanced settings → Developer mode.
- Open Settings → Connectors and click Create.
- Fill in the form: Name (anything), Description (one line about what the service does), MCP server URL (copy it below).
- Under Authentication choose OAuth if the service requires sign-in, otherwise None. Click Create.
- In a new chat open + → Apps/Connectors and enable the connector.
OpenAI has renamed this section before (Connectors → Apps/Plugins). If the label differs, search settings for "developer mode". On Business/Enterprise workspaces an admin must allow custom connectors first.
Authorization
On first use ChatGPT opens the service's sign-in window. Sign in and approve access.
How to connect PostgREST to Cursor
The server address to paste into Cursor settings:
https://postgrest--node2flow.run.tools
Fastest: click Open in Cursor below and confirm the prompt.
Manually:
- In Cursor open Settings → Cursor Settings → MCP and click Add new global MCP server.
- Paste the JSON copied below into
~/.cursor/mcp.json(per project:.cursor/mcp.jsonin the repo root). - Save the file. The server appears in the MCP list; authorize it there if asked.
Authorization
If the service needs sign-in, an authorize button appears next to the server in the MCP list.
Server tool list (10)
Raw names from tools/list. Only developers need these.
| pg_get_schema | Get the PostgREST OpenAPI schema — lists all available tables, views, functions, and their columns/types. Use this first to discover the database structure. |
| pg_describe_table | Get detailed column information for a table/view — column names, types, formats, required fields, defaults, and constraints. Parsed from the OpenAPI schema. |
| pg_list_records | List records from a table/view with filtering, column selection, ordering, and pagination. Filter syntax (PostgREST operators): age=gt.18 — greater than status=eq.active — equals name=ilike.*john* — case-insensitive LIKE id=in.(1,2,3) — IN list deleted_at=is.null — NULL check or=(age.lt.18,age.gt.65) — OR conditions Select syntax (column selection + resource embedding): id,name,email — specific columns *,orders(*) — embed related table (JOIN) id,user:user_id(name) — renamed embed with column selection Order syntax: created_at.desc — descending status.asc,name.desc — multiple columns |
| pg_count_records | Count records in a table/view matching optional filters. Returns count using exact (precise but slower), planned (fast estimate from query planner), or estimated method. |
| pg_call_function | Call a PostgreSQL function/procedure via RPC. Use POST (default) for volatile functions, GET for immutable/stable functions. Parameters are passed as JSON body (POST) or query string (GET). |
| pg_insert_records | Insert one or more records into a table. Pass a single object or array of objects. Use return="representation" to get the created records back. |
| pg_update_records | Update records matching a filter. IMPORTANT: filter is required to prevent accidental full-table updates. Use return="representation" to see updated records. |
| pg_upsert_records | Insert or update records (upsert). Uses "merge-duplicates" (update existing) or "ignore-duplicates" (skip existing) resolution. Conflict detection uses primary key by default, or specify on_conflict column. |
| pg_delete_records | Delete records matching a filter. IMPORTANT: filter is required to prevent accidental full-table deletion. Use return="representation" to see deleted records. |
| pg_replace_record | Full replace (PUT) a single record matching a filter. All columns must be specified including the primary key. Creates the record if it does not exist. |