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)
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.
PostgREST: connect to Claude, ChatGPT, Cursor · Connectors.fun