Skip to content

Auth Header Fix for MCP Tool Call - #15736

Merged
6 commits merged into
BerriAI:mainfrom
1vinodsingh1:authhdrFix
Oct 21, 2025
Merged

Auth Header Fix for MCP Tool Call #15736
6 commits merged into
BerriAI:mainfrom
1vinodsingh1:authhdrFix

Conversation

@1vinodsingh1

@1vinodsingh1 1vinodsingh1 commented Oct 20, 2025

Copy link
Copy Markdown
Contributor

Title

Relevant issues

Pre-Submission checklist

  • My PR's scope is as isolated as possible, it only solves 1 specific problem

** FIX: Invoke Tool** The LiteLLM REST API endpoint /mcp-rest/tools/call was not extracting the x-mcp-auth header from incoming HTTP requests which is fixed now.

** FIX: Added case-insensitive matching to handle auth header keys that may not match
# the exact case of server alias/name (e.g., '1litellmagcgateway' vs '1LiteLLMAGCGateway')

Type

Bug Fix

🆕 New Feature
🐛 Bug Fix
🧹 Refactoring
📖 Documentation
🚄 Infrastructure
✅ Test

Changes

@vercel

vercel Bot commented Oct 20, 2025

Copy link
Copy Markdown

@1vinodsingh1 is attempting to deploy a commit to the CLERKIEAI Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant

CLAassistant commented Oct 20, 2025

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@1vinodsingh1

Copy link
Copy Markdown
Contributor Author

@ishaan-jaff @krrishdholakia

@1vinodsingh1

1vinodsingh1 commented Oct 20, 2025 via email

Copy link
Copy Markdown
Contributor Author

@ghost

ghost commented Oct 21, 2025

Copy link
Copy Markdown

@1vinodsingh1 curious, why're you using /mcp-rest/tools/call instead of the normal /mcp routes?

@1vinodsingh1

Copy link
Copy Markdown
Contributor Author

@krrishdholakia Using /mcp-rest/tools/call instead of the normal /mcp routes because the auth header extraction fix is specifically for the REST endpoints. UI sends bearer tokens via HTTP headers.

@1vinodsingh1

Copy link
Copy Markdown
Contributor Author

Also, for route /mcp does not have the same issue of missing auth header but I have not tested /mcp route.

@1vinodsingh1

1vinodsingh1 commented Oct 21, 2025 via email

Copy link
Copy Markdown
Contributor Author

@ghost
ghost merged commit d4aadda into BerriAI:main Oct 21, 2025
4 of 6 checks passed
@shelltea

shelltea commented Nov 3, 2025

Copy link
Copy Markdown

Also, for route /mcp does not have the same issue of missing auth header but I have not tested /mcp route.

Hi @1vinodsingh1,

I'd like to ask: is this issue — #15957 — caused by the problem you mentioned?

@1vinodsingh1

Copy link
Copy Markdown
Contributor Author

It looks like similar issue of auth header authentication in web search.

@shelltea

shelltea commented Nov 5, 2025

Copy link
Copy Markdown

It looks like similar issue of auth header authentication in web search.

@1vinodsingh1 If you have time, please help take a look at this issue, thank you.

fzowl pushed a commit to fzowl/litellm that referenced this pull request Jun 24, 2026
* fixed the Auth header for MCP Tool Call

* Final fix for Auth header

* testcase for mcp_auth_header_extraction, insensitive_alias_matching, insensitive_servername_matching added
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants