postgrestRequest returns PostgREST error responses as successful results

Aperta Adatta ai principianti
#540 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@irisfield ci sta già lavorando.

Dal 10/11/2026.

  • #541 di @irisfield — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
node.js, typescript
Ambito
api, backend

Direzione di ricerca

Trova l’implementazione di postgrestRequest nel pacchetto mcp-server-postgrest e leggi come gestisce la risposta HTTP e costruisce il risultato dello strumento. Controlla i test esistenti per quella richiesta oppure aggiungi una copertura per uno stato di errore se nell’issue non ne viene menzionato nessuno. Il lavoro è completato quando le risposte non riuscite restituiscono isError: true e includono il codice di stato e il corpo della risposta.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
TypeScript
Stelle
3k
Fork
432
Merge medio
1g 7h
PR unite (30g)
52

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di supabase/mcp

Tutte le issue di supabase/mcp

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.