From f4e5fb2b4ae4d388d62e66eaba64c33a162bf8d6 Mon Sep 17 00:00:00 2001 From: yuneng-jiang Date: Thu, 19 Mar 2026 22:50:35 -0700 Subject: [PATCH] fix: exclude team_id from Prisma create payload in _prepare_mcp_server_data team_id is a request-level field, not a DB column. Excluding it prevents Prisma from rejecting the create call. Co-Authored-By: Claude Opus 4.6 --- 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 fbef33c32e..0bc102889b 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 not in the DB schema + 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)