{"record":{"id":"767e8b174eba39cd","repo":"Hmbown/CodeWhale","slug":"mcp-server-server-name-is-disabled","errorCode":null,"errorMessage":"MCP server '{server_name}' is disabled","messagePattern":"MCP server '(.+?)' is disabled","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/mcp.rs","lineNumber":3991,"sourceCode":"    /// release it before the (up to five minute) browser wait in\n    /// [`oauth::McpOAuthToolLogin::finish`]. Holding the lock across that wait\n    /// would freeze every other MCP call, the `/mcp` manager, and the\n    /// Extensions view for the whole sign-in.\n    pub(crate) async fn begin_authenticate_tool(\n        &self,\n        server_name: &str,\n    ) -> Result<AuthenticateToolStart> {\n        self.require_server(server_name)?;\n        Self::authorize_call(\n            &self.disallowed_tools,\n            &Self::mcp_model_tool_name(server_name, AUTHENTICATE_TOOL_NAME),\n            &serde_json::json!({}),\n        )?;\n        let server = self\n            .server_config(server_name)\n            .ok_or_else(|| anyhow::anyhow!(\"MCP server '{server_name}' is no longer configured\"))?;\n        if !server.is_enabled() {\n            anyhow::bail!(\"MCP server '{server_name}' is disabled\");\n        }\n\n        // Already-authorized branch: a login that completed since the catalog\n        // was built (e.g. `codewhale mcp login` in another window) must not\n        // restart the browser flow — adopt the stored tokens by reconnecting.\n        let ready = self\n            .connections\n            .get(server_name)\n            .is_some_and(McpConnection::is_ready);\n        if ready || oauth::has_usable_stored_tokens(server_name, &server) {\n            return Ok(AuthenticateToolStart::AlreadyAuthorized);\n        }\n        let login = oauth::begin_oauth_login_for_server_tool(\n            server_name,\n            &server,\n            None,\n            self.oauth_callback_port,\n            self.oauth_callback_url.as_deref(),","sourceCodeStart":3973,"sourceCodeEnd":4009,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/mcp.rs#L3973-L4009","documentation":"During the OAuth/login ready-check flow for an MCP server, the server's current config is fetched and found to be disabled. The flow refuses to proceed (e.g. restarting a browser login) because authentication for a disabled server is pointless and would silently diverge from config intent.","triggerScenarios":"Invoking the login/authorize path for `server_name` when `server_config(server_name)` resolves but `is_enabled()` is false. Note the distinct 'no longer configured' error when the server is missing entirely.","commonSituations":"Running `codewhale mcp login` (or triggering login from the catalog) for a server that was disabled in config; disabling a server between catalog build and login.","solutions":["Enable the MCP server in config first, then run the login/authorize flow again.","If the server was intentionally disabled, cancel the login instead of authenticating it.","Confirm the server name matches an enabled entry in the active MCP config file."],"exampleFix":"// before\n[mcp.servers.github]\nenabled = false\n# then: codewhale mcp login github  -> fails\n// after\n[mcp.servers.github]\nenabled = true\n# then: codewhale mcp login github","handlingStrategy":"validation","validationCode":"if let Some(cfg) = pool.server_config(name) {\n    if !cfg.is_enabled() {\n        return Err(format!(\"enable server '{name}' before running login\"));\n    }\n} else {\n    return Err(format!(\"server '{name}' is no longer configured\"));\n}","typeGuard":null,"tryCatchPattern":"match pool.start_login(name).await {\n    Err(e) if e.to_string().ends_with(\"is disabled\") => {\n        // prompt user to enable the server; do not open the browser flow\n    }\n    r => r?,\n}","preventionTips":["Run `codewhale mcp login` only for servers shown as enabled in the catalog.","Re-check enabled state after any config edit before starting OAuth.","Distinguish 'disabled' from 'no longer configured' when guiding the user."],"tags":["mcp","oauth","disabled","configuration"],"backgroundTag":"feature-not-enabled","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-22T21:17:16.096Z"}