Update litellm/responses/mcp/litellm_proxy_mcp_handler.py

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This commit is contained in:
Ishaan Jaff 2026-03-11 21:53:10 -07:00 committed by GitHub
parent dda31d0a5d
commit acc74afc51
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -105,10 +105,10 @@ class LiteLLM_Proxy_MCP_Handler:
# by rewriting them to the internal litellm_proxy format.
m = _PROXY_MCP_PATH_RE.match(server_url)
if m:
rewritten = dict(tool)
rewritten["server_url"] = (
rewritten = {**tool, "server_url": (
f"{LITELLM_PROXY_MCP_SERVER_URL_PREFIX}{m.group(1)}"
)
)}
mcp_tools_with_litellm_proxy.append(rewritten)
mcp_tools_with_litellm_proxy.append(rewritten)
else:
other_tools.append(tool)