PostgREST

MCP server for PostgREST — REST API layer for PostgreSQL databases.

Community: Submitted by a user or imported; check the owner before granting accessOnlineAPI key requiredGlobalFreeCan modify data

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

  1. Open Claude (claude.ai or the desktop app).
  2. Go to Settings → Connectors.
  3. Click Add custom connector.
  4. Paste the server address copied below into Remote MCP server URL and click Add.
  5. 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

  1. Open ChatGPT in a browser (chatgpt.com). A Plus, Pro, Business, Enterprise or Edu plan is required.
  2. Turn on developer mode once: Settings → Apps → Advanced settings → Developer mode.
  3. Open Settings → Connectors and click Create.
  4. Fill in the form: Name (anything), Description (one line about what the service does), MCP server URL (copy it below).
  5. Under Authentication choose OAuth if the service requires sign-in, otherwise None. Click Create.
  6. 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:

  1. In Cursor open Settings → Cursor Settings → MCP and click Add new global MCP server.
  2. Paste the JSON copied below into ~/.cursor/mcp.json (per project: .cursor/mcp.json in the repo root).
  3. 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_schemaGet the PostgREST OpenAPI schema — lists all available tables, views, functions, and their columns/types. Use this first to discover the database structure.
pg_describe_tableGet detailed column information for a table/view — column names, types, formats, required fields, defaults, and constraints. Parsed from the OpenAPI schema.
pg_list_recordsList 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_recordsCount 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_functionCall 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_recordsInsert 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_recordsUpdate records matching a filter. IMPORTANT: filter is required to prevent accidental full-table updates. Use return="representation" to see updated records.
pg_upsert_recordsInsert 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_recordsDelete records matching a filter. IMPORTANT: filter is required to prevent accidental full-table deletion. Use return="representation" to see deleted records.
pg_replace_recordFull 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.