cosmo icon indicating copy to clipboard operation
cosmo copied to clipboard

You cannot propagate custom HTTP headers through the router's MCP server to the GraphQL requests

Open l-petrov opened this issue 5 months ago • 3 comments

Component(s)

router

Component version

latest

wgc version

N/A

controlplane version

N/A

router version

latest

What happened?

If possible, please create a PR with a failing test to illustrate the issue clearly. Otherwise, please attach a minimum reproduction through a GitHub repository that includes essential information such as the relevant subgraph SDLs. Please also make sure that the instructions for the reproduction are clear, tested, and fully accurate.

Description

The router's MCP Server supports propagating only the Authorization header when performing requests to the GraphQL server. If the user needed to propagate any other header to the backend, it cannot be done at all. You can see there is no logic for custom headers handling in the function executeGraphQLQuery located at: https://github.com/wundergraph/cosmo/tree/main/router/pkg/mcpserver/server.go

Steps to Reproduce

Start an MCP server, try to perform an action using an agent that was configured with extra headers and see that none will appear in the final query sent to the GraphQL server it self.

Expected Result

A config key that can be used to specify extra headers for propagation in the same way the router's GraphQL server works.

Actual Result

Only Authorization appears in the final request made to the GraphQL by the MCP server.

Environment information

Environment

Irrelevant.

Router configuration


Router execution config


Log output


Additional context

No response

l-petrov avatar Sep 04 '25 12:09 l-petrov

WunderGraph commits fully to Open Source and we want to make sure that we can help you as fast as possible. The roadmap is driven by our customers and we have to prioritize issues that are important to them. You can influence the priority by becoming a customer. Please contact us here.

github-actions[bot] avatar Sep 04 '25 12:09 github-actions[bot]

Hi @l-petrov, Thank you for your feedback. We will come back to it as soon as possible

Noroth avatar Sep 30 '25 09:09 Noroth

It would also be nice if the MCP Gateway could leverage the existing headers property in the config.yaml and passthrough all properties marked as propagate

Image

shamashel avatar Oct 16 '25 20:10 shamashel