Hmbown/CodeWhale · warning

OAuth storage is disabled for plugin-contributed MCP servers

Error message

OAuth storage is disabled for plugin-contributed MCP servers

What it means

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.

Solutions

  1. Skip plugin-contributed servers in logout flows — filter on server.reviewed_plugin before calling delete
  2. If tokens genuinely exist for a plugin server, clear them by fixing/removing the plugin's environment-provided credentials instead
  3. Only call delete_oauth_tokens_for_server for user-configured URL-based servers
  4. If a stale token file exists on disk from before the policy, remove it manually from the OAuth token storage path

Example fix

// before
for (_, server) in servers { delete_oauth_tokens_for_server(name, server)?; }
// after
for (_, server) in servers {
    if server.reviewed_plugin.is_none() {
        delete_oauth_tokens_for_server(name, server)?;
    }
}
Defensive patterns

Strategy: validation

Validate before calling

fn oauth_logout_applicable(server: &McpServerConfig) -> bool {
    server.reviewed_plugin.is_none() && server.url.is_some()
}

Try / catch

match delete_oauth_tokens_for_server(name, server) {
    Err(e) if e.to_string().contains("storage is disabled for plugin-contributed") => Ok(false),
    other => other,
}

Prevention

When it happens

Trigger: Calling delete_oauth_tokens_for_server (via /mcp logout or `codewhale mcp logout`) for a server whose reviewed_plugin is Some.

Common situations: 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.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22). Data as JSON: /api/errors/bbc30444326be713. Report an issue: GitHub.

Appendix: source

Thrown at crates/tui/src/mcp/oauth.rs:1370

the session status while this call waits. The same URL is returned in this \
call's result; if the user reports the browser did not open, show that URL \
to the user verbatim and ask them to complete the sign-in there.\n\
2. The call blocks (up to 5 minutes) until the browser flow completes on the \
local callback listener, is declined, or times out. Do not assume success \
before the call returns.\n\
3. On success the server reconnects and its real MCP tools replace this \
synthetic authenticate tool, becoming callable from the next model request \
in this session.\n\n\
Treat the URL as sensitive — do not modify it or strip query parameters. If \
the flow is declined, cancelled, or times out, the call returns an error; \
relay it truthfully and suggest `/mcp login {server_name}` in the TUI or \
`codewhale mcp login {server_name}` from a terminal."
    )
}

pub fn delete_oauth_tokens_for_server(name: &str, server: &McpServerConfig) -> Result<bool> {
    if server.reviewed_plugin.is_some() {
        bail!("OAuth storage is disabled for plugin-contributed MCP servers");
    }
    let Some(url) = server.url.as_deref() else {
        bail!("OAuth logout is only supported for URL-based MCP servers");
    };
    delete_oauth_tokens(name, url)
}

pub(crate) fn server_has_manual_authorization(server: &McpServerConfig) -> bool {
    server.bearer_token_env_var.is_some()
        || contains_authorization_header(&server.headers)
        || contains_authorization_header(&server.env_headers)
}

pub fn build_default_headers(
    http_headers: &HashMap<String, String>,
    env_headers: &HashMap<String, String>,
) -> Result<HeaderMap> {
    let mut headers = HeaderMap::new();

View on GitHub (pinned to 73e0f67d83)