{"record":{"id":"fd374411288f60ba","repo":"Hmbown/CodeWhale","slug":"mcp-server-server-name-is-no-longer-configured","errorCode":null,"errorMessage":"MCP server '{server_name}' is no longer configured","messagePattern":"MCP server '(.+?)' is no longer configured","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/mcp.rs","lineNumber":3989,"sourceCode":"    /// config, the connection map, and the token store — it returns as soon\n    /// as the authorization URL exists, so a caller holding the pool lock can\n    /// 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,","sourceCodeStart":3971,"sourceCodeEnd":4007,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/mcp.rs#L3971-L4007","documentation":"During the OAuth authenticate flow, the pool looks up the server config by name after the authentication tool call; if the server was removed from the current MCP config in the meantime, this error aborts the flow instead of authorizing against a server that no longer exists.","triggerScenarios":"Calling the server's authenticate tool (AUTHENTICATE_TOOL_NAME) for a server_name that is no longer present in config when server_config() is re-queried.","commonSituations":"User deletes the server from mcp.json (or a plugin providing it is uninstalled) while a browser-based OAuth login is in flight; stale tool catalog references a removed server.","solutions":["Re-check the server still exists in MCP config; re-add it if it was removed unintentionally","Refresh the tool catalog so stale references to removed servers disappear","If the removal was intentional, abandon the login — authorization for a removed server is meaningless"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// before starting an OAuth flow, confirm the server still exists\nif pool.server_config(server_name).is_none() {\n    anyhow::bail!(\"server '{server_name}' not configured; cannot authenticate\");\n}","typeGuard":null,"tryCatchPattern":"match authenticate(server_name).await {\n    Err(e) if e.to_string().contains(\"no longer configured\") => refresh_catalog_and_recheck(server_name),\n    other => other,\n}","preventionTips":["Don't remove servers from mcp.json while a login is in flight","Re-validate config after any external mutation (CLI login, plugin install/uninstall)","Refresh the tool catalog after config edits"],"tags":["mcp","oauth","stale-config","entity-not-found"],"backgroundTag":"resource-not-found","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"}