{"record":{"id":"c8f136da736db6b3","repo":"BerriAI/litellm","slug":"mcp-stdio-command-server-command-is-not-in-the","errorCode":null,"errorMessage":"MCP stdio command '{server.command}' is not in the allowlist ({sorted(MCP_STDIO_ALLOWED_COMMANDS)}). Add it to LITELLM_MCP_STDIO_EXTRA_COMMANDS to allow this command.","messagePattern":"MCP stdio command '(.+?)' is not in the allowlist \\((.+?)\\)\\. Add it to LITELLM_MCP_STDIO_EXTRA_COMMANDS to allow this command\\.","errorType":"http","errorClass":"HTTPException","httpStatus":403,"severity":"error","filePath":"litellm/proxy/_experimental/mcp_server/mcp_server_manager.py","lineNumber":3301,"sourceCode":"            # or be read-only, causing npx to fail with ENOENT.\n            if resolved_env is not None and \"NPM_CONFIG_CACHE\" not in resolved_env:\n                resolved_env[\"NPM_CONFIG_CACHE\"] = MCP_NPM_CACHE_DIR\n            # Defense-in-depth: block commands not in the allowlist.\n            # The Pydantic validator blocks new servers; this catches legacy\n            # config/DB records predating the allowlist.\n            if server.command:\n                base_command: Final = os.path.basename(server.command)\n                # Strip .exe/.cmd/.bat/.com suffix for Windows compatibility\n                base_command_no_ext = base_command.lower()\n                for ext in [\".exe\", \".cmd\", \".bat\", \".com\"]:\n                    if base_command.lower().endswith(ext):\n                        base_command_no_ext = base_command[: -len(ext)].lower()\n                        break\n                if (\n                    base_command.lower() not in MCP_STDIO_ALLOWED_COMMANDS\n                    and base_command_no_ext not in MCP_STDIO_ALLOWED_COMMANDS\n                ):\n                    raise HTTPException(\n                        status_code=403,\n                        detail=f\"MCP stdio command '{server.command}' is not in the allowlist ({sorted(MCP_STDIO_ALLOWED_COMMANDS)}). \"\n                        f\"Add it to LITELLM_MCP_STDIO_EXTRA_COMMANDS to allow this command.\",\n                    )\n\n            stdio_config: MCPStdioConfig | None = None\n            if server.command and server.args is not None:\n                stdio_config = MCPStdioConfig(\n                    command=server.command,\n                    args=server.args,\n                    env=resolved_env,\n                )\n\n            return MCPClient(\n                server_url=\"\",  # Not used for stdio\n                transport_type=transport,\n                auth_type=server.auth_type,\n                auth_value=auth_value,","sourceCodeStart":3283,"sourceCodeEnd":3319,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py#L3283-L3319","documentation":"Error \"MCP stdio command '{server.command}' is not in the allowlist ({sorted(MCP_STDIO_ALLOWED_COMMANDS)}). Add it to LITELLM_MCP_STDIO_EXTRA_COMMANDS to allow this command.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/_experimental/mcp_server/mcp_server_manager.py:3301 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add the command to LITELLM_MCP_STDIO_EXTRA_COMMANDS.","Or use an allowlisted stdio command."],"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"}