{"record":{"id":"d2c283c7ba426a02","repo":"Kuberwastaken/claurst","slug":"unknown-mcp-server-d2c283","errorCode":null,"errorMessage":"Unknown MCP server: {}","messagePattern":"Unknown MCP server: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-rust/crates/mcp/src/lib.rs","lineNumber":1222,"sourceCode":"        McpAuthState::Required {\r\n            auth_url: config\r\n                .url\r\n                .clone()\r\n                .unwrap_or_else(|| \"(unknown URL)\".to_string()),\r\n        }\r\n    }\r\n\r\n    /// Initiate OAuth 2.0 + PKCE for an HTTP MCP server.\r\n    pub async fn initiate_auth(&self, server_name: &str) -> anyhow::Result<String> {\r\n        Ok(self.begin_auth(server_name).await?.auth_url)\r\n    }\r\n\r\n    /// Build a full OAuth authorization session for an HTTP/SSE MCP server.\r\n    pub async fn begin_auth(&self, server_name: &str) -> anyhow::Result<oauth::McpAuthSession> {\r\n        let config = self\r\n            .server_configs\r\n            .get(server_name)\r\n            .ok_or_else(|| anyhow::anyhow!(\"Unknown MCP server: {}\", server_name))?;\r\n\r\n        let base_url = config\r\n            .url\r\n            .as_deref()\r\n            .ok_or_else(|| {\r\n                anyhow::anyhow!(\r\n                    \"MCP server '{}' has no URL configured (required for OAuth)\",\r\n                    server_name\r\n                )\r\n            })?;\r\n\r\n        oauth::begin_mcp_auth(server_name, base_url).await\r\n    }\r\n\r\n    /// Run the browser-based OAuth flow and persist the resulting token.\r\n    pub async fn authenticate(&self, server_name: &str) -> anyhow::Result<oauth::McpAuthResult> {\r\n        let config = self\r\n            .server_configs\r","sourceCodeStart":1204,"sourceCodeEnd":1240,"githubUrl":"https://github.com/Kuberwastaken/claurst/blob/b0637c97ec34144387cbf2f74f65df6d16a6cef1/src-rust/crates/mcp/src/lib.rs#L1204-L1240","documentation":"begin_auth() looks up the server's configuration in server_configs before starting an OAuth session. If no config entry exists for the given name, it throws 'Unknown MCP server'. This is a config-table miss — the server may exist but OAuth can only proceed for configured servers.","triggerScenarios":"Calling McpHub::begin_auth(server_name) where server_name is not a key in self.server_configs (typo, server defined only at runtime, or configs not loaded yet).","commonSituations":"Server name typo; calling OAuth on a stdio-only server that was never registered in server_configs; configuration file not reloaded after adding the server; name mismatch between settings.json key and the code.","solutions":["List configured servers (server_configs keys) and confirm the exact name","Fix the server name to match its settings.json entry","Reload/parse the MCP configuration so the server appears in server_configs","Add the server to the configuration if it is genuinely missing"],"exampleFix":"// before\nhub.begin_auth(\"github-mcp\").await?;\n// after\nhub.begin_auth(\"github\").await?; // key must match settings.json server name","handlingStrategy":"validation","validationCode":"if !hub.configured_server_names().contains(&server_name.to_string()) {\n    anyhow::bail!(\"no MCP config for '{}'; check settings.json\", server_name);\n}","typeGuard":null,"tryCatchPattern":"match hub.begin_auth(server).await {\n    Ok(s) => s,\n    Err(e) if e.to_string().starts_with(\"Unknown MCP server\") => {\n        eprintln!(\"'{}' not in config; available: {:?}\", server, hub.configured_server_names());\n        return Ok(());\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Use the exact settings.json key as the server identifier everywhere","Reload MCP config after editing settings.json before OAuth calls","Only run OAuth flows against HTTP/SSE servers listed in the config"],"tags":["mcp","oauth","configuration","lookup-failure"],"backgroundTag":"resource-not-found","analyzedSha":"b0637c97ec34144387cbf2f74f65df6d16a6cef1","analyzedAt":"2026-09-10T00:24:58.650Z","contentChangedAt":"2026-09-10T00:24:58.650Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}