8 views
-/https://github.com/berriai/litellm/issues/32242
GitHub · issue

#32242 MCP gateway: 'int' object is not subscriptable — progressToken slice assumes str (server.py:735)

  • State: open
  • Author: @NicolaivdSmagt

### What happened?

When proxying an external MCP server through the LiteLLM MCP gateway (`/<server>/mcp`), every `tools/call` fails with:

``` MCP mcp_server_tool_call - error: 'int' object is not subscriptable Traceback (most recent call last): File ".../litellm/proxy/_experimental/mcp_server/server.py", line 910, in mcp_server_tool_call File ".../litellm/proxy/_experimental/mcp_server/server.py", line 735, in _capture_host_progress_callback TypeError: 'int' object is not subscriptable ```

The upstream tool actually executes successfully — the crash is in the progress-callback capture path, so the successful result is discarded and the caller only sees an error.

### Root cause

In `litellm/proxy/_experimental/mcp_server/server.py`, `_capture_host_progress_callback` slices the progress token assuming it is a string:

```python host_token = getattr(host_ctx.meta, "progressToken", None) ... verbose_logger.debug(f"Host progressToken captured: {host_token[:8]}...") # line 735 ```

Per the MCP spec, a `progressToken` may be **either a string or an integer** (`string | number`). When the client (or downstream server) uses an **integer** progress token, `host_token[:8]` raises `Ty…

GitHub resolver

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

Refresh page
vote history (2 events)
#0 of 0 · 31d18h38s ago — entered · #import:https:::github.com:berriai:litellm post #2849
The Responses API issue is harder because it requires reconstructing and validating a complete streaming event lifecycle across proxy translation paths, with ordering, state, and client-compatibility concerns. The MCP issue is comparatively localized to making progress-token handling type-safe and adding focused regression coverage.
#0 of 0 · 31d18h28s ago — current · #import:https:::github.com:berriai:litellm post #2852
The left requires cross-layer diagnosis and validation across the dashboard, proxy configuration, authentication, and model-specific request handling, with greater uncertainty and integration risk. The right is a narrowly localized type-handling defect with a straightforward fix and focused regression coverage.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search