HKUDS/nanobot · error · MCPAuthorizationRequiredError

MCP server requires browser authorization

Error message

MCP server requires browser authorization

What it means

Error "MCP server requires browser authorization" thrown in HKUDS/nanobot.

Source

Thrown at nanobot/agent/tools/mcp_oauth.py:335

                entry.pop("client_info", None)
            entry["redirect_uri"] = redirect_uri

        claimed = await asyncio.to_thread(self._update_entry_sync, update, claim=True)
        if not claimed:
            raise MCPAuthorizationRequiredError("MCP authorization was cancelled")

    def has_credentials(self) -> bool:
        entry = self._read_entry_sync()
        raw_tokens = entry.get("tokens") if entry is not None else None
        if not isinstance(raw_tokens, dict):
            return False
        tokens = cast(dict[str, object], raw_tokens)
        access_token = tokens.get("access_token")
        return isinstance(access_token, str) and bool(access_token)


async def _missing_callback() -> tuple[str, str | None]:
    raise MCPAuthorizationRequiredError("MCP server requires browser authorization")


async def create_mcp_oauth_auth(
    server_name: str,
    server_url: str,
    handlers: MCPOAuthHandlers | None = None,
) -> OAuthClientProvider:
    """Build the official MCP SDK OAuth provider for one configured server."""
    storage = MCPOAuthStorage(server_name, server_url)
    if handlers is not None:
        await storage.prepare_redirect_uri(
            handlers.redirect_uri,
            reset=handlers.reset_credentials,
        )
        redirect_uri = handlers.redirect_uri
        redirect_handler = handlers.redirect_handler
        callback_handler = handlers.callback_handler
    else:

View on GitHub (pinned to 42f37dc4c0)

When it happens

Trigger: Thrown at nanobot/agent/tools/mcp_oauth.py:335 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of HKUDS/nanobot@42f37dc4c0 (2026-08-26). Data as JSON: /api/errors/54496a39721fa365. Report an issue: GitHub.