Skip to content

feat: support skip_elicitations in the local HTTP server - #434

Merged
barryroodt merged 3 commits into
mainfrom
barryroodt/ai-1217-http-skip-elicitations
Sep 15, 2026
Merged

barryroodt merged 3 commits into
mainfrom
barryroodt/ai-1217-http-skip-elicitations

Conversation

@barryroodt

Copy link
Copy Markdown
Contributor

Why

Let local HTTP callers opt out of cost elicitations per tool, matching platform #38134 (contract reference, not a deployment dependency).

Closes AI-1217.

What changed

  • Accept one skip_elicitations CSV parameter containing create_project and/or create_branch. Trim whitespace and ignore empty entries; omitted or blank preserves defaults.
  • Subtract only the selected tools from request-local elicitation support, restoring their existing cost-confirmation flow. This does not bypass costs, authorization, or read-only restrictions.
  • Return HTTP 400 for unknown names, SQL tools, case variants, repeated keys, and bracket-form arrays/objects. Update transport coverage and contributing guidance; no flag changes.

How to test

From the PR checkout root (branch barryroodt/ai-1217-http-skip-elicitations, containing package.json and packages/), use Node LTS and pnpm 10. Leave port 3111 alone; 3112 is an example, so choose a free port and substitute it consistently.

Build and start the no-create local check
mise install node pnpm
mise exec -- node --version
mise exec -- pnpm --version
mise exec -- pnpm install --frozen-lockfile
mise exec -- pnpm --config.enable-pre-post-scripts=true --filter '@supabase/mcp-server-supabase...' build
mise exec -- node packages/mcp-server-supabase/dist/cli.js --http --port 3112 --api-url http://127.0.0.1:1

Expect Node LTS, pnpm 10, and successful typechecks/builds for the package and its workspace dependency. Stop if installation requires registry authentication; the reviewer handles it, not an agent. The install recipe was not rerun during verification.

Keep this server running in terminal A. Its unreachable loopback API and the synthetic bearer below keep this check away from real resources. No credentials are needed.

Run the credential-free checks first. In terminal B, list tools with this form-capable modern request. Keep the method header and protocol metadata:

Synthetic curl commands and expected results
curl --silent --show-error --globoff --write-out '\nHTTP %{http_code}\n' \
  -H 'Mcp-Method: tools/list' \
  -H 'Authorization: Bearer synthetic-review-only' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -H 'MCP-Protocol-Version: 2026-07-28' \
  --data '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/list",
  "params": {
    "_meta": {
      "io.modelcontextprotocol/protocolVersion": "2026-07-28",
      "io.modelcontextprotocol/clientInfo": {
        "name": "skip-review-curl",
        "version": "1.0.0"
      },
      "io.modelcontextprotocol/clientCapabilities": {
        "elicitation": {
          "form": {}
        }
      }
    }
  }
}' \
  'http://127.0.0.1:3112/mcp?features=account,branching&skip_elicitations=create_project,create_branch'

Expect HTTP 200 and result.tools. Run this list request for each URL row, changing only the URL, and inspect each create tool's inputSchema.required:

Query appended to ?features=account,branching Project confirmation ID Branch confirmation ID
Nothing (omitted) Optional Optional
&skip_elicitations=create_branch Optional Required
&skip_elicitations=create_project Required Optional
&skip_elicitations=create_project,create_branch Required Required
&skip_elicitations= (blank) Optional Optional

With both skipped, get_cost and confirm_cost are listed. With omitted/blank, they are hidden for this form-capable request. To check CSV normalization, use &skip_elicitations=%20create_project%20,,create_branch,%20: expect the both-skipped schemas.

Run these two calls only with the both-skipped URL shown, never an unskipped create call:

curl --silent --show-error --globoff --write-out '\nHTTP %{http_code}\n' \
  -H 'Mcp-Method: tools/call' \
  -H 'Mcp-Name: create_project' \
  -H 'Authorization: Bearer synthetic-review-only' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -H 'MCP-Protocol-Version: 2026-07-28' \
  --data '{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "name": "create_project",
    "arguments": {
      "name": "synthetic-never-create",
      "region": "us-east-1",
      "organization_id": "synthetic-org"
    },
    "_meta": {
      "io.modelcontextprotocol/protocolVersion": "2026-07-28",
      "io.modelcontextprotocol/clientInfo": {
        "name": "skip-review-curl",
        "version": "1.0.0"
      },
      "io.modelcontextprotocol/clientCapabilities": {
        "elicitation": {
          "form": {}
        }
      }
    }
  }
}' \
  'http://127.0.0.1:3112/mcp?features=account,branching&skip_elicitations=create_project,create_branch'
curl --silent --show-error --globoff --write-out '\nHTTP %{http_code}\n' \
  -H 'Mcp-Method: tools/call' \
  -H 'Mcp-Name: create_branch' \
  -H 'Authorization: Bearer synthetic-review-only' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -H 'MCP-Protocol-Version: 2026-07-28' \
  --data '{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "tools/call",
  "params": {
    "name": "create_branch",
    "arguments": {
      "name": "synthetic-never-create",
      "project_id": "synthetic-project"
    },
    "_meta": {
      "io.modelcontextprotocol/protocolVersion": "2026-07-28",
      "io.modelcontextprotocol/clientInfo": {
        "name": "skip-review-curl",
        "version": "1.0.0"
      },
      "io.modelcontextprotocol/clientCapabilities": {
        "elicitation": {
          "form": {}
        }
      }
    }
  }
}' \
  'http://127.0.0.1:3112/mcp?features=account,branching&skip_elicitations=create_project,create_branch'

Each returns HTTP 200 with result.isError: true and a ZodError at confirm_cost_id: “User must confirm understanding of costs before creating a project/branch.” This is a tool error, not HTTP 400, and no form or resource is created. Do not supply the missing ID or attempt a repair.

Check invalid query handling:

curl --silent --show-error --globoff --write-out '\nHTTP %{http_code}\n' \
  -H 'Authorization: Bearer synthetic-review-only' \
  'http://127.0.0.1:3112/mcp?skip_elicitations=execute_sql'

Expect HTTP 400 naming the allowed create_project/create_branch values. Replace the query with each of these; all return 400:

  • skip_elicitations=apply_migration
  • skip_elicitations=Create_Project
  • skip_elicitations=create_branch&skip_elicitations=create_project
  • skip_elicitations%5B%5D=create_branch

The last two report skip_elicitations must be a single CSV string. When finished, Ctrl-C only the server you started. No resources need cleanup.

Optional: real Claude staging walkthrough (decline-only, not a no-create guarantee)

Strict no-create reviewers should stop after the synthetic check. A free project can be created without a form. Even a positive quote can become stale before the create call. A paid organization alone is not sufficient. Departing from this flow may create resources and incur real costs.

Use an existing staging PAT, a paid staging organization, an eligible disposable existing staging project in it, a valid region, and fresh project/branch names. Avoid concurrent organization/plan/project-count changes. Stop only your terminal A server, then restart it against staging:

mise exec -- node packages/mcp-server-supabase/dist/cli.js --http --port 3112 --api-url https://api.supabase.green

In terminal B, create a private temporary config. Do not edit .mcp.json or existing registrations:

MCP_REVIEW_CONFIG=$(mktemp "${TMPDIR:-/tmp}/supabase-skip-review.XXXXXX")

Open that exact path in your editor and save this single-server config, keeping the variable references literal:

{
  "mcpServers": {
    "supabase-skip-review": {
      "type": "http",
      "url": "${SUPABASE_REVIEW_URL}",
      "headers": { "Authorization": "Bearer ${SUPABASE_REVIEW_PAT}" }
    }
  }
}

Enter your existing PAT silently in interactive bash/zsh, one line at a time. Stop if empty. Do not enable tracing, paste the PAT as a command, print the environment, capture authorization headers, or acquire new credentials:

printf 'Existing staging PAT (silent): ' >&2
IFS= read -r -s SUPABASE_REVIEW_PAT
printf '\n' >&2
export SUPABASE_REVIEW_PAT

Start with both tools skipped, where get_cost is available, to quote project and branch costs before any unskipped project call:

export SUPABASE_REVIEW_URL='http://127.0.0.1:3112/mcp?features=account,branching&skip_elicitations=create_project,create_branch'
MCP_DISCOVERY_CACHE=0 claude --tools "" --strict-mcp-config --mcp-config "$MCP_REVIEW_CONFIG" --settings '{"disableAllHooks":true}' --permission-mode manual

Launch syntax was checked on Claude Code 2.1.272. Verify no managed, SDK, or policy-forced plugin hooks can auto-answer Elicitation/ElicitationResult. disableAllHooks does not disable those; stop if uncertain. In /mcp verify only supabase-skip-review is connected at the expected URL. Stop on authentication, configuration, or capability errors.

Paste this preflight prompt after replacing the organization:

Use only supabase-skip-review. Organization ID: [exact paid staging organization]. Call only get_cost with {type:"project",organization_id:"[org]"} and {type:"branch",organization_id:"[org]"}. Show exact type, amount and recurrence. Do not call confirm_cost or any create tool; do not chain actions. Stop after reporting quotes. If project amount is zero/unknown, stop: no project-form test is permitted.

Record the positive project quote, recurrence, and exact organization privately, then exit Claude fully. Start with the omitted URL below; repeat with each remaining row from the matrix above, including both-skipped and blank. Export exactly one URL and rerun the same launch command for every fresh session, with no --resume/--continue. Check /mcp each time. If the quote or target changes, repeat the separate both-skipped preflight first.

export SUPABASE_REVIEW_URL='http://127.0.0.1:3112/mcp?features=account,branching'
MCP_DISCOVERY_CACHE=0 claude --tools "" --strict-mcp-config --mcp-config "$MCP_REVIEW_CONFIG" --settings '{"disableAllHooks":true}' --permission-mode manual

Paste this prompt with your row, exact targets, and previously obtained quote. Do not accept any cost form. Ordinary tool-permission dialogs authorize execution; they are not server cost forms.

Environment: staging. Server: supabase-skip-review. Current matrix row: [row].
Organization ID: [paid staging org]. Existing eligible disposable project ref: [ref]. Region: [valid region]. Fresh project name: [name]. Fresh branch name: [name].
Use only this MCP server. Do not inspect config/environment/secrets or use built-in tools, other servers, direct HTTP, retries or fallbacks. No credentials acquisition, writes beyond the single specified guarded call, or cleanup. Never call confirm_cost, pass confirm_cost_id, accept an elicitation, or auto-answer one.
First repeat exact targets and row; ask me to confirm. Show whether confirm_cost_id is required in each create tool schema. Do NOT call get_cost or confirm_cost in this session: default form-capable tools/list hides them. Before any unskipped create_project case, ask me for the positive project quote (amount, recurrence, exact organization) from the separate both-skipped preflight session or externally verified quote. If missing, zero, stale, or inconsistent, STOP; do not switch servers or obtain it yourself. Warn that price is recomputed and a zero-cost race can create immediately. Continue only if I explicitly choose this optional staging check despite that race. Stop on inconsistent/ambiguous targets.
Run one tool case at a time, only after I explicitly ask for it: show exact create_project arguments {name,region,organization_id} or create_branch arguments {project_id,name}, with no confirm_cost_id. For unskipped tools expect a real server elicitation form; wait for me to decline/cancel it, then stop that case and report cancellation. For skipped tools expect required confirm_cost_id and missing-confirmation validation error with no form. Never fill in the missing field or call confirm_cost to repair. If your client refuses a schema-invalid call, report client-side refusal accurately; do not claim a server rejection or route around it. The separate synthetic curl check covers the server error.
Do not continue to another case automatically. Stop immediately on any unexpected successful creation, missing expected form, mismatch or error. Ordinary tool permission is not the elicitation form. Do not retry after decline; normal protocol completion of the declined form is not authorization for another create.

Expected: unskipped tools elicit, and you decline/cancel; skipped tools require confirm_cost_id and fail without it, with no form. A client's refusal to send invalid arguments is not server-error proof; the synthetic curl checks provide that proof. Do not retry, repair, call confirm_cost, provide a confirmation ID, or auto-answer. On unexpected creation or a missing expected form, stop and report it; resource cleanup needs separate human approval.

Exit Claude, then remove only the temporary review configuration and stop only your own server:

unset SUPABASE_REVIEW_PAT SUPABASE_REVIEW_URL
rm -- "$MCP_REVIEW_CONFIG"
unset MCP_REVIEW_CONFIG

Trade-offs

Keep this at the local HTTP boundary rather than add a core configuration API. Validation is deliberately limited to this parameter.

Verification: 73 tests (26 socket tests) and the dependency-inclusive build passed. The built CLI's synthetic schema/error paths were exercised. The optional authenticated Claude/staging walkthrough is not an observed result; no hosted or production behavior is claimed.

@barryroodt
barryroodt requested a review from a team as a code owner September 15, 2026 13:27
@coveralls

coveralls commented Sep 15, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 34984814779

Coverage increased (+0.2%) to 96.589%

Details

  • Coverage increased (+0.2%) from the base build.
  • Patch coverage: 20 of 20 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 3595
Covered Lines: 3490
Line Coverage: 97.08%
Relevant Branches: 539
Covered Branches: 503
Branch Coverage: 93.32%
Branches in Coverage %: Yes
Coverage Strength: 65.82 hits per line

💛 - Coveralls

@barryroodt barryroodt self-assigned this Sep 15, 2026
Comment thread CONTRIBUTING.md Resolved
log?: (line: string) => void;
};

const supportedElicitationTools = ['create_project', 'create_branch'] as const;

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.

Thinking out loud if this variable should be shared between the npm package and the platform. This seems the type of information we would want in sync with the platform behavior

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.

Gave this a bit more thought and we have the supported elicitation array in three different locations (in the local http server, in the server.ts file and in the platform repo under SUPPORTED_ELICITATION_TOOLS.

We already export shared types inside types.ts

export const currentFeatureGroupSchema = z.enum(CURRENT_FEATURE_GROUPS);

Wdyt about moving this to here instead?

// supabase-mcp/packages/mcp-server-supabase/src/types.ts
export const CURRENT_ELICITATION_TOOLS = ['create_project', 'create_branch'] as const;
export type ElicitationToolName = (typeof CURRENT_ELICITATION_TOOLS)[number];

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Main reason I didn't do this from the outset is that I didn't want the platform update relying on a new package release and I'd like to get that platform update in first. Considered that it would make more sense when we add the url & sql elicitations, since those will require a new release.

If you're happy with multiple, quick fire releases, then we can do this first.

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.

I didn't want the platform update relying on a new package release and I'd like to get that platform update in first

Agree on not making the platform changes dependent on a new package release.

I would still push for moving the CURRENT_ELICITATION_TOOLS to packages/mcp-server-supabase/src/types.ts so later we can import it and replace it in platform, once we publish the package

I'll approve this PR to unlock you and wait on your feedback

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll add it to #408 as a small refactor - it'll then also include the sql tools

@Rodriguespn Rodriguespn 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.

Approving to unlock you @barryroodt but pending feedback on this comment

Thank you!

@barryroodt
barryroodt merged commit 9442e82 into main Sep 15, 2026
5 of 6 checks passed
@supabase-releaser supabase-releaser Bot mentioned this pull request Sep 15, 2026
barryroodt pushed a commit that referenced this pull request Sep 17, 2026
🤖 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>
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