You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running opencode mcp auth in a remote or headless environment (SSH, devcontainer, WSL without display), the command fails with a cryptic "Something went wrong" error because it cannot open a browser.
The open package tries to launch xdg-open (on Linux) which either:
Doesn't exist (ENOENT error)
Exists but fails because there's no display server
In both cases, the user has no way to complete the OAuth flow because the authorization URL is not shown.
Expected Behavior
When browser opening fails, the authorization URL should be displayed so users can manually copy it and open it in a browser on their local machine.
Actual Behavior
$ opencode mcp auth jira --log-level DEBUG --print-logs true
...
INFO opening browser for oauth
▲ Something went wrong
ERROR e=Executable not found in $PATH: "xdg-open" exception
I ran into this, too. Getting around xdg-open requirement is one step, I did this to try and move forward:
#!/bin/bash
# Install at: /usr/local/bin/xdg-open
# Opens URL in host browser via VS Code's browser helper
if [[ -n "$BROWSER" ]]; then
"$BROWSER" "$1"
else
echo "xdg-open: $1"
fi
That opens the browser for auth just fine, but the callback URL is http://127.0.0.1:19876/mcp/oauth/callback and when I look in my devcontainer (which is patiently waiting now, rather than giving the Something went wrong error) I don't see opencode (or anything) listening on 19876. So even with the port forwarded to the devcontainer, clicking anything in my browser just hangs.
Activity
github-actions commentedon Jan 11, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if this doesn't address your specific case.
danlapid commentedon Jan 11, 2026
I did read #7114 and I don't think it's an exact duplicate, this issue is very specific the other is a bit general and vague.
bretthoerner commentedon Jan 12, 2026
I ran into this, too. Getting around
xdg-openrequirement is one step, I did this to try and move forward:That opens the browser for auth just fine, but the callback URL is
http://127.0.0.1:19876/mcp/oauth/callbackand when I look in my devcontainer (which is patiently waiting now, rather than giving theSomething went wrongerror) I don't seeopencode(or anything) listening on19876. So even with the port forwarded to the devcontainer, clicking anything in my browser just hangs.