BerriAI/litellm · error · HTTPException

MCP Server with ID {server_id} not found

Error message

MCP Server with ID {server_id} not found

What it means

Lookup failure while updating public MCP servers: no server with the given server_id exists in config or the registry, so the public-list update has no target.

Source

Thrown at litellm/proxy/management_endpoints/mcp_management_endpoints.py:2659

            # Load existing config
            config: Final = await proxy_config.get_config()
            # Check if user has admin permissions
            if user_api_key_dict.user_role != LitellmUserRoles.PROXY_ADMIN:
                raise HTTPException(
                    status_code=403,
                    detail={
                        "error": f"Only proxy admins can update public mcp servers. Your role={user_api_key_dict.user_role}"
                    },
                )

            if litellm.public_mcp_servers is None:
                litellm.public_mcp_servers = []

            for server_id in request.mcp_server_ids:
                server = global_mcp_server_manager.get_mcp_server_by_id(server_id=server_id)
                if server is None:
                    raise HTTPException(
                        status_code=404,
                        detail=f"MCP Server with ID {server_id} not found",
                    )

            litellm.public_mcp_servers = request.mcp_server_ids

            # Update config with new settings
            if "litellm_settings" not in config or config["litellm_settings"] is None:
                config["litellm_settings"] = {}

            config["litellm_settings"]["public_mcp_servers"] = litellm.public_mcp_servers

            # Save the updated config
            await proxy_config.save_config(new_config=config)

            verbose_proxy_logger.debug(
                "Updated public mcp servers to: %s by user: %s", litellm.public_mcp_servers, user_api_key_dict.user_id
            )

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Verify the server_id exists via GET /mcp/servers before updating.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/proxy/management_endpoints/mcp_management_endpoints.py:2659 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/aa8ec2b5e8692cda. Report an issue: GitHub.