18 views
-/https://github.com/berriai/litellm/issues/25128
GitHub · issue

#25128 [Bug]: MCP HTTP proxy client does not forward mcp-session-id to upstream stateful servers - tools never load

  • State: open
  • Author: @axelquack
  • Labels: bug, proxy

### Check for existing issues

- [x] I have searched the existing issues and checked that my issue is not a duplicate.

### What happened?

When LiteLLM's proxy connects to an upstream MCP server via Streamable HTTP, it receives a `mcp-session-id` header in the `initialize` response but does **not** include that header in subsequent requests (`tools/list`, `tools/call`). Each follow-up request arrives at the upstream server without a session ID - the server treats it as a brand-new uninitialised session, and tools never load.

Expected: after receiving `mcp-session-id: <uuid>` in the `initialize` response, LiteLLM should echo that header back on all subsequent requests to the same upstream server, as required by the [MCP Streamable HTTP spec](https://spec.modelcontextprotocol.io/specification/2024-11-05/basic/transports/#streamable-http).

This is the **outbound MCP HTTP client** behaviour (LiteLLM connecting to upstream servers), distinct from #20242 which concerned LiteLLM's own server-side session manager.

### Steps to Reproduce

1. Start any stateful Streamable HTTP MCP server - e.g. `isokoliuk/mcp-searxng` with `MCP_HTTP_PORT` set, or Supergateway in `--stateful` mode. 2. Add…

GitHub resolver

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

Refresh page
vote history (3 events)
#0 of 0 · 31d18h39m31s ago — entered · #import:https:::github.com:berriai:litellm post #2207
The right issue is harder because it requires correcting multi-tenant authorization semantics across CRUD handlers, identifying all access paths, and adding regression coverage without weakening existing key-management behavior. The left issue is comparatively localized to session-state propagation in the outbound transport client, with focused protocol tests.
Issue 32245 is harder because it likely spans budget ownership, team/key association semantics, persistence, and scheduled reset logic, with greater risk of affecting accounting and existing authorization flows. Issue 25128 is comparatively localized to protocol-state handling in the outbound MCP client and can be addressed through request-session propagation and focused integration tests.
#0 of 0 · 31d18h14m20s ago — current · #import:https:::github.com:berriai:litellm post #2604
The left issue is harder because it has an unclear root cause and may require profiling, timeout-policy changes, and validation across large-document processing paths. The right issue is a bounded protocol-state change with a clearer implementation surface and focused tests.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search