From 4f6b8a2a3e53a491fab18c6bc214c5ff0cabc5b1 Mon Sep 17 00:00:00 2001 From: yuneng-jiang Date: Fri, 20 Mar 2026 22:01:16 -0700 Subject: [PATCH] [Fix] Exclude team_id from MCP server DB create payload team_id is a request-level field for auth scoping, not a DB column. Co-Authored-By: Claude Opus 4.6 (1M context) --- litellm/proxy/_experimental/mcp_server/db.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/proxy/_experimental/mcp_server/db.py b/litellm/proxy/_experimental/mcp_server/db.py index fbef33c32ed..2ec5d030c46 100644 --- a/litellm/proxy/_experimental/mcp_server/db.py +++ b/litellm/proxy/_experimental/mcp_server/db.py @@ -40,8 +40,8 @@ def _prepare_mcp_server_data( """ from litellm.litellm_core_utils.safe_json_dumps import safe_dumps - # Convert model to dict - data_dict = data.model_dump(exclude_none=True) + # Convert model to dict, excluding fields that are not DB columns + data_dict = data.model_dump(exclude_none=True, exclude={"team_id"}) # Ensure alias is always present in the dict (even if None) if "alias" not in data_dict: data_dict["alias"] = getattr(data, "alias", None)