BerriAI/litellm · error · HTTPException
Only proxy admins can create MCP toolsets.
Error message
Only proxy admins can create MCP toolsets.
What it means
Role guard on POST /v1/mcp/toolset: creating a named toolset (a curated {server_id, tool_name} selection) is an admin-only mutation. The caller's role is not exactly PROXY_ADMIN, so the request is rejected before any DB write.
Source
Thrown at litellm/proxy/management_endpoints/mcp_management_endpoints.py:2828
NewMCPToolsetRequest,
UpdateMCPToolsetRequest,
)
@router.post(
"/toolset",
description="Create a new MCP toolset (admin only)",
status_code=status.HTTP_201_CREATED,
)
@management_endpoint_wrapper
async def add_mcp_toolset(
payload: NewMCPToolsetRequest,
user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),
litellm_changed_by: str | None = Header(None),
):
"""Create a named toolset — a curated selection of {server_id, tool_name} pairs."""
prisma_client: Final = get_prisma_client_or_throw("Database not connected. Connect a database to your proxy")
if LitellmUserRoles.PROXY_ADMIN != user_api_key_dict.user_role:
raise HTTPException(
status_code=status.HTTP_403_FORBIDDEN,
detail={"error": "Only proxy admins can create MCP toolsets."},
)
touched_by: Final = (
get_audit_log_changed_by(
litellm_changed_by=litellm_changed_by,
user_api_key_dict=user_api_key_dict,
litellm_proxy_admin_name=LITELLM_PROXY_ADMIN_NAME,
)
or LITELLM_PROXY_ADMIN_NAME
)
try:
result: Final = await create_mcp_toolset(prisma_client, payload, touched_by)
except UniqueViolationError:
raise HTTPException(
status_code=status.HTTP_409_CONFLICT,
detail={"error": f"A toolset named '{payload.toolset_name}' already exists."},
)View on GitHub (pinned to 77b7c6c40c)
Solutions
- Use a PROXY_ADMIN API key to create MCP toolsets.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at litellm/proxy/management_endpoints/mcp_management_endpoints.py:2828 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/c8f4aa34d88e7713.
Report an issue: GitHub.