Skip to content

feat(mcp): add branch cost confirmation elicitation - #394

Open
barryroodt wants to merge 4 commits into
feat/hosted-project-cost-elicitationfrom
feat/branch-cost-elicitation
Open

feat(mcp): add branch cost confirmation elicitation#394
barryroodt wants to merge 4 commits into
feat/hosted-project-cost-elicitationfrom
feat/branch-cost-elicitation

Conversation

@barryroodt

@barryroodt barryroodt commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Stacked on #391. Review that first. This is part of AI-1091.

What kind of change does this PR introduce?

Feature: add form-mode cost confirmation to create_branch.

What is the current behavior?

#391 provides the shared confirmation codec/verifier, ServerContext, result passthrough, and project flow. Branch creation still uses the existing hash validation.

What is the new behavior?

Modern form clients can call create_branch without confirm_cost_id. They receive an action-only, property-less prompt for $0.01344/hr (about $9.68 over 30 days).

Acceptance creates the branch from signed arguments. Missing responses and changed costs re-prompt. A wrong-tool state or changed arguments fail. Decline and cancel create no branch.

Capability-free and URL-only clients keep hash validation. A supplied legacy ID cannot bypass the capable-client flow. Project-scoped injection works, and existing output fields such as with_data remain.

How to Review

  1. Server and shared state

    • packages/mcp-server-supabase/src/server.ts
    • packages/mcp-server-supabase/src/tools/cost-confirmation.ts
  2. Branch handler and pricing

    • packages/mcp-server-supabase/src/tools/branching-tools.ts
    • packages/mcp-server-supabase/src/pricing.ts
  3. Behavioral coverage

    • packages/mcp-server-supabase/src/server.test.ts
    • Inspect the capable, legacy, argument-binding, and project-scoped paths.
  • Is create_branch enabled only through the intended server path?
  • Does the discriminated state bind project ID, branch name, and BranchCost?
  • Do capable clients always use elicitation, even with a legacy ID?
  • Do accept, decline, cancellation, wrong-tool, and argument-change outcomes look correct?

Verification

  • pnpm --filter @supabase/mcp-server-supabase test src/server.test.ts -t "create_(project|branch) cost confirmation via elicitation" (17 passed)
  • pnpm --filter @supabase/mcp-server-supabase build (typecheck + build passed)
  • pnpm test:packed-platform-consumer (3 assertions passed)
  • pnpm exec biome ci . (passed)

Additional context

Commit 24535f1 chore: refresh management API types adds two generated lines to packages/mcp-server-supabase/src/management-api/types.ts because the CI generation gate detected upstream schema drift. Feature behavior and verification remain unchanged.

This does not change create_project, mcp-utils, platform adapters, stdio, pricing values, manifests, or docs.

Known limits: confirmations are not single-use, legacy IDs remain precomputable, and the branch rate remains the existing package constant.

AI-assisted; human review required.

@barryroodt
barryroodt requested a review from a team as a code owner August 29, 2026 07:18
@barryroodt barryroodt added the publish-preview Runs `publish-preview` workflow to publish preview packages via https://pkg.pr.new/ label Aug 29, 2026
@pkg-pr-new

pkg-pr-new Bot commented Aug 29, 2026

Copy link
Copy Markdown

Open in StackBlitz

pnpm add https://pkg.pr.new/@supabase/mcp-server-postgrest@4382f06
pnpm add https://pkg.pr.new/@supabase/mcp-server-supabase@4382f06
pnpm add https://pkg.pr.new/@supabase/mcp-utils@4382f06

commit: 4382f06

@barryroodt
barryroodt force-pushed the feat/branch-cost-elicitation branch from 24535f1 to c06b135 Compare August 31, 2026 08:15
@barryroodt barryroodt self-assigned this Aug 31, 2026
@coveralls

coveralls commented Aug 31, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 33491960331

Warning

No base build found for commit de9e9bb on feat/hosted-project-cost-elicitation.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 96.034%

Details

  • Patch coverage: 13 uncovered changes across 1 file (120 of 133 lines covered, 90.23%).

Uncovered Changes

File Changed Covered %
packages/mcp-server-supabase/src/tools/branching-tools.ts 116 103 88.79%
Total (3 files) 133 120 90.23%

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 3333
Covered Lines: 3218
Line Coverage: 96.55%
Relevant Branches: 449
Covered Branches: 414
Branch Coverage: 92.2%
Branches in Coverage %: Yes
Coverage Strength: 57.54 hits per line

💛 - Coveralls

@barryroodt
barryroodt force-pushed the feat/branch-cost-elicitation branch from c06b135 to bb4f0a7 Compare September 1, 2026 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

publish-preview Runs `publish-preview` workflow to publish preview packages via https://pkg.pr.new/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants