feat(mcp): add project cost confirmation elicitation #391
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 440 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.364
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #391"
general
weight: 0.35
gregnr
What kind of change does this PR introduce?
Feature.
Implements the
create_projectslice of AI-1091.What is the current behavior?
create_projectrequires a validconfirm_cost_idbefore execution. Clients without elicitation capability keep this flow.What is the new behavior?
When
costConfirmationis configured withenabledTools: ['create_project'], form-capable clients can confirm the quoted cost insidecreate_projectthrough the SDK-nativeinputRequiredandinputResponseflow. The signed request state binds the method and authenticated principal, and carriestool: '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_costflow. A precomputed legacy ID cannot bypass confirmation for a form-capable request.This PR covers
create_projectonly. It does not change stdio, and there is nocreate_branchimplementation in this PR.How to Review
1. Server setup
-
packages/mcp-server-supabase/src/server.ts- Inspect how
costConfirmation, itsenabledTools, 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, andpackages/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.
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 buildpassed.pnpm test:packed-platform-consumerpassed all 3 public-surface assertions.biome ci .passed.Additional context
This is a fresh, project-only implementation separate from the earlier draft in #389.
When confirmation is configured, the public schema makes
confirm_cost_idoptional so form-capable clients can callcreate_projectdirectly. 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.