Qwen Code browser MCP
Give Qwen Code a browser that survives the terminal task.
Hronaut is a visible Chromium browser that runs as its own app. The local Qwen Code process connects over native Streamable HTTP MCP, and your workspaces, sign-ins and tabs stay put after each Qwen session.
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 --versionThese are the current commands published in the official Qwen Code repository ↗.
Step 2 · Connect
Connect Qwen Code.
Start Hronaut first. Add Hronaut to your user settings in ~/.qwen/settings.json, so it works across repositories instead of trusting a project-controlled settings file.
Authentication on (default)
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
}
}
}Export HRONAUT_MCP_TOKEN in the shell that starts Qwen Code. Read the owner token from the owner-only file that Hronaut Home identifies; 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.
Turned authentication off?
Use this only with a profile whose Require MCP authentication is off, such as one from before Hronaut 3.5 that kept that setting. While authentication is on, Hronaut rejects a connection without the token.
Authentication off
Add the loopback server
qwen mcp add --scope user --transport http hronaut http://127.0.0.1:47812/mcpThis command contains no credential. The explicit --scope user keeps the server in ~/.qwen/settings.json.
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
Qwen Code sees Hronaut
Run
qwen mcp list. Then startqwen, enter/mcp, and confirm that hronaut exposes tools. Restart a running Qwen session after you change its configuration. - 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
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-checkworkspace 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.
Keep authentication on. A new Hronaut profile requires the owner token for MCP, so other processes running as your user cannot drive the browser. A profile from before Hronaut 3.5 keeps the setting it saved: if Require MCP authentication is off in Settings → MCP security, turn it on before you use valuable sign-ins.
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
- Official Qwen Code repository — Apache-2.0 source, supported local surfaces and installation commands.
- Qwen Code MCP guide — native Streamable HTTP, user scope, header configuration,
/mcp, discovery and trust semantics. - Qwen Code environment-loading fix — the historical
.envinterpolation limitation and its resolved change.
Hronaut is an independent project and is not affiliated with or endorsed by Alibaba Cloud or the Qwen team.