Skip to content

feat(mcp-server-supabase): observe notebook runs - #478

Merged
barryroodt merged 31 commits into
mainfrom
feat/notebook-tools-observation
Oct 21, 2026
Merged

barryroodt merged 31 commits into
mainfrom
feat/notebook-tools-observation

Conversation

@barryroodt

@barryroodt barryroodt commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #446.

Adds the observation facts introduced in 0.14.0 to run_notebook elicitation events. They're emitted under a new notebook feature, since its prompt also fires for mutating SQL that isn't destructive. Notebooks with nothing to confirm get a new not_mutating bypass reason.

An accepted or bypassed run emits one started/returned pair for the whole notebook. The cell queries don't add facts of their own, and a cell error the run catches still counts as returned because the run keeps going.

BEGIN_COMMIT_OVERRIDE
chore(mcp-server-supabase): observe notebook runs
END_COMMIT_OVERRIDE

SaxonF and others added 25 commits September 24, 2026 14:07
Logs notebooks are a primary observability use case, so run_notebook is
now offered when either the database or debugging feature can run cells.
Database cells return a per-cell error without the database feature, as
log cells already do without debugging.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Reject negative or fractional row limits, blank names and SQL, and
  unknown chart or time range keys; trim saved names and SQL.
- Build the tool input schema in notebook-tools with project_id first,
  keeping the platform options schema free of model-facing descriptions.
- Show the creation confirmation as a readable per-cell list instead of
  raw JSON, and explain why creation confirms at all.
- Configure notebook confirmations through one option with enabledTools,
  matching the database tools.
- Note in the description that run_notebook can only run log cells whose
  range is 24 hours or less.
- Cover the full confirmation message, non-elicitation responses,
  declines after changes, and which field each invalid input fails on.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
run_notebook buffers every cell's rows until the run ends, which a hosted
server can't afford. Cap a run at about 1 MB of rows across all cells:
each database cell gets the budget earlier cells left as
max_result_bytes, so platforms can stop reading early, and a cell whose
rows don't fit returns an error without stopping later cells.
execute_sql is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	CONTRIBUTING.md
#	packages/mcp-server-supabase/test/server-harness.ts
…re/create-notebook-tool

# Conflicts:
#	CONTRIBUTING.md
#	packages/mcp-server-supabase/src/server.test.ts
@barryroodt
barryroodt requested a review from a team as a code owner October 20, 2026 09:39
@barryroodt barryroodt self-assigned this Oct 20, 2026

@mattrossman mattrossman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I tested adding a temporary observer to the local dev server and saw the facts coming in during notebook elicitations in Claude.

@mattrossman

Copy link
Copy Markdown
Collaborator

Side note, wonder if we should include such an observer (always on or behind a flag) to the dev server to make it easy to see these o11y changes working in the future.

…re/create-notebook-tool

# Conflicts:
#	packages/mcp-server-supabase/src/server.test.ts
…-tool

# Conflicts:
#	CONTRIBUTING.md
#	packages/mcp-server-supabase/src/server.notebooks.test.ts
#	packages/mcp-server-supabase/src/server.test.ts
#	packages/mcp-server-supabase/src/tools/notebook-tools.ts
#	packages/mcp-server-supabase/src/transports/local-http-entry.test.ts
@barryroodt
barryroodt changed the base branch from chore/create-notebook-tool to main October 21, 2026 13:58
@barryroodt
barryroodt merged commit 2f5ae12 into main Oct 21, 2026
3 checks passed
@supabase-releaser supabase-releaser Bot mentioned this pull request Oct 21, 2026
barryroodt pushed a commit that referenced this pull request Oct 29, 2026
## What kind of change does this PR introduce?

Release gate (chore)

## What is the current behavior?

With `features=notebooks`, `tools/list` offers `create_notebook` and
`run_notebook`, and release PR #477 would ship them in 0.15.0.

## What is the new behavior?

The server no longer registers `create_notebook` or `run_notebook`. With
`notebooks` requested, `tools/list` shows only `list_notebooks` and
`get_notebook`, and a call to either hidden tool returns `tool not
found`. The static tool registry (`supabaseMcpToolSchemas` /
`createToolSchemas`) still lists both tools, so it no longer matches
what the server registers for notebooks.

An `@internal` server option, `unreleasedNotebookTools`, turns them back
on. It defaults to `false` and has no CLI flag or query param. Tests
that cover the hidden tools set it, including the local HTTP suite
through `startEntry`. `@internal` is only a doc comment, so the option
still ships as `unreleasedNotebookTools?: boolean` on the exported
`SupabaseMcpServerOptions`, and hosts using `createSupabaseMcpHandler`
can set it.

The commit type is `chore`, so this PR adds nothing to the changelog.
The notebook entries from #445, #446 and #478 come out of #477 through
`BEGIN_COMMIT_OVERRIDE` blocks on those PRs.

Closes [AI-1377](https://linear.app/supabase/issue/AI-1377)
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