Skip to content

Conversation

@bokelley
Copy link
Contributor

Shows exactly what Host, Apx-Incoming-Host, and x-adcp-tenant headers are received. This will help diagnose why tenant detection fails for MCP.

This will show exactly what Host, Apx-Incoming-Host, and x-adcp-tenant
headers we're receiving, which will help us understand why tenant detection
is failing for MCP calls.
Root cause: FastMCP's get_http_headers() wasn't returning all headers,
but the raw Starlette request.headers has everything.

Solution: Extract headers from context.request_context.request.headers
and create MinimalContext (same pattern A2A uses). This ensures MCP
and A2A handle tenant detection identically.

Why A2A worked: A2A already extracted headers directly from raw request.
Why MCP failed: MCP relied on get_http_headers() which was incomplete.

This fix makes MCP match A2A's working pattern.
@bokelley bokelley merged commit c88ab38 into main Oct 24, 2025
8 checks passed
danf-newton pushed a commit to Newton-Research-Inc/salesagent that referenced this pull request Nov 24, 2025
…tocol#589)

* Add logger.info() for tenant detection headers visibility

This will show exactly what Host, Apx-Incoming-Host, and x-adcp-tenant
headers we're receiving, which will help us understand why tenant detection
is failing for MCP calls.

* Fix MCP tenant detection by extracting headers from raw request

Root cause: FastMCP's get_http_headers() wasn't returning all headers,
but the raw Starlette request.headers has everything.

Solution: Extract headers from context.request_context.request.headers
and create MinimalContext (same pattern A2A uses). This ensures MCP
and A2A handle tenant detection identically.

Why A2A worked: A2A already extracted headers directly from raw request.
Why MCP failed: MCP relied on get_http_headers() which was incomplete.

This fix makes MCP match A2A's working pattern.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants