Skip to content

fix: tools not loading on stdio server#269

Merged
gregnr merged 1 commit intomainfrom
fix/graphql-response-schema-zod-v4
May 1, 2026
Merged

fix: tools not loading on stdio server#269
gregnr merged 1 commit intomainfrom
fix/graphql-response-schema-zod-v4

Conversation

@gregnr
Copy link
Copy Markdown
Collaborator

@gregnr gregnr commented May 1, 2026

Problem

The docs Content API GraphQL response schema (used for the search_docs tool) used a discriminated union with z.undefined() to model success/error branches. There were 2 issues:

  1. Zod v4 had a breaking change where z.undefined() on object properties requires the key to be explicitly present (and set as undefined). Absent keys failed validation, which broke tool loading
  2. The union was actually incorrect from the beginning. The GraphQL spec allows both data and errors at the same time (partial results)

Fix

This PR replaces the union with a flat schema. data uses .nullish() because the spec allows it to be either absent (validation errors before execution) or null (resolver errors on non-nullable fields). errors uses .optional() since it's simply absent on success.

How to test

Configure Claude Code with the following MCP server config:

{
  "mcpServers": {
    "supabase-stdio": {
      "command": "npx",
      "args": [
        "-y",
        "@supabase/mcp-server-supabase@https://pkg.pr.new/supabase-community/supabase-mcp/@supabase/mcp-server-supabase@bbbe8ba"
      ],
      "env": {
        "SUPABASE_ACCESS_TOKEN": "<pat>"
      }
    }
  }
}

Run the claude CLI, enter /mcp, select supabase-stdio.

  1. Confirm that the server connected successfully
  2. Confirm that tools are available (by the presence of the View tools option, which displays all the tools when selected)

Resolves #261

@gregnr gregnr added the publish-preview Runs `publish-preview` workflow to publish preview packages via https://pkg.pr.new/ label May 1, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 1, 2026

Open in StackBlitz

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

commit: bbbe8ba

@gregnr gregnr changed the title fix: flatten graphql response schema fix: tools not loading on stdio server May 1, 2026
Copy link
Copy Markdown
Collaborator

@mattrossman mattrossman left a comment

Choose a reason for hiding this comment

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

Preview build tested working on my end 👍

@gregnr gregnr merged commit 29acd6c into main May 1, 2026
8 checks passed
gregnr pushed a commit that referenced this pull request May 1, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>mcp-server-supabase: 0.8.1</summary>

##
[0.8.1](mcp-server-supabase-v0.8.0...mcp-server-supabase-v0.8.1)
(2026-05-01)


### Bug Fixes

* tools not loading on stdio server
([#269](#269))
([29acd6c](29acd6c)),
closes
[#261](#261)
</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-community-releaser[bot] <266066903+supabase-community-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

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.

MCP tools don't appear in Claude Code

2 participants