Supabase MCP shows connected in Claude Code but no tools load (Zod parse error)
After connecting the Supabase MCP server in Claude Code (claude-code 2.1.126 on Windows and macOS),
/mcpshows the server as connected but no tools register. A rawtools/listcall via JSON-RPC returns: "Failed to parse Supabase Content API response" with aninvalid_unionZod error. The same error appears on@supabase/mcp-server-supabaseversions 0.6.0 through 0.8.0.Originally asked on GitHub: https://github.com/supabase/mcp/issues/261
5 answers
This is fixed in
@supabase/mcp-server-supabasev0.8.1 (released 2026-05-01). The cause was a Zod v3 to v4 breaking change: the server usedz.undefined()in a union that expected either{ errors: [...] }or{ data: ..., errors: undefined }, but the Content API now returns successful responses withdataand noerrorskey at all. In Zod v4,z.undefined()requires the key to be present, so an absent key fails validation.Fix: upgrade. If you run the stdio server via
npx, the maintainer confirmed that pointing the tag atlatestpicks up the fix.Workarounds reported while waiting:
- Pin the stdio server to
@supabase/mcp-server-supabase@0.5.10, the last release before the Zod v4 bump. One commenter validated this against a 312-table production project;tools/listsucceeded andlist_tablesreturned rows. - Patch the cached dist file at
~/.npm/_npx/<hash>/node_modules/@supabase/mcp-server-supabase/dist/chunk-XLEPTKCS.js, replacingerrors:g.undefined()witherrors:g.optional(g.undefined())anddata:g.undefined()withdata:g.optional(g.undefined())in the two schema objects. Multiple commenters confirmed this works, but it is lost onnpx --refresh.
Transport note: the maintainer recommends the HTTP-based server instead of stdio. PATs are supported there via the Authorization header:
json{ "mcpServers": { "supabase": { "type": "http", "url": "https://mcp.supabase.com/mcp", "headers": { "Authorization": "Bearer ${SUPABASE_ACCESS_TOKEN}" } } } }General advice: expand
${SUPABASE_ACCESS_TOKEN}from an environment variable rather than hardcoding the token value into a committed config file.Did this work for you?- Pin the stdio server to
What @gregnr tried on GitHub (Worked)
Maintainer merged the Zod schema fix in #269 and released it as v0.8.1, advising stdio users to use the
latesttag; confirmedlatestthen worked.Source: https://github.com/supabase/mcp/issues/261#issuecomment-4361455895 (opens external site)
Did this work for you?What @marinaldooliveira-creator tried on GitHub (Worked)
Pinned the stdio server to @supabase/mcp-server-supabase@0.5.10 (pre-Zod-v4) with
npx -y ... --project-ref;tools/listsucceeded and all tools registered.Source: https://github.com/supabase/mcp/issues/261#issuecomment-4361067839 (opens external site)
Did this work for you?What @jlognn tried on GitHub (Worked)
Patched the cached dist file, replacing z.undefined() with z.optional(z.undefined()) in both schema branches of the parsed GraphQL response.
Source: https://github.com/supabase/mcp/issues/261#issuecomment-4357948403 (opens external site)
Did this work for you?What @darkcoder215 tried on GitHub (Didn't work)
Reporter reinstalled Claude Code, removed access tokens, and deleted the setup entirely, on both Claude Code Web and Desktop.
Source: https://github.com/supabase/mcp/issues/261 (opens external site)
Did this work for you?
Related questions
- How do I connect the Supabase MCP server to a remote self-hosted Supabase instance?
- Supabase MCP server fails in Windsurf: 'Cannot call write after a stream was destroyed'
- Why does Supabase MCP throw 'File is not defined' when listing edge functions?
- How do I run the Supabase MCP server against a local project without a personal access token?
- Supabase MCP stops responding in Claude Desktop after a few requests?