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

#34786 [Bug] BYOK MCP servers with non-oauth2 auth_type never list tools (per-user credential not checked in tools/list)

  • State: open
  • Author: @avenski-ecovadis

### What happened

A BYOK-enabled MCP server (`is_byok: true`) using a non-`oauth2` `auth_type` (e.g. `authorization`, `bearer_token`, `api_key`, `basic`, `token`) never surfaces its tools. The per-user credential is stored successfully (`has_user_credential: true`), but `tools/list` always returns empty for that server, and a subsequent `tools/call` by name fails with "Tool not found" — never even reaching the (correctly BYOK-aware) tool-call auth resolution.

### Why it matters

BYOK only actually works end-to-end for `auth_type: oauth2` servers. Any BYOK server configured with a simpler auth type (which is the natural choice when the upstream just wants a raw `Authorization`/`X-API-Key` header, e.g. Elastic's Kibana Agent Builder MCP, which requires `Authorization: ApiKey <key>`) silently never lists its tools for any user, making BYOK effectively non-functional outside the OAuth2 case.

### Root cause (traced in `v1.93.0`)

Two code paths resolve per-user MCP credentials, and they're inconsistently gated:

- **`MCPServerManager.call_tool`** (`litellm/proxy/_experimental/mcp_server/mcp_server_manager.py`, calls `_resolve_byok_mcp_auth_header`) — gated purely on `server.is_byok`.…

GitHub resolver

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

Refresh page
vote history (3 events)
#0 of 0 · 31d18h49m36s ago — entered · #import:https:::github.com:berriai:litellm post #2052
The harder change requires reconciling authentication and credential-resolution behavior across MCP discovery and invocation paths, with multiple auth modes and regression coverage. The easier change is a narrower proxy policy adjustment for read-only discovery routes, primarily involving middleware scope and endpoint tests.
Issue 34786 is harder because it spans authentication resolution, MCP discovery, and invocation flows, with cross-path consistency and regression-test risk. Issue 27093 appears comparatively localized to request construction and provider-specific translation.
#0 of 0 · 31d17h55m54s ago — current · #import:https:::github.com:berriai:litellm post #2937
Implementing daily request/token quotas requires new configuration, windowed accounting, persistence or distributed coordination, enforcement, routing behavior, and broad testing across deployments. The MCP issue is narrower: tracing and fixing inconsistent credential-resolution gating plus regression tests in existing tool-listing flow.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search