{"record":{"id":"380958368cfebcdc","repo":"BerriAI/litellm","slug":"invalid-config-for-mcp-server-server-name-or-ser","errorCode":null,"errorMessage":"Invalid config for MCP server '{server_name or server_id}': auth_type oauth2 requires an explicit oauth2_flow (got {config_oauth2_flow!r}). Set oauth2_flow: client_credentials for machine-to-machine servers (the proxy mints a shared token at token_url using client_id/client_secret, no user interaction) or oauth2_flow: authorization_code for interactive servers (per-user tokens via browser sign-in, including delegate_auth_to_upstream).","messagePattern":"Invalid config for MCP server '(.+?)': auth_type oauth2 requires an explicit oauth2_flow \\(got (.+?)\\)\\. Set oauth2_flow: client_credentials for machine-to-machine servers \\(the proxy mints a shared token at token_url using client_id/client_secret, no user interaction\\) or oauth2_flow: authorization_code for interactive servers \\(per-user tokens via browser sign-in, including delegate_auth_to_upstream\\)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/proxy/_experimental/mcp_server/mcp_server_manager.py","lineNumber":1705,"sourceCode":"            resolved_authorization_url = manual_authorization_url or (\n                gated_oauth_metadata.authorization_url if gated_oauth_metadata else None\n            )\n            resolved_token_url = manual_token_url or (gated_oauth_metadata.token_url if gated_oauth_metadata else None)\n            resolved_registration_url = manual_registration_url or (\n                gated_oauth_metadata.registration_url if gated_oauth_metadata else None\n            )\n            discovered_issuer = (\n                gated_oauth_metadata.discovered_issuer\n                if gated_oauth_metadata and not gated_oauth_metadata.from_origin_fallback\n                else None\n            )\n            effective_issuer = manual_issuer or discovered_issuer\n\n            if auth_type == MCPAuth.oauth2 and config_oauth2_flow not in (\n                \"client_credentials\",\n                \"authorization_code\",\n            ):\n                raise ValueError(\n                    f\"Invalid config for MCP server '{server_name or server_id}': auth_type oauth2 \"\n                    f\"requires an explicit oauth2_flow (got {config_oauth2_flow!r}). Set \"\n                    \"oauth2_flow: client_credentials for machine-to-machine servers (the proxy mints \"\n                    \"a shared token at token_url using client_id/client_secret, no user interaction) \"\n                    \"or oauth2_flow: authorization_code for interactive servers (per-user tokens via \"\n                    \"browser sign-in, including delegate_auth_to_upstream).\"\n                )\n\n            config_dcr_bridge = server_config.get(\"dcr_bridge\", None)\n            if config_dcr_bridge is not None and not isinstance(config_dcr_bridge, bool):\n                raise ValueError(\n                    f\"Invalid config for MCP server '{server_name or server_id}': dcr_bridge \"\n                    f\"must be a boolean (got {config_dcr_bridge!r}).\"\n                )\n            if config_dcr_bridge and auth_type not in (\n                MCPAuth.true_passthrough,\n                MCPAuth.oauth_delegate,\n            ):","sourceCodeStart":1687,"sourceCodeEnd":1723,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py#L1687-L1723","documentation":"Error \"Invalid config for MCP server '{server_name or server_id}': auth_type oauth2 requires an explicit oauth2_flow (got {config_oauth2_flow!r}). Set oauth2_flow: client_credentials for machine-to-machine servers (the proxy mints a shared token at token_url using client_id/client_secret, no user interaction) or oauth2_flow: authorization_code for interactive servers (per-user tokens via browser sign-in, including delegate_auth_to_upstream).\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/_experimental/mcp_server/mcp_server_manager.py:1705 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set oauth2_flow to client_credentials (machine-to-machine) or authorization_code (interactive) in the server config."],"exampleFix":"oauth2_flow: client_credentials","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"}