{"record":{"id":"d0d38f95217533a9","repo":"BerriAI/litellm","slug":"command-values-command-is-not-in-the-allowe","errorCode":null,"errorMessage":"Command '{values['command']}' is not in the allowed commands list for stdio transport. Allowed commands: {sorted(MCP_STDIO_ALLOWED_COMMANDS)}","messagePattern":"Command '(.+?)' is not in the allowed commands list for stdio transport\\. Allowed commands: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/proxy/_types.py","lineNumber":1386,"sourceCode":"    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.\n\n        auth_value is optional — users may configure it dynamically\n        (e.g. via per-request headers or OAuth2 flows) instead of\n        storing a static value at server creation time.\n        \"\"\"\n        return values","sourceCodeStart":1368,"sourceCodeEnd":1404,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/_types.py#L1368-L1404","documentation":"Pydantic model_validator on the MCP server registration type rejecting a stdio server whose base command (basename of the configured command, so wrapped paths like /bin/npx resolve to 'npx') is not in the MCP_STDIO_ALLOWED_COMMANDS allowlist. This is a security control against arbitrary command execution via the registration API; the message lists the sorted allowlist so the caller can pick a permitted launcher.","triggerScenarios":"Thrown at litellm/proxy/_types.py:1386 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a command from the allowed list, or add it via LITELLM_MCP_STDIO_EXTRA_COMMANDS."],"exampleFix":"export LITELLM_MCP_STDIO_EXTRA_COMMANDS='mycommand'","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"}