Visitar URL original
[FEATURE]: The documentation needs to include instructions for usage like `opencode mcp add github --url https://api.githubcopilot.com/mcp --header "Authorization=Bearer {env:GITHUB_TOKEN}"` · Issue #55285 · anomalyco/opencode · GitHub
Skip to content

[FEATURE]: The documentation needs to include instructions for usage like opencode mcp add github --url https://api.githubcopilot.com/mcp --header "Authorization=Bearer {env:GITHUB_TOKEN}" #55285

Open

Description

@linghengqian

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Activity

  1. opencode-agent commented on Oct 14, 2026

    @opencode-agent
    Contributor

    Thanks for filing this again, @linghengqian. You're asking for the docs to cover non-interactive opencode mcp add, i.e. the --url / --header / --env flags added in #31054, with an example like --header "Authorization=Bearer {env:GITHUB_TOKEN}".

    In the repo right now:

    • The newer CLI docs (services/www/src/docs/content/cli/commands.mdx) already have English examples for --url, --header, --env and --global. They don't show {env:...} in a header, and that page isn't translated.
    • The page you linked (/docs/zh-cn/cli/#mcp, from packages/web/src/content/docs/) and its other language versions still show only the interactive opencode mcp add.

    Maintainers will consider updating these.

    Related:

  2. linghengqian commented on Oct 14, 2026

    @linghengqian
    Author

    services/www/src/docs/content/cli/commands.mdx only exists in Git; there isn't an actual URL for it, right?

  3. Jun516 commented on Oct 20, 2026

    @Jun516

    I'd like to cover the existing non-interactive mcp add flags in the English and Simplified Chinese CLI docs linked here, if this is available. I'll verify the examples against the released CLI, including {env:...} header references and local --env usage. This is documentation only; I'll use Codex to prepare and verify the change.

  4. nikitaluger commented on Nov 8, 2026

    @nikitaluger

    Adding a concrete GitHub remote MCP failure from OpenCode 2.2.0 on Windows 11.

    Config:

    "mcp": {
      "servers": {
        "github": {
          "type": "remote",
          "url": "https://api.githubcopilot.com/mcp/"
        }
      }
    }

    /mcps → github → sign in fails immediately. Logs:

    mcp oauth authorization setup failed
    errors="[{\"message\":\"Incompatible auth server: does not support dynamic client registration\"}]"
    GET https://api.githubcopilot.com/mcp/ -> 401
    mcp connect failed server=github status=needs_auth
    

    GitHub's remote MCP README says each host application must configure a GitHub App/OAuth App for OAuth, or use a PAT. OpenCode does not ship a pre-registered GitHub client, and GitHub's auth server rejects DCR, so there is no working OAuth path out of the box.

    One docs detail worth calling out: gh auth token returns a gho_... OAuth token, and the remote server rejects it with:

    Authorization header is badly formatted (HTTP 400)
    

    The documented alternative is a classic ghp_... PAT with public_repo:

    "github": {
      "type": "remote",
      "url": "https://api.githubcopilot.com/mcp/",
      "oauth": false,
      "headers": {
        "Authorization": "Bearer {env:GITHUB_TOKEN}"
      }
    }

    or:

    opencode mcp add github --url https://api.githubcopilot.com/mcp/ \
      --header "Authorization=Bearer {env:GITHUB_TOKEN}"

    So the docs should explicitly say "classic PAT, not a gho_ token" and note that GitHub remote OAuth requires a pre-registered client. The local GitHub MCP server (Go/Docker) is the no-PAT option because it includes its own OAuth app credentials.

    Related: #55335 (misleading DCR error when an oauth block is silently dropped).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions