Skip to content

@netlify/vite-plugin drops HTTP headers that netlify dev preserves, breaking MCP servers #647

@aguynamedben

Description

@aguynamedben

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.

Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions