{"record":{"id":"51375acb9e4ae1a2","repo":"BerriAI/litellm","slug":"command-is-required-for-stdio-transport","errorCode":null,"errorMessage":"command is required for stdio transport","messagePattern":"command is required for stdio transport","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/proxy/_types.py","lineNumber":1380,"sourceCode":"        description=\"Server-managed: set by the endpoint; caller values are overridden.\",\n    )\n    submitted_by: str | None = Field(\n        None,\n        description=\"Server-managed: set by the endpoint; caller values are overridden.\",\n    )\n    submitted_at: datetime | None = Field(\n        None,\n        description=\"Server-managed: set by the endpoint; caller values are overridden.\",\n    )\n\n    @model_validator(mode=\"before\")\n    @classmethod\n    def validate_transport_fields(cls, values):\n        if isinstance(values, dict):\n            transport: Final = values.get(\"transport\")\n            if transport == MCPTransport.stdio:\n                if not values.get(\"command\"):\n                    raise ValueError(\"command is required for stdio transport\")\n                if not values.get(\"args\"):\n                    raise ValueError(\"args is required for stdio transport\")\n                # Validate command against allowlist to prevent arbitrary execution\n                base_command: Final = os.path.basename(values[\"command\"])\n                if base_command not in MCP_STDIO_ALLOWED_COMMANDS:\n                    raise ValueError(\n                        f\"Command '{values['command']}' is not in the allowed commands list \"\n                        f\"for stdio transport. Allowed commands: {sorted(MCP_STDIO_ALLOWED_COMMANDS)}\"\n                    )\n            elif transport in [MCPTransport.http, MCPTransport.sse]:\n                if not values.get(\"url\") and not values.get(\"spec_path\"):\n                    raise ValueError(\"url or spec_path is required for HTTP/SSE transport\")\n        return values\n\n    @model_validator(mode=\"before\")\n    @classmethod\n    def validate_credentials_requirements(cls, values):\n        \"\"\"Validate credentials when provided.","sourceCodeStart":1362,"sourceCodeEnd":1398,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/_types.py#L1362-L1398","documentation":"Pydantic model_validator (validate_transport_fields) on the MCP server registration type rejecting a stdio-transport server whose config has no 'command'. A stdio MCP server is launched by executing a local binary, so the command to run is mandatory; without it the proxy would have nothing to spawn. Sister guards in the same validator enforce args and the command allowlist.","triggerScenarios":"Thrown at litellm/proxy/_types.py:1380 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide the 'command' field for stdio transport."],"exampleFix":"command='npx', args=[...]","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}