BerriAI/litellm · error · ValueError
url or spec_path is required for HTTP/SSE transport
Error message
url or spec_path is required for HTTP/SSE transport
What it means
Pydantic model_validator (validate_transport_fields) on the MCP server registration type rejecting an HTTP or SSE transport server that declares neither a 'url' nor a 'spec_path'. Remote MCP servers need an endpoint to connect to (directly or via a discovered spec), so the registration is refused before the server enters the registry. It is the HTTP/SSE counterpart of the stdio command/args checks in the same validator.
Source
Thrown at litellm/proxy/_types.py:1392
@classmethod
def validate_transport_fields(cls, values):
if isinstance(values, dict):
transport: Final = values.get("transport")
if transport == MCPTransport.stdio:
if not values.get("command"):
raise ValueError("command is required for stdio transport")
if not values.get("args"):
raise ValueError("args is required for stdio transport")
# Validate command against allowlist to prevent arbitrary execution
base_command: Final = os.path.basename(values["command"])
if base_command not in MCP_STDIO_ALLOWED_COMMANDS:
raise ValueError(
f"Command '{values['command']}' is not in the allowed commands list "
f"for stdio transport. Allowed commands: {sorted(MCP_STDIO_ALLOWED_COMMANDS)}"
)
elif transport in [MCPTransport.http, MCPTransport.sse]:
if not values.get("url") and not values.get("spec_path"):
raise ValueError("url or spec_path is required for HTTP/SSE transport")
return values
@model_validator(mode="before")
@classmethod
def validate_credentials_requirements(cls, values):
"""Validate credentials when provided.
auth_value is optional — users may configure it dynamically
(e.g. via per-request headers or OAuth2 flows) instead of
storing a static value at server creation time.
"""
return values
@model_validator(mode="before")
@classmethod
def validate_dcr_bridge_auth_type(cls, values):
if not isinstance(values, dict) or not values.get("dcr_bridge"):
return valuesView on GitHub (pinned to 77b7c6c40c)
Solutions
- Provide url or spec_path for HTTP/SSE transport.
Example fix
url='https://mcp.example.com/sse'
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at litellm/proxy/_types.py:1392 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/2ac96bf93ed67ef6.
Report an issue: GitHub.