From e4d2a1152b7a67e0de6756e44bcc528485ab4311 Mon Sep 17 00:00:00 2001 From: Ishaan Jaffer Date: Thu, 7 May 2026 17:34:21 -0700 Subject: [PATCH] managed agents: add mcp_servers to AgentCreate/Out/Update mcp_servers is a list of MCP server identifiers an agent is bound to. On AgentUpdate it's replace-style: passing [] clears, omitting it is a no-op (matches the existing pfp_url empty-string-clears semantic). --- litellm/proxy/managed_agents_endpoints/types.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/litellm/proxy/managed_agents_endpoints/types.py b/litellm/proxy/managed_agents_endpoints/types.py index 9af2cac3608..2f5bc8f0aa1 100644 --- a/litellm/proxy/managed_agents_endpoints/types.py +++ b/litellm/proxy/managed_agents_endpoints/types.py @@ -81,17 +81,23 @@ class AgentCreate(BaseModel): litellm_api_key: Optional[str] = None litellm_api_base: Optional[str] = None pfp_url: Optional[str] = None + mcp_servers: List[str] = Field(default_factory=list) class AgentUpdate(BaseModel): """Partial update — every field is optional. Only provided fields are written. Setting a string field to "" clears it; null is treated as - no-op (field absent in the request).""" + no-op (field absent in the request). + + mcp_servers is replace-style: passing an empty list clears the binding; + omitting it leaves the existing list untouched. + """ model_config = ConfigDict(extra="forbid") name: Optional[str] = None pfp_url: Optional[str] = None + mcp_servers: Optional[List[str]] = None class AgentOut(BaseModel): @@ -104,6 +110,7 @@ class AgentOut(BaseModel): template_id: str branch: str pfp_url: Optional[str] = None + mcp_servers: List[str] = Field(default_factory=list) created_at: Optional[datetime] = None