Azure-Samples / Azure-Samples/AI-Gateway

set-header in MCP server policy not available in API

Open
#211 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
986
Forks
513
Avg merge
12m
Merged PRs (30d)
1

Description

* I have a REST API exposed as MCP server, following the documentation [here](https://learn.microsoft.com/en-us/azure/api-management/export-rest-mcp-server)
* REST API has `validate-jwt` policy
* MCP server also has `validate-jwt` policy
* Problem: I cannot get the `Authorizazion` header to be forwarded from the MCP server to the API, even though I followed the instructions and added the necessary `set-header` policy as per the documentation [here](https://learn.microsoft.com/en-us/azure/api-management/secure-mcp-servers#forward-tokens-to-backend)
* I even tried to set hardcoded headers with various names (other than `Authorization`) in the MCP server policy: they are never available in the API

Can you please suggest how to set headers in the MCP server policy so they are available in API policy when using the "Expose REST API as an MCP server" feature?

Thanks in advance!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.