{"record":{"id":"ab3971a0490205cb","repo":"Kuberwastaken/claurst","slug":"mcp-server-has-no-url-configured-required-fo","errorCode":null,"errorMessage":"MCP server '{}' has no URL configured (required for OAuth)","messagePattern":"MCP server '(.+?)' has no URL configured \\(required for OAuth\\)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-rust/crates/mcp/src/lib.rs","lineNumber":1228,"sourceCode":"    }\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\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","sourceCodeStart":1210,"sourceCodeEnd":1246,"githubUrl":"https://github.com/Kuberwastaken/claurst/blob/b0637c97ec34144387cbf2f74f65df6d16a6cef1/src-rust/crates/mcp/src/lib.rs#L1210-L1246","documentation":"begin_auth() requires the server config to carry a URL because OAuth discovery is done over HTTP against the server's base URL. If the matched config has no 'url' field, this error is thrown. Stdio (command-based) MCP servers cannot participate in this OAuth flow.","triggerScenarios":"Calling McpHub::begin_auth(server_name) for a server whose config entry lacks a 'url' key — typically a stdio server defined with 'command' instead of 'url'.","commonSituations":"Attempting browser OAuth against a local stdio server; config migrated from another tool that used a different field name; url field accidentally deleted or mis-indented in settings.json.","solutions":["Add a 'url' field pointing at the server's HTTP/SSE endpoint in its config entry","If the server is stdio-only, skip OAuth for it — it does not use HTTP auth","Verify the JSON config field is named 'url' and sits on the server object, not a sibling","Use a different auth mechanism (env-var token) for command-based servers"],"exampleFix":"// before (settings.json)\n{ \"mcpServers\": { \"linear\": { \"command\": \"npx\", \"args\": [\"-y\", \"mcp-linear\"] } } }\n// after\n{ \"mcpServers\": { \"linear\": { \"url\": \"https://mcp.linear.app/sse\" } } }","handlingStrategy":"validation","validationCode":"let cfg = hub.server_config(server_name)\n    .ok_or_else(|| anyhow::anyhow!(\"server '{}' not configured\", server_name))?;\nif cfg.url.is_none() {\n    anyhow::bail!(\"server '{}' is stdio-only; OAuth requires a url\", server_name);\n}","typeGuard":"fn has_oauth_url(cfg: &McpServerConfig) -> bool {\n    cfg.url.as_deref().map_or(false, |u| u.starts_with(\"http\"))\n}","tryCatchPattern":"match hub.begin_auth(server).await {\n    Ok(s) => s,\n    Err(e) if e.to_string().contains(\"no URL configured\") => {\n        eprintln!(\"{server} has no url; use env-var auth instead\");\n        return Ok(());\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Give every remote MCP server a url field in its config","Skip OAuth in tooling for servers configured with command (stdio)","Validate server configs at load time: url required for remote servers"],"tags":["mcp","oauth","configuration"],"backgroundTag":"missing-required-config-field","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"}