Skip to content

feat: submit_feedback and delete_feedback tools - #474

Merged
mattrossman merged 8 commits into
mainfrom
mattrossman/ai-1017-add-feedback-submission-and-deletion-to-mcp
Oct 20, 2026
Merged

mattrossman merged 8 commits into
mainfrom
mattrossman/ai-1017-add-feedback-submission-and-deletion-to-mcp

Conversation

@mattrossman

@mattrossman mattrossman commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Why

Supabase CLI added supabase feedback commands recently to let agents / humans share feedback about our tooling. We also want to capture feedback from users of our MCP server (e.g. ChatGPT, Claude web, etc.) for when CLI isn't available.

What

New MCP tools under a new feedback feature group:

  • submit_feedback
  • delete_feedback

The tools write to the prod interfaces_feedback table normally, or staging for any other API URL. This PR includes support for the stdio / --http server, other platforms can opt-in later (e.g. we can omit feedback tools on self-hosted so that it doesn't phone home).

For the package implementation,user_id comes from the X-Gotrue-Id header on a Management API response, which the CLI relies on too, but remote MCP can populate this ID a different way. The MCP client name and version go in metadata.

I hide both tools in read_only mode, since even though this doesn't impact users' projects, the feedback mutates a remote table.

How to test

Start the dev server with --api-url https://api.supabase.green and connect an MCP client. Then ask it to submit throwaway feedback:

Use the Supabase MCP to submit feedback saying "Test feedback from reviewing supabase/mcp#474, please ignore". Show me the delete token.

Check the new row in the interfaces_staging branch of the supabase project.Then delete it:

Delete that feedback using the delete token.

I ran a round trip with Claude Code in staging, see sample row:

{"idx":0,"id":488,"created_at":"2026-10-19 20:20:46.389158+00","feedback":"Test feedback from reviewing supabase/mcp#474, please ignore","delete_token":"4f354c21-4498-4232-8d7c-21b280bfdc2e","user_agent":"supabase-mcp/0.14.0","user_id":"20e65d1b-489d-4b03-9e0b-e58f7b9aff45","project_ref":"wzukuhfteohjnlxczohs","metadata":"{\"source\": \"mcp\", \"client_name\": \"claude-code\", \"client_version\": \"2.1.303\"}"}
CleanShot 2026-10-19 at 4 20 53 PM@2x CleanShot 2026-10-19 at 4 23 08 PM@2x

Notes:

Related:

Follow-ups:

Closes AI-1017

@coveralls

coveralls commented Oct 19, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 39323804828

Coverage increased (+0.03%) to 97.376%

Details

  • Coverage increased (+0.03%) from the base build.
  • Patch coverage: 4 uncovered changes across 1 file (207 of 211 lines covered, 98.1%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
packages/mcp-server-supabase/src/tools/feedback-tools.ts 81 77 95.06%
Total (6 files) 211 207 98.1%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 4932
Covered Lines: 4824
Line Coverage: 97.81%
Relevant Branches: 860
Covered Branches: 816
Branch Coverage: 94.88%
Branches in Coverage %: Yes
Coverage Strength: 105.62 hits per line

💛 - Coveralls

@mattrossman mattrossman changed the title feat(mcp-server-supabase): add submit_feedback and delete_feedback tools feat: add submit_feedback and delete_feedback tools Oct 19, 2026
@mattrossman mattrossman changed the title feat: add submit_feedback and delete_feedback tools feat: submit_feedback and delete_feedback tools Oct 19, 2026
@mattrossman
mattrossman marked this pull request as ready for review October 19, 2026 21:01
@mattrossman
mattrossman requested a review from a team as a code owner October 19, 2026 21:01

@barryroodt barryroodt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks @mattrossman;

Approving with a small non-blocking, inline question.

@mattrossman
mattrossman merged commit f50318a into main Oct 20, 2026
5 checks passed
@supabase-releaser supabase-releaser Bot mentioned this pull request Oct 20, 2026
Rodriguespn pushed a commit that referenced this pull request Oct 29, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>mcp-server-supabase: 0.15.0</summary>

##
[0.15.0](mcp-server-supabase-v0.14.0...mcp-server-supabase-v0.15.0)
(2026-10-29)


### Features

* `submit_feedback` and `delete_feedback` tools
([#474](#474))
([f50318a](f50318a))
* mark client-caused tool errors as ToolCallerError
([#480](#480))
([4a619c1](4a619c1))
* **mcp-server-supabase:** detect instant elicitation cancels
([#483](#483))
([5ad1a2a](5ad1a2a))


### Bug Fixes

* **mcp-server-supabase:** return a tool error when a confirmation
expires ([#490](#490))
([5ab9a98](5ab9a98))
* **mcp-server-supabase:** use POSIX path resolution for edge function
filenames ([#393](#393))
([55d2d24](55d2d24))
* **mcp:** don't split an UPDATE on a semicolon inside a dollar-quoted
value ([#482](#482))
([9f07410](9f07410))
* **mcp:** don't split an UPDATE on a semicolon inside a quoted value
([#459](#459))
([6d93b50](6d93b50))
* **pg-meta:** order list_tables columns by ordinal position
([c242e63](c242e63))
* **pg-meta:** order primary key columns by key position and exclude
INCLUDE columns ([#382](#382))
([25d357c](25d357c))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: supabase-releaser[bot] <223506987+supabase-releaser[bot]@users.noreply.github.com>
kanadgupta added a commit to supabase/supabase that referenced this pull request Nov 2, 2026
## Problem

The CLI (supabase/cli#5988) and MCP server (supabase/mcp#474) only
submit and delete feedback. Neither reads it back. But `anon` can still
read a row's feedback text with its delete token, so a leaked token
exposes the submission.

Linear: [CLI-2406](https://linear.app/supabase/issue/CLI-2406)

## Solution

New migration on `public.interfaces_feedback`:

- Revoke all privileges from `anon` and `authenticated`, then grant
`anon` only `delete` and `select (delete_token)`.
- Rename the select policy to "Token holders can match their own
feedback for deletion".
- Update the `delete_token` column comment to say it authorizes deletes
only.

Key choices:

- **The select policy and `select (delete_token)` stay.** Clients delete
with a `delete_token=eq.<token>` filter. A filtered delete needs select
on the filtered column and must pass the select policy. Tested locally:
revoking the grant makes deletes fail with `42501`, and dropping the
policy makes them silently match 0 rows.
- **Privileges are reset, not revoked column by column.** Default grants
differ between Postgres images. On the current local image, `anon` gets
every table privilege by default, which overrides column-level grants.
Starting from `revoke all` gives the same end state everywhere.

No client changes are needed. The delete policy and
`submit_interfaces_feedback` are unchanged.

## Review instructions

Run these against a local stack (`supabase db reset`) or this PR's
preview branch. Replace the placeholders:

- `<PROJECT_URL>`: for example `http://127.0.0.1:54321`
- `<ANON_KEY>`: the project's anon key
- `<DELETE_TOKEN>`: the token returned in step 1 or 5

1. Submit feedback. The response is the delete token.

   ```bash
   curl -X POST '<PROJECT_URL>/rest/v1/rpc/submit_interfaces_feedback' \
     -H 'apikey: <ANON_KEY>' \
     -H 'Content-Type: application/json' \
     -d '{"feedback": "test"}'
   ```

2. Try to read the feedback with the token. Expect `401` with code
`42501`.

   ```bash
curl
'<PROJECT_URL>/rest/v1/interfaces_feedback?select=feedback&delete_token=eq.<DELETE_TOKEN>'
\
     -H 'apikey: <ANON_KEY>' \
     -H 'x-feedback-token: <DELETE_TOKEN>'
   ```

Only `select=delete_token` succeeds. Every other column returns `42501`.

3. Delete without the token header. Expect `Content-Range: */0`.

   ```bash
curl -i -X DELETE
'<PROJECT_URL>/rest/v1/interfaces_feedback?delete_token=eq.<DELETE_TOKEN>'
\
     -H 'apikey: <ANON_KEY>' \
     -H 'Prefer: count=exact'
   ```

4. Delete with the token header. Expect `Content-Range: */1`.

   ```bash
curl -i -X DELETE
'<PROJECT_URL>/rest/v1/interfaces_feedback?delete_token=eq.<DELETE_TOKEN>'
\
     -H 'apikey: <ANON_KEY>' \
     -H 'Prefer: count=exact' \
     -H 'x-feedback-token: <DELETE_TOKEN>'
   ```

5. Submit feedback with a project ref and user ID.

   ```bash
   curl -X POST '<PROJECT_URL>/rest/v1/rpc/submit_interfaces_feedback' \
     -H 'apikey: <ANON_KEY>' \
     -H 'Content-Type: application/json' \
-d '{"feedback": "test", "project_ref": "my-project", "user_id":
"my-user"}'
   ```

6. Delete with only the token header. Expect `Content-Range: */0`.

   ```bash
curl -i -X DELETE
'<PROJECT_URL>/rest/v1/interfaces_feedback?delete_token=eq.<DELETE_TOKEN>'
\
     -H 'apikey: <ANON_KEY>' \
     -H 'Prefer: count=exact' \
     -H 'x-feedback-token: <DELETE_TOKEN>'
   ```

7. Delete with all three headers. Expect `Content-Range: */1`.

   ```bash
curl -i -X DELETE
'<PROJECT_URL>/rest/v1/interfaces_feedback?delete_token=eq.<DELETE_TOKEN>'
\
     -H 'apikey: <ANON_KEY>' \
     -H 'Prefer: count=exact' \
     -H 'x-feedback-token: <DELETE_TOKEN>' \
     -H 'x-feedback-project-ref: my-project' \
     -H 'x-feedback-user-id: my-user'
   ```

8. Optional: run `supabase feedback add` and `supabase feedback delete`
against this PR's preview branch. Both succeed (already confirmed).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants