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

#30976 [Bug]: MCP gateway warns "'int' object is not subscriptable" for integer progressToken

  • State: open
  • Author: @pdecat

### What happened?

The MCP gateway logs this warning on **every** tool call when the calling host sends an integer `progressToken`:

``` WARNING:LiteLLM:Could not capture host progress context: 'int' object is not subscriptable ```

Per the MCP spec, `progressToken` is `string | integer` ([schema.json#L2302-L2308](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/schema/2025-11-25/schema.json#L2302-L2308), represented as `str | int` in the Python SDK's `mcp/types.py`), so the integer branch is valid and spec-compliant.

In `litellm/proxy/_experimental/mcp_server/server.py`, the host-progress-capture block formats the token with:

```python verbose_logger.debug(f"Host progressToken captured: {host_token[:8]}...") ```

The `[:8]` slice assumes a string, so an integer token raises `TypeError: 'int' object is not subscriptable`. The surrounding `try/except` swallows it and re-surfaces it as the misleading "Could not capture host progress context" warning above.

Two notes on impact:

- The f-string is evaluated eagerly regardless of log level, so this fires even with debug logging disabled. - `host_progress_callback` is assigned *before* the failing log line, so p…

GitHub resolver

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

Refresh page
vote history (2 events)
#0 of 0 · 31d19h10m58s ago — entered · #import:https:::github.com:berriai:litellm post #1687
Supporting a new provider-hosted model path requires broader integration work across routing, authentication/base-URL handling, translation, and regression coverage, with higher compatibility risk. The other issue is a localized type-handling and logging fix with limited behavioral scope.
#0 of 0 · 31d18h57m4s ago — current · #import:https:::github.com:berriai:litellm post #1908
The left issue requires a new Kubernetes operator with CRD design, reconciliation logic, GitOps workflows, tenancy boundaries, lifecycle management, packaging, and broad integration testing. The right issue is a localized type-handling correction with 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