6 views
-/https://github.com/berriai/litellm/issues/33447
GitHub · issue

#33447 MCP gateway does not surface downstream MCP server response headers to the caller

  • State: open
  • Author: @oginskis

### What we need

When a client calls a tool **through** the LiteLLM MCP gateway, custom response metadata that the downstream MCP server attaches to its `tools/call` HTTP response needs to reach the caller. Today that metadata is dropped on the gateway hop, and there is no config or documented mechanism to preserve it.

### Environment

- `litellm v1.93.0-rc.1` - MCP python-sdk `mcp==1.26.0` (LiteLLM's pinned dependency) - Downstream MCP servers use the **streamable-HTTP** transport.

### Reproduction

1. Run a streamable-HTTP MCP server whose `tools/call` handler sets a custom HTTP response header, e.g. `X-Example-Header: hello`. 2. Register it in the LiteLLM proxy under `mcp_servers`. 3. Call the tool **directly** against that server (bypassing LiteLLM): `curl -i` shows `X-Example-Header: hello`. 4. Call the **same** tool **through** the LiteLLM MCP gateway.

### Expected vs actual

- **Expected:** the caller (or infrastructure between the gateway and the caller, e.g. an API gateway reading response headers for billing/observability) can obtain `X-Example-Header`. - **Actual:** the MCP result body returns correctly, but the custom header is gone. It is lost specifically on the L…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (2 events)
#0 of 0 · 31d18h47m55s ago — entered · #import:https:::github.com:berriai:litellm post #2174
The harder task requires tracing and preserving metadata across a streaming protocol boundary, accounting for SDK behavior, gateway response construction, compatibility, and end-to-end tests. The easier task is a localized data-map update with validation of pricing fields.
#0 of 0 · 31d18h41m13s ago — current · #import:https:::github.com:berriai:litellm post #2282
The left issue is harder because it involves diagnosing and adapting to provider-side anti-bot behavior, authentication state, and externally controlled request validation, making reliable implementation and testing uncertain. The right issue is a more bounded gateway data-propagation change, though it still crosses MCP transport and response-handling layers.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search