Skip to content

Finish a login on a host with no browser

CLIMCPBeginner~5 min

You can finish a Hadron sign-in on a computer that has no browser by doing the browser part on a second device: your laptop or your phone. You will need a terminal for this one, because the sign-in is started by a command-line program on the other computer. If you are signing in to the portal, none of this applies: the portal's own sign-in page has no loopback step.

When you need this

You started a sign-in on a computer you reach over SSH, in a container or on a server. You opened the address it printed on another device, signed in and approved. Then the browser showed "This site can't be reached", on an address that begins with localhost or 127.0.0.1.

The sign-in did not fail. That address points at the device you opened it on, and the program waiting for the answer is on the other computer. The address bar still holds what the program needs. Which of the two steps below you follow depends on the program you are signing in with.

With the Hadron CLI

The CLI can ask the sign-in page to show you a code, which you type back into the terminal instead of relying on the redirect.

  1. On the computer with no browser, run:
hadron auth login --no-browser

The CLI prints a sign-in address and waits for a code. Without --no-browser, it switches to this by itself when it cannot open a browser. 2. Open that address on any device with a browser, sign in and approve. 3. After you approve, the page shows a code made of two parts joined by a dot. Copy all of it. 4. Paste it at the terminal prompt and press Enter. The code is not shown as you type. The CLI stores your key as for any other sign-in.

Pasting needs a terminal. If standard input is piped, as in an agent or a CI job, the command exits with code 2 and points you to HADRON_TOKEN or --with-token instead. You need hadron 0.61.0 or later, the first release with --no-browser on hadron auth login; an older one does not know the flag. The server must be from 2026-11-25 or later; an older one sends the browser to the CLI's own address and shows no code.

With Claude Code

Claude Code does not ask for a code. It registers a localhost address with a random port, and it accepts the whole address that the browser could not open.

  1. Start the sign-in as you normally would, or run claude mcp login <name> in an interactive terminal. Add --no-browser to make it print the authorization address even when it finds a browser. Over SSH, connect with ssh -t so the prompt can read what you paste.
  2. Open the printed address on another device, sign in and approve.
  3. The browser then shows "This site can't be reached". Copy the complete address from the address bar, including everything after ?.
  4. Paste it into Claude Code's prompt.

This follows what Claude Code's MCP documentation describes, checked on 2026-11-30. Its sign-in flags can change from one release to the next, so if a command here is not recognised, that page is the authority.

What to know before you try

  • The code is a one-time sign-in code. It works once and lasts about ten minutes. A sign-in allows five wrong tries, then it is dead and you start a new one.
  • It is shown only after you approve. Hadron never decides on its own that your computer has no browser: the page shows a code only when the program asks for one.
  • Redeem it with the same values the program sent. A correct code used with a different verifier, client, redirect address or resource ends the code at once. You never do this by hand; it matters if you are building a client.
  • Denying on the other device still sends the browser to the loopback address. If you decline, you will see the same "can't be reached" page. Nothing was signed in.
  • Too many tries from one place are slowed down. The same per-source rate limit that protects sign-in applies to typing codes.