{"record":{"id":"54496a39721fa365","repo":"HKUDS/nanobot","slug":"mcp-server-requires-browser-authorization","errorCode":null,"errorMessage":"MCP server requires browser authorization","messagePattern":"MCP server requires browser authorization","errorType":"exception","errorClass":"MCPAuthorizationRequiredError","httpStatus":null,"severity":"error","filePath":"nanobot/agent/tools/mcp_oauth.py","lineNumber":335,"sourceCode":"                entry.pop(\"client_info\", None)\n            entry[\"redirect_uri\"] = redirect_uri\n\n        claimed = await asyncio.to_thread(self._update_entry_sync, update, claim=True)\n        if not claimed:\n            raise MCPAuthorizationRequiredError(\"MCP authorization was cancelled\")\n\n    def has_credentials(self) -> bool:\n        entry = self._read_entry_sync()\n        raw_tokens = entry.get(\"tokens\") if entry is not None else None\n        if not isinstance(raw_tokens, dict):\n            return False\n        tokens = cast(dict[str, object], raw_tokens)\n        access_token = tokens.get(\"access_token\")\n        return isinstance(access_token, str) and bool(access_token)\n\n\nasync def _missing_callback() -> tuple[str, str | None]:\n    raise MCPAuthorizationRequiredError(\"MCP server requires browser authorization\")\n\n\nasync def create_mcp_oauth_auth(\n    server_name: str,\n    server_url: str,\n    handlers: MCPOAuthHandlers | None = None,\n) -> OAuthClientProvider:\n    \"\"\"Build the official MCP SDK OAuth provider for one configured server.\"\"\"\n    storage = MCPOAuthStorage(server_name, server_url)\n    if handlers is not None:\n        await storage.prepare_redirect_uri(\n            handlers.redirect_uri,\n            reset=handlers.reset_credentials,\n        )\n        redirect_uri = handlers.redirect_uri\n        redirect_handler = handlers.redirect_handler\n        callback_handler = handlers.callback_handler\n    else:","sourceCodeStart":317,"sourceCodeEnd":353,"githubUrl":"https://github.com/HKUDS/nanobot/blob/42f37dc4c0e409eac7818a82d165c5f2757bc075/nanobot/agent/tools/mcp_oauth.py#L317-L353","documentation":"Error \"MCP server requires browser authorization\" thrown in HKUDS/nanobot.","triggerScenarios":"Thrown at nanobot/agent/tools/mcp_oauth.py:335 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"42f37dc4c0e409eac7818a82d165c5f2757bc075","analyzedAt":"2026-08-26T00:18:52.276Z","schemaVersion":2},"datasetVersion":"2026-08-26T04:18:47.238Z"}