We built an MCP server as a Netlify Function that worked fine when using netlify dev. Then we learned about @netlify/vite-plugin and switched to it, but found that our MCP server ran, but Claude Code wouldn't connect to it.
The root cause of Claude Code not connecting to our MCP server was found to be that @netlify/vite-plugin inadvertently drops important HTTP headers critical to MCP that netlify dev preserves.
Reproduction: https://github.com/aguynamedben/netlify-vite-plugin-bug-repro
PR with fix: #646
Output of the reproduction are below. As you can see, HTTP headers that work fine with netlify dev are dropped when using @netlify/vite-plugin.

We built an MCP server as a Netlify Function that worked fine when using
netlify dev. Then we learned about@netlify/vite-pluginand switched to it, but found that our MCP server ran, but Claude Code wouldn't connect to it.The root cause of Claude Code not connecting to our MCP server was found to be that
@netlify/vite-plugininadvertently drops important HTTP headers critical to MCP thatnetlify devpreserves.Reproduction: https://github.com/aguynamedben/netlify-vite-plugin-bug-repro
PR with fix: #646
Output of the reproduction are below. As you can see, HTTP headers that work fine with
netlify devare dropped when using@netlify/vite-plugin.