{"record":{"id":"5693d028ea111ddd","repo":"Hmbown/CodeWhale","slug":"mcploginservernotfound","errorCode":"McpLoginServerNotFound","errorMessage":"MCP server '{server}' not found","messagePattern":"MCP server '(.+?)' not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/tui/ui/handlers.rs","lineNumber":520,"sourceCode":"    let progress = Arc::clone(&pending.progress);\n    app.mcp_login = Some(pending);\n    report_mcp_login(\n        app,\n        app.tr(MessageId::McpLoginStarting)\n            .replace(\"{server}\", &name)\n            .replace(\"{cancel_key}\", \"Esc\"),\n        StatusToastLevel::Info,\n    );\n\n    tokio::spawn(async move {\n        let handshake = async {\n            let cfg = crate::mcp::load_config_with_workspace_and_plugins(\n                &path,\n                &workspace,\n                plugin_registry.as_ref(),\n            )?;\n            let server = cfg.servers.get(&name).ok_or_else(|| {\n                anyhow::anyhow!(\n                    codewhale_localization::tr(locale, MessageId::McpLoginServerNotFound)\n                        .replace(\"{server}\", &name)\n                )\n            })?;\n            crate::mcp::oauth::begin_oauth_login_for_server_tool(\n                &name,\n                server,\n                (!scopes.is_empty()).then_some(scopes),\n                callback_port,\n                callback_url.as_deref(),\n                network_policy.as_ref(),\n            )\n            .await\n        };\n        let operation = async {\n            // Bound the whole handshake as well as each guarded HTTP request.\n            // The timeout is in the background: even an unresponsive issuer\n            // cannot delay redraw, input or cancellation.","sourceCodeStart":502,"sourceCodeEnd":538,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/crates/tui/src/tui/ui/handlers.rs#L502-L538","documentation":"Thrown when an MCP OAuth login is requested for a server name that does not exist in the loaded MCP configuration. The code loads the MCP config from disk (with workspace and plugin context) and looks up the requested server name in `cfg.servers`; a missing key aborts the login with a localized message naming the server. This guards the OAuth flow against acting on a name that was deleted, renamed, or never defined.","triggerScenarios":"Calling start_mcp_login (via handle_mcp_ui_action) with a server name not present in the mcp config file; a stale UI entry referencing a removed server; a typo in the server key.","commonSituations":"User edited ~/.codewhale or workspace mcp config and removed a server while the TUI still shows its entry; plugin-contributed servers not loaded (registry mismatch); user typed a server name in a slash command with different casing or spelling.","solutions":["Run /mcp to list currently configured servers and use an exact name from that list","Check the MCP config file at the workspace path and add the server entry before logging in","If the server comes from a plugin, ensure the plugin registry is loaded (check plugin enablement)"],"exampleFix":"// before\ncodew mcp login myserver\n// after\n# first list names\ncodew mcp list\n# then use an existing name\ncodew mcp login my-server","handlingStrategy":"validation","validationCode":"let cfg = codewhale_mcp::load_config(&path)?;\nif !cfg.servers.contains_key(&name) { return Err(anyhow!(\"MCP server '{name}' not found\")); }","typeGuard":"fn server_exists(cfg: &McpConfig, name: &str) -> bool { cfg.servers.contains_key(name) }","tryCatchPattern":null,"preventionTips":["List servers with /mcp before issuing login","Refresh the UI panel after editing the MCP config file","Validate server names against the loaded config in any automation"],"tags":["mcp","oauth","config"],"backgroundTag":"entity-not-found","analyzedSha":"433685b2024e7bc4c99e1e2e326bcad39b4d9d65","analyzedAt":"2026-09-15T12:24:24.634Z","contentChangedAt":"2026-09-15T12:24:24.634Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}