mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
Update litellm/proxy/_experimental/mcp_server/server.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This commit is contained in:
parent
7d1ee90841
commit
ba080bb88c
1 changed files with 6 additions and 12 deletions
|
|
@ -378,25 +378,19 @@ if MCP_AVAILABLE:
|
|||
body_data["litellm_trace_id"] = chain_id
|
||||
body_data["litellm_session_id"] = chain_id
|
||||
|
||||
_scope_headers: list[tuple[bytes, bytes]] = [
|
||||
(b"content-type", b"application/json"),
|
||||
]
|
||||
_scope_headers: list[tuple[bytes, bytes]] = [
|
||||
(b"content-type", b"application/json"),
|
||||
]
|
||||
if raw_headers:
|
||||
try:
|
||||
for k, v in raw_headers.items():
|
||||
if k.lower() == "content-type":
|
||||
continue # already added above
|
||||
_scope_headers.append(
|
||||
(k.lower().encode("latin-1"), v.encode("latin-1"))
|
||||
)
|
||||
except (UnicodeEncodeError, UnicodeDecodeError):
|
||||
verbose_logger.debug(
|
||||
f"Skipping header {k!r}: contains non-Latin-1 characters"
|
||||
)
|
||||
request = Request(
|
||||
scope={
|
||||
"type": "http",
|
||||
"method": "POST",
|
||||
"path": "/mcp/tools/call",
|
||||
"headers": _scope_headers,
|
||||
}
|
||||
)
|
||||
if user_api_key_auth is not None:
|
||||
data = await add_litellm_data_to_request(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue