anomalyco / anomalyco/opencode

MCP OAuth prompt hardcodes opencode binary name

Open
#46,790 0 comments 0 reactions 1 assignee View on GitHub

@rekram1-node is already working on this.

Since Sep 2, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

When an MCP server requires OAuth, opencode surfaces two prompts telling the user to run opencode mcp auth <name>:

  • a toast published from packages/opencode/src/mcp/index.ts when connect fails with an auth error
  • the "Needs authentication" line in the /mcp status dialog (packages/tui/src/component/dialog-status.tsx)

The opencode prefix is a literal string. Downstream distributions or wrappers that invoke the same binary under a different name give users a command that isn't on their $PATH.

Proposal: honor an OPENCODE_CLI_NAME env var (following the existing OPENCODE_* convention) and interpolate it into both prompts. Default "opencode" — no change for normal installs.

Repro: any OAuth-requiring MCP server (e.g. Sentry). The toast says Server "sentry" requires authentication. Run: opencode mcp auth sentry regardless of how the binary was invoked.

Happy to send the PR (~4 lines).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.