litellm
litellm copied to clipboard
feat: Add header passing support for MCP tools in Responses API
Title
feat: Add header passing support for MCP tools in Responses API
Relevant issues
Fixes LIT-1501
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
- [ ] I have Added testing in the
tests/litellm/directory, Adding at least 1 test is a hard requirement - see details - [ ] I have added a screenshot of my new test passing locally
- [ ] My PR passes all unit tests on
make test-unit - [ ] My PR's scope is as isolated as possible, it only solves 1 specific problem
Type
๐ New Feature ๐ Bug Fix ๐งน Refactoring ๐ Documentation ๐ Infrastructure โ Test
Changes
- Extract headers from secret_fields.raw_headers and tools[].headers
- Merge headers from both sources before passing to MCP server
- Add extract_mcp_headers_from_request utility method
- Fix tool name prefix handling in _execute_tool_calls
- Add get_mcp_servers_from_ids method to MCPServerManager
- Ensure raw_headers is properly converted to dict before use
#Testing:
The latest updates on your projects. Learn more about Vercel for GitHub.
| Project | Deployment | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| litellm | Preview | Comment | Nov 27, 2025 2:31am |