mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 11:43:54 +00:00
Merge pull request #9642 from BerriAI/litellm_mcp_improvements_expose_sse_urls
[Feat] - MCP improvements, add support for using SSE MCP servers
This commit is contained in:
commit
f5c0afcf96
25 changed files with 1220 additions and 30 deletions
16
litellm/types/mcp_server/mcp_server_manager.py
Normal file
16
litellm/types/mcp_server/mcp_server_manager.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
from typing_extensions import TypedDict
|
||||
|
||||
|
||||
class MCPInfo(TypedDict, total=False):
|
||||
server_name: str
|
||||
logo_url: Optional[str]
|
||||
|
||||
|
||||
class MCPSSEServer(BaseModel):
|
||||
name: str
|
||||
url: str
|
||||
mcp_info: Optional[MCPInfo] = None
|
||||
model_config = ConfigDict(arbitrary_types_allowed=True)
|
|
@ -1644,6 +1644,33 @@ class StandardLoggingUserAPIKeyMetadata(TypedDict):
|
|||
user_api_key_end_user_id: Optional[str]
|
||||
|
||||
|
||||
class StandardLoggingMCPToolCall(TypedDict, total=False):
|
||||
name: str
|
||||
"""
|
||||
Name of the tool to call
|
||||
"""
|
||||
arguments: dict
|
||||
"""
|
||||
Arguments to pass to the tool
|
||||
"""
|
||||
result: dict
|
||||
"""
|
||||
Result of the tool call
|
||||
"""
|
||||
|
||||
mcp_server_name: Optional[str]
|
||||
"""
|
||||
Name of the MCP server that the tool call was made to
|
||||
"""
|
||||
|
||||
mcp_server_logo_url: Optional[str]
|
||||
"""
|
||||
Optional logo URL of the MCP server that the tool call was made to
|
||||
|
||||
(this is to render the logo on the logs page on litellm ui)
|
||||
"""
|
||||
|
||||
|
||||
class StandardBuiltInToolsParams(TypedDict, total=False):
|
||||
"""
|
||||
Standard built-in OpenAItools parameters
|
||||
|
@ -1674,6 +1701,7 @@ class StandardLoggingMetadata(StandardLoggingUserAPIKeyMetadata):
|
|||
requester_ip_address: Optional[str]
|
||||
requester_metadata: Optional[dict]
|
||||
prompt_management_metadata: Optional[StandardLoggingPromptManagementMetadata]
|
||||
mcp_tool_call_metadata: Optional[StandardLoggingMCPToolCall]
|
||||
applied_guardrails: Optional[List[str]]
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue