Commit d429e84
fix(mcp): skip JWT injection when extra_headers already has Authorization
When a server uses per-user OAuth tokens, the resolved token is passed
into _get_tools_from_server via extra_headers. The JWT injection guard
only checked mcp_auth_header and the server's static headers, so the
signer would silently overwrite the user's OAuth Authorization header.
Add a check for an existing Authorization entry in extra_headers so
caller-supplied per-user OAuth tokens take precedence over JWT signing.
Co-authored-by: Yassin Kortam <yassin@berri.ai>1 parent 8da32a5 commit d429e84
1 file changed
Lines changed: 9 additions & 2 deletions
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1437 | 1437 | | |
1438 | 1438 | | |
1439 | 1439 | | |
1440 | | - | |
1441 | | - | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
1442 | 1444 | | |
1443 | 1445 | | |
1444 | 1446 | | |
| |||
1454 | 1456 | | |
1455 | 1457 | | |
1456 | 1458 | | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
1457 | 1463 | | |
1458 | 1464 | | |
1459 | 1465 | | |
1460 | 1466 | | |
1461 | 1467 | | |
| 1468 | + | |
1462 | 1469 | | |
1463 | 1470 | | |
1464 | 1471 | | |
| |||
0 commit comments