{"record":{"id":"bbc30444326be713","repo":"Hmbown/CodeWhale","slug":"oauth-storage-is-disabled-for-plugin-contributed-m","errorCode":null,"errorMessage":"OAuth storage is disabled for plugin-contributed MCP servers","messagePattern":"OAuth storage is disabled for plugin-contributed MCP servers","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/tui/src/mcp/oauth.rs","lineNumber":1370,"sourceCode":"the session status while this call waits. The same URL is returned in this \\\ncall's result; if the user reports the browser did not open, show that URL \\\nto the user verbatim and ask them to complete the sign-in there.\\n\\\n2. The call blocks (up to 5 minutes) until the browser flow completes on the \\\nlocal callback listener, is declined, or times out. Do not assume success \\\nbefore the call returns.\\n\\\n3. On success the server reconnects and its real MCP tools replace this \\\nsynthetic authenticate tool, becoming callable from the next model request \\\nin this session.\\n\\n\\\nTreat the URL as sensitive — do not modify it or strip query parameters. If \\\nthe flow is declined, cancelled, or times out, the call returns an error; \\\nrelay it truthfully and suggest `/mcp login {server_name}` in the TUI or \\\n`codewhale mcp login {server_name}` from a terminal.\"\n    )\n}\n\npub fn delete_oauth_tokens_for_server(name: &str, server: &McpServerConfig) -> Result<bool> {\n    if server.reviewed_plugin.is_some() {\n        bail!(\"OAuth storage is disabled for plugin-contributed MCP servers\");\n    }\n    let Some(url) = server.url.as_deref() else {\n        bail!(\"OAuth logout is only supported for URL-based MCP servers\");\n    };\n    delete_oauth_tokens(name, url)\n}\n\npub(crate) fn server_has_manual_authorization(server: &McpServerConfig) -> bool {\n    server.bearer_token_env_var.is_some()\n        || contains_authorization_header(&server.headers)\n        || contains_authorization_header(&server.env_headers)\n}\n\npub fn build_default_headers(\n    http_headers: &HashMap<String, String>,\n    env_headers: &HashMap<String, String>,\n) -> Result<HeaderMap> {\n    let mut headers = HeaderMap::new();","sourceCodeStart":1352,"sourceCodeEnd":1388,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/mcp/oauth.rs#L1352-L1388","documentation":"delete_oauth_tokens_for_server refuses to touch stored OAuth credentials for plugin-contributed reviewed servers. Since OAuth itself is disabled for such servers (see errors 1154/1158), there should be no stored tokens to delete; the guard keeps logout from deleting credentials that belong to the plugin's reviewed auth setup.","triggerScenarios":"Calling delete_oauth_tokens_for_server (via /mcp logout or `codewhale mcp logout`) for a server whose reviewed_plugin is Some.","commonSituations":"Running a blanket 'logout of all MCP servers' operation that iterates plugin servers; a user manually trying to clear credentials of a plugin-provided server; leftover scripts written before the plugin policy existed.","solutions":["Skip plugin-contributed servers in logout flows — filter on server.reviewed_plugin before calling delete","If tokens genuinely exist for a plugin server, clear them by fixing/removing the plugin's environment-provided credentials instead","Only call delete_oauth_tokens_for_server for user-configured URL-based servers","If a stale token file exists on disk from before the policy, remove it manually from the OAuth token storage path"],"exampleFix":"// before\nfor (_, server) in servers { delete_oauth_tokens_for_server(name, server)?; }\n// after\nfor (_, server) in servers {\n    if server.reviewed_plugin.is_none() {\n        delete_oauth_tokens_for_server(name, server)?;\n    }\n}","handlingStrategy":"validation","validationCode":"fn oauth_logout_applicable(server: &McpServerConfig) -> bool {\n    server.reviewed_plugin.is_none() && server.url.is_some()\n}","typeGuard":null,"tryCatchPattern":"match delete_oauth_tokens_for_server(name, server) {\n    Err(e) if e.to_string().contains(\"storage is disabled for plugin-contributed\") => Ok(false),\n    other => other,\n}","preventionTips":["Filter out reviewed_plugin servers before bulk logout operations","Remember OAuth storage and OAuth login share the same plugin restriction","Clear plugin server credentials through the plugin environment, not token deletion"],"tags":["oauth","mcp","plugin","logout"],"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"}