BerriAI/litellm · error · ValueError

args is required for stdio transport

Error message

args is required for stdio transport

What it means

Pydantic model_validator (validate_transport_fields) on the MCP server registration type rejecting a stdio-transport server whose config has no 'args' list. LiteLLM requires an explicit (possibly empty-provided) args field for stdio launches so that the spawned command's argument vector is never ambiguous; omitting it fails validation before any process is spawned.

Source

Thrown at litellm/proxy/_types.py:1382

    submitted_by: str | None = Field(
        None,
        description="Server-managed: set by the endpoint; caller values are overridden.",
    )
    submitted_at: datetime | None = Field(
        None,
        description="Server-managed: set by the endpoint; caller values are overridden.",
    )

    @model_validator(mode="before")
    @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

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Provide the 'args' field for stdio transport.

Example fix

args=['-y','@mcp/server']
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/proxy/_types.py:1382 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/1dfdb2c7927ad037. Report an issue: GitHub.