7 views
-/https://github.com/berriai/litellm/issues/31977
GitHub · issue

#31977 [Bug]: MCP JWT signer overwrites OAuth Authorization header during tools/call

  • State: open
  • Author: @levontikoyan
  • 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 `mcp_jwt_signer` is enabled as a `pre_mcp_call` guardrail, OAuth-backed MCP servers can list tools successfully, but actual `tools/call` requests fail because the signer overwrites the user's OAuth `Authorization` header with a LiteLLM-signed JWT.

Expected behavior: - OAuth-backed MCP servers should receive the user's OAuth access token: `Authorization: Bearer <oauth_access_token>` - `mcp_jwt_signer` should not overwrite OAuth credentials for OAuth MCP servers, or this should be configurable per MCP server/header.

Actual behavior: - `tools/list` works. - `tools/call` sends the LiteLLM JWT in `Authorization` instead of the OAuth access token. - Upstream OAuth MCP servers reject the request.

This looks inconsistent with the existing `tools/list` protection added in/around #28227. The `tools/list` path skips JWT injection when Authorization already exists, with comments saying per-user OAuth must take precedence. The `tools/call` path does not apply the same protection.

### Steps to Reproduce

1. Configure `mcp_jwt_signer` as a default-…

GitHub resolver

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

Refresh page
vote history (1 events)
#0 of 0 · 31d18h1m0s ago — entered · #import:https:::github.com:berriai:litellm post #3056
The left requires code-path analysis, authentication precedence handling, compatibility safeguards, and regression tests across MCP request flows. The right is primarily a localized documentation correction with minimal implementation risk.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search