Supabase MCP server fails in Windsurf: 'Cannot call write after a stream was destroyed'
I set up @supabase/mcp-server-supabase in Windsurf on Windows using the documented mcp.json with
cmd /c npx --access-token. The server fails with 'Cannot call write after a stream was destroyed' (Code -32099) and never connects. What is causing this and how can I make it work?Originally asked on GitHub: https://github.com/supabase/mcp/issues/16
6 answers
Status: open — no confirmed fix in this thread. The error appears on Windows, macOS, and even in Cursor, so it is not specific to one setup.
A Supabase maintainer responded that on Windows this often happens when
node/npxis not in your systemPATHenvironment variable, so first confirm thatnodeandnpxare accessible from a normal terminal. They also suggested:- Upgrade to the latest LTS version of Node (the reporter was on v18.18.0).
- Restart your computer.
- Debug with the MCP Inspector:
shellThen open
npx @modelcontextprotocol/inspector npx -y @supabase/mcp-server-supabase@latest --access-token <personal-access-token>http://127.0.0.1:6274/and click Connect.
In the thread, users who tried the inspector still saw the server fail or got deprecation warnings from npm, and a macOS user with the latest Windsurf and Node installed had the same problem. No one confirmed that upgrading Node or using the inspector resolved it. The issue remains open, so if these steps don't help, you may be waiting for a server-side fix.
As general advice, the exact mcp.json you posted is correct for Windows; just make sure the token is valid and replace the
xxxxxxxx...placeholder with a real Supabase personal access token. Treat that token as a secret — do not commit it or paste it into public logs.Did this work for you?What @adiel098 tried on GitHub (Didn't work)
Configured mcpServers in Windsurf with the documented
cmd /c npx -y @supabase/mcp-server-supabase@latest --access-token xxxxJSON and got the stream-destroyed error.Source: https://github.com/supabase/mcp/issues/16 (opens external site)
Did this work for you?What @adiel098 tried on GitHub (Didn't work)
Retried the same setup on Windows with Node v18.18.0 and still got the identical 'Cannot call write after a stream was destroyed' error.
Source: https://github.com/supabase/mcp/issues/16#issuecomment-2774909339 (opens external site)
Did this work for you?What @rerouted tried on GitHub (Didn't work)
Ran the MCP Inspector command (
npx @modelcontextprotocol/inspector ...) while Windsurf reported 'request failed'; saw many npm deprecation warnings but no fix.Source: https://github.com/supabase/mcp/issues/16#issuecomment-2779488454 (opens external site)
Did this work for you?What @crsmoore tried on GitHub (Didn't work)
Tested on latest macOS with latest Windsurf and Node installed; the server still did not connect.
Source: https://github.com/supabase/mcp/issues/16#issuecomment-2779656334 (opens external site)
Did this work for you?What @crsmoore tried on GitHub (Partly worked)
Tried the same Supabase MCP server in Cursor; it connected briefly but then failed out.
Source: https://github.com/supabase/mcp/issues/16#issuecomment-2779671257 (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?
- Why does Supabase MCP throw 'File is not defined' when listing edge functions?
- Supabase MCP shows connected in Claude Code but no tools load (Zod parse error)
- 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?