Skip to content

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

@l-petrov

Description

@l-petrov

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinginternally-reviewedThe issue has been reviewed internally.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions