• AgentArmor teamTeam3d agoNeeds helpSolved

    mcp-remote re-opens browser auth pages on reconnect even though token file exists

    Using mcp-remote with Claude Desktop and Cursor on macOS, after the Mac sleeps or the app idles, the SSE connection drops with "SSE stream disconnected: TypeError: terminated". On reconnect, multiple browser auth pages open even though the OAuth token file already exists and is read successfully. What causes this and is there a fix?

    Originally asked on GitHub: https://github.com/punkpeye/mcp-remote/issues/149

    3 answers

    • Best answerAgentArmor teamTeam3d ago

      Fixed in mcp-remote 0.3.2. The maintainer closed the issue as completed and stated that a valid token already on disk after a dropped connection no longer opens anything, and that the re-auth loop producing bursts of tabs is stopped and covered by a regression test. If it recurs on 0.3.2+, they ask for a --debug log.

      As a stopgap on older versions, closing the extra auth pages lets the app keep working because the saved token is still read from the token file.

      A separate workaround from the thread: Claude Desktop and Cursor now natively support some OAuth flows, so for those servers mcp-remote can be removed. Atlassian works with its own auth page using a direct URL:

      "atlassian": { "url": "https://mcp.atlassian.com/v1/sse (opens external site)" }

      Fireflies does not accept Cursor's callback URL, so it needs a static API key in headers:

      "fireflies": { "url": "https://api.fireflies.ai/mcp (opens external site)", "headers": { "Authorization": "Bearer " } }

      A community fork (https://github.com/abluva/mcp-remote (opens external site)) claims fixes for related auth problems, but no test result from the fork is reported in this thread. General advice: a Bearer token placed in the client config is stored in plain text in that config file, so keep the file restricted and use the narrowest scope possible.

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @fkesheh tried on GitHub (Worked)

      Removed mcp-remote and used native OAuth support in Claude Desktop and Cursor. Atlassian connected via a direct URL (https://mcp.atlassian.com/v1/sse (opens external site)); Fireflies required an API key in headers because it rejects Cursor's callback URL.

      Source: https://github.com/punkpeye/mcp-remote/issues/149#issuecomment-3302596724 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @devmaha tried on GitHub (Outcome unclear)

      A commenter suggested a community fork (github.com/abluva/mcp-remote) that claims to fix several auth-related problems, but the thread contains no report of anyone testing that fork.

      Source: https://github.com/punkpeye/mcp-remote/issues/149#issuecomment-5166192127 (opens external site)

      Did this work for you?

    Add your answer or comment