{"record":{"id":"4db90462a5b61340","repo":"Hmbown/CodeWhale","slug":"oauth-is-disabled-for-plugin-contributed-mcp-serve","errorCode":null,"errorMessage":"OAuth is disabled for plugin-contributed MCP servers; use a reviewed environment-backed header or bearer token","messagePattern":"OAuth is disabled for plugin-contributed MCP servers; use a reviewed environment-backed header or bearer token","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/mcp/oauth.rs","lineNumber":1073,"sourceCode":"    .await\n}\n\n/// Run an MCP OAuth login that can be stopped by the caller.\n///\n/// Cancellation drops the in-flight OAuth future before this function returns,\n/// which also closes its callback listener. A caller that replaces one login\n/// with another should await the cancelled call before starting the replacement.\npub async fn perform_oauth_login_for_server_with_cancel(\n    name: &str,\n    server: &McpServerConfig,\n    explicit_scopes: Option<Vec<String>>,\n    callback_port: Option<u16>,\n    callback_url: Option<&str>,\n    cancellation_token: CancellationToken,\n    network_policy: Option<&NetworkPolicyDecider>,\n) -> Result<()> {\n    if server.reviewed_plugin.is_some() {\n        bail!(\n            \"OAuth is disabled for plugin-contributed MCP servers; use a reviewed environment-backed header or bearer token\"\n        );\n    }\n    run_cancellable_oauth(\n        &cancellation_token,\n        perform_oauth_login_for_server_inner(\n            name,\n            server,\n            explicit_scopes,\n            callback_port,\n            callback_url,\n            network_policy,\n        ),\n    )\n    .await\n}\n\nasync fn run_cancellable_oauth<F, T>(cancellation_token: &CancellationToken, future: F) -> Result<T>","sourceCodeStart":1055,"sourceCodeEnd":1091,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/mcp/oauth.rs#L1055-L1091","documentation":"The interactive OAuth login entry point refuses to start an OAuth flow for MCP servers contributed by a reviewed plugin. Plugin-contributed servers are considered pre-vetted and must authenticate with reviewed environment-backed headers or bearer tokens; the library deliberately does not store OAuth credentials for them.","triggerScenarios":"Calling perform_oauth_login_for_server / perform_oauth_login_for_server_with_cancel for an McpServerConfig whose reviewed_plugin field is Some — typically via /mcp login or the model-driven authenticate tool against a plugin-provided server.","commonSituations":"Trying to /mcp login a server that was installed through a plugin rather than user config; a plugin server that lost its env-provided credentials so a user attempts OAuth as a workaround.","solutions":["Configure the plugin server's auth via its reviewed environment-backed header or bearer token (env vars the plugin declares) instead of OAuth","Reinstall/repair the plugin so its environment-provided credentials are available","If you need OAuth, define the server directly in your MCP config (not via a plugin) and run login there","Check the plugin's documentation for the expected auth env vars"],"exampleFix":"// before (via /mcp login on plugin server — rejected)\n/mcp login plugin-server\n// after: provide credentials through the plugin's environment\nexport MY_PLUGIN_MCP_BEARER_TOKEN=...","handlingStrategy":"validation","validationCode":"fn oauth_login_supported(server: &McpServerConfig) -> bool {\n    server.reviewed_plugin.is_none()\n}","typeGuard":"fn is_user_configured_server(server: &McpServerConfig) -> bool {\n    server.reviewed_plugin.is_none() && server.url.is_some()\n}","tryCatchPattern":"if server.reviewed_plugin.is_some() {\n    eprintln!(\"plugin server: configure env-backed credentials instead of OAuth\");\n    return Ok(());\n}\nperform_oauth_login_for_server(&server).await?;","preventionTips":["Check server.reviewed_plugin before offering/invoking OAuth login","Set up the plugin's declared env auth vars when installing a plugin","Surface the plugin policy in UI so users don't attempt OAuth on plugin servers"],"tags":["oauth","mcp","plugin","policy"],"backgroundTag":"unsupported-operation","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}