Skip to content

postgrestRequest returns PostgREST error responses as successful results #540

Closed

Description

@irisfield

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

When PostgREST answers a postgrestRequest call with an error status, the tool returns the error body as a normal result and isError is not set. A request for a table that does not exist, or with a malformed filter, looks like a successful call.

To Reproduce

  1. Run mcp-server-postgrest against a Supabase project's REST API:

    mcp-server-postgrest --apiUrl https://<project-ref>.supabase.co/rest/v1 --apiKey <publishable key> --schema public
    
  2. Call postgrestRequest with { "method": "GET", "path": "/no_such_table?select=*" }.

  3. The call returns isError: false and:

    {"result":{"code":"PGRST205","details":null,"hint":null,"message":"Could not find the table 'public.no_such_table' in the schema cache"}}
  4. Call it with { "method": "GET", "path": "/no_such_table?select=*&bad=" }. This also returns isError: false:

    {"result":{"code":"PGRST100","details":"unexpected end of input expecting \"not\" or operator (eq, gt, ...)","hint":null,"message":"\"failed to parse filter ()\" (line 1, column 1)"}}
  5. Start the server with an invalid --apiKey and call it with { "method": "GET", "path": "/" }. This also returns isError: false:

    {"result":{"message":"Invalid API key","hint":"Double check your Supabase `anon` or `service_role` API key."}}

Expected behavior

A response with an error status is returned as an error (isError: true) that includes the status code and the response body, so the caller can tell the request failed.

System information

  • OS: Ubuntu (WSL2)
  • Browser: N/A
  • Version of @supabase/mcp-server-postgrest: 0.2.0
  • Version of Node.js: 24.15.0

Activity

  1. added a commit that references this issue on Nov 17, 2026
    d907bf5
  2. added a commit that references this issue on Nov 17, 2026
    ffa50d2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions