litellm icon indicating copy to clipboard operation
litellm copied to clipboard

feat: Add header passing support for MCP tools in Responses API

Open Sameerlite opened this issue 1 month ago โ€ข 1 comments

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: Screenshot 2025-11-20 at 4 16 32โ€ฏPM

Sameerlite avatar Nov 20 '25 11:11 Sameerlite

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
litellm Ready Ready Preview Comment Nov 27, 2025 2:31am

vercel[bot] avatar Nov 20 '25 11:11 vercel[bot]

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Nov 26 '25 16:11 CLAassistant