---
type: email
from: Ankan Misra <notifications@github.com>
subject: [openai/openai-agents-python] Add Custom HTTP Header Support to

 HostedMCPTool (Issue #1741)
received: 2026-03-06 07:34:42
date_header: Mon, 15 Sep 2025 04:16:28 -0700
priority: normal
status: awaiting_approval
uid: 30427
---

## Email Content

**From:** Ankan Misra <notifications@github.com>
**Subject:** [openai/openai-agents-python] Add Custom HTTP Header Support to

 HostedMCPTool (Issue #1741)
**Date:** Mon, 15 Sep 2025 04:16:28 -0700

### Body (preview)

AnkanMisra created an issue (openai/openai-agents-python#1741)



### Please read this first



- **Have you read the docs?**  

  Yes – I reviewed the official Agents SDK docs (https://openai.github.io/openai-agents-python/) and confirmed there is no mention of forwarding arbitrary HTTP headers from `HostedMCPTool` to an MCP server.



- **Have you searched for related issues?**  

  Yes – I searched open and closed issues for “HostedMCPTool headers”, “custom headers”, and “MCP header”. No existing feature request or bug report covers this gap.



---



### Describe the feature



#### Summary  

`HostedMCPTool` should forward **custom HTTP headers** supplied in its `tool_config` to the remote MCP server for *every* request the Responses API makes (`list_tools` and `call_tool`). This brings feature-parity with self-managed server classes and unlocks several enterprise use cases that cannot be solved today without abandoning the hosted flow.



---



#### Motivation / Use-cases  



| Use-case | Header Example | Why headers (vs query params / URL)? |

|----------|----------------|--------------------------------------|

| Tenant routing in a multi-tenant MCP | `X-Tenant-ID: 92c3f` | Avoids tenant leakage in caches / logs |

| Feature gating / canary control | `X-Feature-Flag: beta-embeddings` | Keeps internal flags off the public path |

| Zero-trust auth where bearer token cannot be shared in `Authorization` | `X-Service-Token: abc123` | Distinct from user OAuth / external API keys |

| Regulatory or data-residency tagging | `X-Data-Region: eu-central` | Lets load-balancers route to correct shards |



Without header support, teams must fall back to `MCPServerStreamableHttp` / `MCPServerSse`, giving up:

- **Zero-round-trip latency improvements** of hosted MCP

- Built-in **approval flows** handled by OpenAI infrastructure

- Simpler **network egress** (no public inbound firewall rules required)



---



#### Proposed Design  



1. **API Schema Change**  

   A

---

## Suggested Actions
- [ ] Reply
- [ ] Archive
- [ ] Escalate
