Repository navigation
feat: URL-mode secret collection for create_edge_function_secret - #412
Conversation
Coverage Report for CI Build 35218446589Coverage increased (+0.2%) to 97.055%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
commit: |
…collection # Conflicts: # packages/mcp-server-supabase/src/server.test.ts
The dashboard route puts the project ref in the path
(/dashboard/project/{ref}/mcp/secrets), so the connect URL is now a
template with {ref} and {name} placeholders instead of a base URL plus
appended query parameters.
The signing fields now live in one `elicitation` block. `requestState`
is required inside it, so the type guarantees every elicitation feature
has the signed-state config. The runtime guard "secretCollection
requires costConfirmation" and its test are removed.
Before (0.12.0):
costConfirmation: {
requestStateKey, principal, ttlSeconds?, enabledTools
}
After:
elicitation: {
requestState: { key, principal, ttlSeconds? },
costConfirmation?: { enabledTools },
secretCollection?: { connectUrlTemplate },
}
Runtime behaviour for existing callers is unchanged: one HMAC codec
created lazily when a feature that mints state is enabled, bound to
method + principal, with TTL, tool/project/name scoping and reissue
semantics as before. Removing the guard also allows a new shape: a
host can now enable URL-mode secret collection without cost
confirmation.
BREAKING CHANGE: costConfirmation.requestStateKey, .principal and
.ttlSeconds are removed. Pass elicitation.requestState and keep
enabledTools under elicitation.costConfirmation. Hosted callers migrate
with their package bump; the exact 0.12.0 pin protects them until then.
`replace: true` skips the 10 minute resume-by-key shortcut and issues the dashboard URL elicitation again. Default false keeps the current behaviour: a recent update is reported as stored without asking again. The unsupported-client check and accept/reissue recovery are unchanged, and `replace` is not part of the signed state. Result text changes: - decline and cancel: "Not confirmed. If you already saved it in the dashboard, it is stored." The structured result drops `stored: false` and keeps `status`. - accept: "The dashboard reports an update to <name> since this request." - fresh call within 10 minutes: "The dashboard reports an update to <name> <N> seconds ago." Other structured results are unchanged. One focused test covers `replace: true`.
## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. YES ## What kind of change does this PR introduce? Initial build of the URL mode interstitial. Has complete mock data to be able to view different states (this will be stripped out in the end). A starting point for us to use as an intercept. This is linked with @barryroodt ticket in the MCP project. supabase/mcp#412 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added an authenticated MCP Secrets page for securely storing API secrets requested by AI tools. - Added provider-aware guidance for OpenAI, Anthropic, Resend, and Stripe keys, including validation warnings and dashboard links. - Added clear success, cancellation, expiration, error, and wrong-account states with account switching. - Added loading placeholders, secret visibility controls, overwrite warnings, and accessibility announcements. - **Bug Fixes** - Improved interstitial animations to respect reduced-motion preferences. - Preserved return destinations and related parameters during sign-in flows. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
|
Couple feedback items on the UX side, neither seems blocking for this MCP-side code, just unexpected: First, the UI says:
That wording seems specific to the MCP Inspector's UI, are we sure other clients will show the same button, or even require user confirmation? Seems like this should be more generic. Second, I notice that if I click "Reopen in browser" after submitting a secret, it allows me to input the secret again. That seems innocent from a security POV, but it is a little confusing UX because I can't tell from looking at the page if the elicitation was fulfilled (other than the warning about overwriting an existing secret). I'd expect this flow to feel similar to one-time login links, where you get feedback about whether a link was already used. I see there is a placeholder |
mattrossman
left a comment
There was a problem hiding this comment.
I tested this in the MCP Inspector since AFACT no current coding agents implement URL mode elicitations w/ modern protocol properly, and it generally worked as expected 👍
As long as it's behind a flag for us to test first I'm okay to proceed, comments above are generally non blocking but some are worth discussing.
🤖 I have created a release *beep* *boop* --- <details><summary>mcp-server-supabase: 0.13.0</summary> ## [0.13.0](mcp-server-supabase-v0.12.0...mcp-server-supabase-v0.13.0) (2026-09-17) ### ⚠ BREAKING CHANGES * **mcp:** confirm destructive SQL via elicitation and rename costConfirmation option ([#408](#408)) ### Features * add --http local HTTP entry to mcp-server-supabase ([#401](#401)) ([ff063b4](ff063b4)) * **management:** add v2 api client ([#419](#419)) ([02ca542](02ca542)) * **mcp:** confirm destructive SQL via elicitation and rename costConfirmation option ([#408](#408)) ([c9c4e3f](c9c4e3f)) * support skip_elicitations in the local HTTP server ([#434](#434)) ([9442e82](9442e82)) * URL-mode secret collection for create_edge_function_secret ([#412](#412)) ([fb88629](fb88629)) ### Bug Fixes * discourage host-filesystem access in raw-SQL tool descriptions ([#410](#410)) ([641ed1e](641ed1e)) </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>



Why
Add an Edge Function’s third-party API key without pasting it into the conversation.
What changed
elicitation.requestState:{key,principal,ttlSeconds?}(requestStateKeybecomeskey).elicitation.confirmation:{enabledTools:readonly ElicitationToolName[]}selects unified cost/SQL forms;enabledToolsis explicit, with no implicit library all-tools default, and[]disables forms.elicitation.secretCollection:{connectUrlTemplate}is independently optional.How to test
Optional manual checks—not reported as run. Use existing credentials and authorized test resources. Accepting cost/SQL actions or saving a secret makes real writes and may incur costs.
Follow setup, install dependencies, then run
pnpm dev:http --port 3111 --api-url https://api.supabase.green.Connect Inspector 2.5.0 Modern with both form and URL support to
http://127.0.0.1:3111/mcp?project_ref=REF&read_only=falsewithAuthorization: Bearer <PAT>; omitfeaturesandskip_elicitationsfor normal local defaults.project_reffor an unscoped connection with account tools available. On an eligible billablecreate_projectpath, inspect and decline the confirmation to avoid creating a project. Restoreproject_ref=REFfor the SQL and secret checks.execute_sql/apply_migrationconfirmations.create_edge_function_secretwith a freshname(no value). Save only in Dashboard, return to Inspector and accept within 120s; expectstored:true. Legacy/non-URL clients should not list the tool.Trade-offs
updated_at>=issued_at;stored:trueis not a receipt; another collaborator’s write can satisfy it.--secret-url-template.