Repository navigation
Simplify hosted cost confirmation with SDK elicitation - #389
Closed
barryroodt wants to merge 3 commits into
Closed
barryroodt wants to merge 3 commits into
barryroodt wants to merge 3 commits into
Conversation
commit: |
4 tasks
Contributor
Author
|
Closing this as superseded by #391, which provides a fresh project-only implementation against |
barryroodt
added a commit
that referenced
this pull request
Sep 3, 2026
## What kind of change does this PR introduce? Feature. Implements the `create_project` slice of [AI-1091](https://linear.app/supabase/issue/AI-1091/ship-form-mode-cost-confirmation-stage-a-supabasemcp). ## What is the current behavior? `create_project` requires a valid `confirm_cost_id` before execution. Clients without elicitation capability keep this flow. ## What is the new behavior? When `costConfirmation` is configured with `enabledTools: ['create_project']`, form-capable clients can confirm the quoted cost inside `create_project` through the SDK-native `inputRequired` and `inputResponse` flow. The signed request state binds the method and authenticated principal, and carries `tool: 'create_project'`, the project name, region, organization, and quoted cost. The form has no properties. Consent lives in the elicitation action, so clients use their native accept, decline, and cancel controls. Accept creates the project. Decline or cancel returns a normal result without creating anything. Argument mismatches are rejected, and cost drift starts confirmation again. A state signed for the wrong tool fails before argument or acceptance checks. Empty elicitation mode maps count as form-capable; URL-only or absent elicitation uses the legacy `confirm_cost` flow. A precomputed legacy ID cannot bypass confirmation for a form-capable request. This PR covers `create_project` only. It does not change stdio, and there is no `create_branch` implementation in this PR. ## How to Review 1. **Server setup** - `packages/mcp-server-supabase/src/server.ts` - Inspect how `costConfirmation`, its `enabledTools`, and request state enter the server. 2. **Confirmation flow and executor seam** - `packages/mcp-server-supabase/src/tools/cost-confirmation.ts`, `packages/mcp-server-supabase/src/tools/account-tools.ts`, `packages/mcp-server-supabase/src/tools/util.ts`, and `packages/mcp-utils/src/server.ts` - Inspect the private module that owns the project state discriminator, action-only schema, and capability helper, plus signed state, project creation behavior, request-state verification, and SDK result passthrough. 3. **Behavioral coverage** - `packages/mcp-server-supabase/src/server.test.ts` - Inspect the modern and legacy paths. - [ ] Does capability detection select the right lane? - [ ] Is signed state bound to the right request, tool, and principal? - [ ] Do decline and cancel avoid project creation? - [ ] Does the legacy flow remain strict? ## Verification - `pnpm --filter @supabase/mcp-server-supabase test src/server.test.ts -t "create_project cost confirmation via elicitation"` passed 8 tests. - `pnpm --filter @supabase/mcp-server-supabase build` passed. - `pnpm test:packed-platform-consumer` passed all 3 public-surface assertions. - `biome ci .` passed. ## Additional context This is a fresh, project-only implementation separate from the earlier draft in [#389](#389). When confirmation is configured, the public schema makes `confirm_cost_id` optional so form-capable clients can call `create_project` directly. Capability-free execution still requires a valid ID. Known limits remain: signed state has no single-use replay prevention, and the existing final cost-check concurrency race remains. The platform PR will first pin the pkg.pr.new preview, then switch to the released npm version. This implementation was AI-assisted. The verification evidence is above, and human review is required before merge.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
This replacement keeps the hosted cost-confirmation path small and on the public contracts we already approved: the official SDK’s
inputRequiredflow + mcp-utilsToolPolicy.It’s a draft stacked on
barryroodt/ai-1091-tool-policy-foundationat9ecf0bd. It supersedes #378 and #379 as the path under review, while both stay open as paused drafts until slice 1 and hosted acceptance prove this approach. I’ll decide when to close them.What changed
elicitUrlshapes, including the default and classicconfirm_costlegacy shim paths.elicitationblock tocreateSupabaseMcpServer. When supplied, its dependencies are required and fail closed.A regression against the real SDK showed that the widened modern output schema stripped
BranchResponse.with_data. The schema is now.loose(), preserving real API fields while accepted business output and the exact declined/cancelledstructuredContentremain valid.Per my 2026-08-28 decision, the kill switch falls back to the existing
confirm_costflow here. Hard-block behavior is deferred to the planned follow-up work.Legacy project discovery, branch discovery, cost confirmation, and creation output still match the baseline. Stdio remains on its existing hardcoded l egacy path.
Verification
Charter gates are green at
9f7eef207043ea3dffc81f99fcbb631b71516c35:Before merge
Hosted cross-instance acceptance stays with the platform PR. The external plan now matches that sequence.