Qwen Code browser MCP

Give Qwen Code a browser that survives the terminal task.

Local MCP endpoint

http://127.0.0.1:47812/mcp

This guide is for Qwen Code running on the same computer as Hronaut. Qwen Chat and remotely executed Qwen sessions cannot reach this computer's loopback endpoint.

Step 1 · Install

Install Qwen Code.

Qwen Code is an Apache-2.0 open-source coding agent for terminals, IDEs and desktop. npm is the most portable install; the official repository also publishes standalone and Homebrew options.

Node.js 22 or newer

Install and verify

npm install -g @qwen-code/qwen-code@latest
qwen --version

These are the current commands published in the official Qwen Code repository ↗.

Step 2 · Connect

Connect Qwen Code.

Start Hronaut first. The explicit --scope user keeps the server in ~/.qwen/settings.json across repositories, instead of trusting a project-controlled settings file.

Authentication off (default)

Add the loopback server

qwen mcp add --scope user --transport http hronaut http://127.0.0.1:47812/mcp

This command contains no credential. A new Hronaut profile starts with MCP authentication off.

Authentication on

Keep the bearer value out of JSON

{
  "mcpServers": {
    "hronaut": {
      "httpUrl": "http://127.0.0.1:47812/mcp",
      "headers": {
        "Authorization": "Bearer ${HRONAUT_MCP_TOKEN}"
      },
      "trust": false
    }
  }
}

Turn on Require MCP authentication in Hronaut and export HRONAUT_MCP_TOKEN in the shell that starts Qwen Code. Copy the owner token from the trusted Hronaut Home UI; do not paste it into JSON, a project file, chat, screenshots or shell history.

Qwen Code 0.16.0 had an environment-loading bug, since fixed, for values present only in .env. A process environment variable is the most compatible path.

Prefer editing the file? Equivalent user configuration

Authentication off · manual

~/.qwen/settings.json

{
  "mcpServers": {
    "hronaut": {
      "httpUrl": "http://127.0.0.1:47812/mcp",
      "trust": false
    }
  }
}

Step 3 · Verify

Check that it works.

Use a clean workspace for this check, before Qwen Code goes near a signed-in page.

  1. 1

    Qwen Code sees Hronaut

    Run qwen mcp list. Then start qwen, enter /mcp, and confirm that hronaut exposes tools. Restart a running Qwen session after you change its configuration.

  2. 2

    Hronaut sees Qwen Code

    Qwen Code shows an MCP readiness indicator while discovery runs. On Hronaut Home, Qwen Code should appear under Connections before you ask it to browse.

  3. 3

    Run a first browser task

    Ask: “Create a Hronaut workspace named first-check, open https://example.com inside it, and tell me the page title and workspace ID. Start with clean scratch storage.”

    Expected result: a visible first-check workspace shows Example Domain.

Security

Protect your signed-in sessions.

Keep approval on. Leave "trust": false so Qwen Code asks before it uses Hronaut tools. Its documentation warns that trust: true bypasses per-server confirmations in a trusted workspace; do not enable it for unfamiliar repositories or prompts.

Turn on authentication. A new Hronaut profile starts without authentication, so any process running as your user can control it. Enable authentication for sensitive browser profiles.

Take over for human-only steps. Pause MCP before you enter passwords, security keys, payment details or other human-only information.

Keep the endpoint local. Qwen Chat and remote or cloud runtimes run outside this desktop boundary. Do not expose or tunnel Hronaut to make those surfaces reach 127.0.0.1; run Qwen Code locally instead.

Keep going

Next steps.

Give every durable browser job its own named workspace. It keeps cookies and storage apart from other workspaces and stays available to the next Qwen Code task or another local MCP client. Learn how to hand off a login safely.

Sources

Hronaut is an independent project and is not affiliated with or endorsed by Alibaba Cloud or the Qwen team.