Repository navigation
feat(mcp-server-supabase): add bounded cost lifecycle observations - #428
Merged
Merged
Conversation
commit: |
barryroodt
marked this pull request as ready for review
October 5, 2026 14:57
…-observability-lifecycle
…-observability-cost
…-observability-cost
…-observability-lifecycle
raulb
reviewed
Oct 6, 2026
|
|
||
| ## Observability | ||
|
|
||
| Pass an `observer` to `createMcpServer` to collect request lifecycle results and facts recorded by your tools: |
Member
There was a problem hiding this comment.
Why renaming createMcpServer to createSupabaseMcpServer?
Contributor
Author
There was a problem hiding this comment.
Not a rename: #427 documents the generic createMcpServer from mcp-utils; this PR wires the observer into the Supabase server, so the root README now shows createSupabaseMcpServer.
raulb
approved these changes
Oct 6, 2026
raulb
left a comment
Member
There was a problem hiding this comment.
@barryroodt approved with some small nits.
# Conflicts: # README.md
…-observability-cost # Conflicts: # README.md
…-observability-cost # Conflicts: # packages/mcp-server-supabase/src/tools/account-tools.ts # packages/mcp-server-supabase/src/tools/branching-tools.ts
barryroodt
added a commit
that referenced
this pull request
Oct 14, 2026
## Why Platform measures hosted MCP request lifecycles (attempts, outcomes and durations) without shipping request payloads. This adds the generic core for that work in [AI-1273](https://linear.app/supabase/issue/AI-1273/observability-for-mcp-elicitations-and-requests), and [#428](#428) supplies Supabase-owned types and cost facts. ## What changed - `createMcpServer` accepts an optional `observer` and an optional `classifyTool` function that maps a tool name to a host-defined bucket or `other`. Only `tools/call` contexts include a tool bucket; other contexts contain only the method. - Tools receive an optional handle with `record` and `setOutcome`. Outcomes don't depend on fact contents. Errors and `input_required` retain precedence. - Core forwards no request payloads automatically. Custom fact producers remain responsible for privacy. - With no observer, no facts or timings are recorded. `onToolCall` stays unchanged. ## How to test ```sh pnpm --filter @supabase/mcp-utils exec vitest run ``` 36 tests pass. ## Trade-offs - The host owns collection and export; duration excludes transport and human waiting. - Observer factory, `classifyTool` and sink failures are isolated, but synchronous observer and classifier work can still block requests.
barryroodt
changed the base branch from
feat/mcp-observability-lifecycle
to
main
October 14, 2026 08:47
…y-cost # Conflicts: # README.md # packages/mcp-server-supabase/src/tools/account-tools.ts # packages/mcp-server-supabase/src/tools/branching-tools.ts # scripts/fixtures/packed-platform-consumer/types-check.ts
Coverage Report for CI Build 38538780174Warning No base build found for commit Coverage: 97.275%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsRequires a base build to compare against. How to fix this → Coverage Stats
💛 - Coveralls |
Merged
barryroodt
added a commit
that referenced
this pull request
Oct 14, 2026
## Why Platform measures destructive-SQL confirmations for `execute_sql` and `apply_migration` alongside cost confirmations. This adds those facts for [AI-1273](https://linear.app/supabase/issue/AI-1273/observability-for-mcp-elicitations-and-requests), stacked on [#428](#428). ## What changed `execute_sql` and `apply_migration` report confirmation decisions, successful issuance, consumed responses, resume validation, and backend operations. Supabase owns these concrete facts; `mcp-utils` stays generic. The shared SQL gate stages confirmation facts and outcomes, applying outcomes before dispatching facts. A non-destructive bypass discards both. Accepted valid resumes still skip classification, preserving existing SQL policy and cost behavior. Built-in facts contain finite values and durations without payloads or IDs; custom producers remain responsible for privacy. Outcomes stay independent of fact contents. With no observer, no facts or timings are recorded. ## How to test ```sh pnpm test:packed-platform-consumer ``` All 3 packed-consumer checks pass, including ESM/CJS SQL confirmation flows. ## Trade-offs - Hosts own collection; [platform #39142](supabase/platform#39142) includes SQL observations. Secret collection belongs in a separate PR stacked on this one. - Synchronous observers can block despite failure isolation.
barryroodt
pushed a commit
that referenced
this pull request
Oct 14, 2026
🤖 I have created a release *beep* *boop* --- <details><summary>mcp-utils: 0.9.0</summary> ## [0.9.0](mcp-utils-v0.8.0...mcp-utils-v0.9.0) (2026-10-14) ### Features * **mcp-utils:** add bounded request lifecycle observations ([#427](#427)) ([b11d62b](b11d62b)) </details> <details><summary>mcp-server-supabase: 0.14.0</summary> ## [0.14.0](mcp-server-supabase-v0.13.0...mcp-server-supabase-v0.14.0) (2026-10-14) ### Features * **advisors:** add health advisor support ([#420](#420)) ([8a26508](8a26508)) * **mcp-server-supabase:** add bounded cost lifecycle observations ([#428](#428)) ([657d1f3](657d1f3)) * **mcp-server-supabase:** add destructive SQL observations ([#455](#455)) ([4595698](4595698)) ### Bug Fixes * **mcp:** clarify cost and deploy tool descriptions for OpenAI scanner ([#467](#467)) ([1f9da03](1f9da03)) * **mcp:** stop double cost confirmation on create_project and create_branch ([#468](#468)) ([3c3b1fc](3c3b1fc)) </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>
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
Platform measures how Supabase cost confirmations for
create_projectandcreate_branchbehave, without shipping payloads. This is part of AI-1273, building on #427, with #455 adding SQL confirmation facts.What changed
CURRENT_ELICITATION_TOOLSlookup;mcp-utilssupplies the generic core.create_projectandcreate_branchreport confirmation decisions and protected-operation durations that exclude observer recording latency. Consumed responses set the outcome before fact dispatch or changed-quote validation.How to test
All 3 packed-consumer checks pass.
Trade-offs