want to send custom headers to MCP server tool with dynamic values
Hi @Priyansh_Shah, we don't currently have a way to send custom headers to MCP servers. There is an existing internal feature request for this however, and I've added this thread to it and will post here if there are any updates!
Can I ask what your use case is for using custom headers? That could help us pushing this request forward. Thanks!
Hi @Mike_M , thanks for the update — appreciate you adding this to the feature request.
Our use case is to pass dynamic user context (such as user email, user ID, or workspace/tenant ID) to our MCP server via request headers, rather than inside the tool call body. This allows us to perform authentication, authorization, and access checks at the MCP server level before any tool logic runs.
Using headers lets us safely cross-check the calling user and enforce governance or multi-tenant policies centrally, without relying on the model to pass identity data correctly in tool arguments.
Happy to share more details if helpful — thanks again!
Thanks for the additional info! At the moment, you can still perform authentication with the MCP server, but it is something that has to be done when you're configuring your server rather than from the tool call. From my understanding, it might not be as dynamic as you'd like it to be, but it's worth checking out if you haven't already. Depending on your organization, you could use service account credentials, rather than authenticating individual users.
Regardless, I've updated our internal ticket accordingly with your request!