GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — customize-opencode skill: MCP headers example uses `${VAR}` but opencode interpolates `{env:VAR}` · Issue #29611 · anomalyco/opencode

customize-opencode skill: MCP headers example uses ${VAR} but opencode interpolates {env:VAR} #29611

New issue
Copy link
New issue
Copy link
Closed
#31078
Closed
customize-opencode skill: MCP headers example uses ${VAR} but opencode interpolates {env:VAR}#29611
#31078
Copy link
Assignees
StarpTech

Description

@kkdawkins
kkdawkins
opened on May 27, 2026
Issue body actions

Summary

The built-in customize-opencode skill shows an MCP headers example using shell-style ${ENV_VAR} interpolation, but opencode only interpolates {env:VAR} in config strings. The result is that a user (or an agent loading this skill) who follows the example gets the literal ${ENV_VAR} text sent over the wire as the credential, with no warning.

Where

packages/opencode/src/skill/prompt/customize-opencode.md, line 307 in the current dev branch:

"headers": { "Authorization": "Bearer ${GITHUB_TOKEN}" }

The skill body has zero matches for {env: anywhere in its 377 lines, so a reader has nothing to disambiguate against. The public docs at https://opencode.ai/docs/mcp-servers use the correct syntax (see the Context7 example: "CONTEXT7_API_KEY": "{env:CONTEXT7_API_KEY}"), so the skill is the inconsistent surface.

Reproduction

Global config ~/.config/opencode/opencode.jsonc:

{
  "mcp": {
    "tinybird": {
      "type": "remote",
      "url": "https://mcp.tinybird.co/",
      "headers": { "Authorization": "Bearer ${MCP_TINYBIRD_TOKEN}" },
      "enabled": true
    }
  }
}

With MCP_TINYBIRD_TOKEN exported in opencode's launch env, opencode log (~/.local/share/opencode/log/<latest>.log) shows:

service=mcp key=tinybird transport=StreamableHTTP connected
service=mcp key=tinybird error=MCP error -32603: Internal error: Error calling TinybirdAPI: invalid authentication token. Invalid token b'${MCP_TINYBIRD_TOKEN}': failed to get tools from client

Replacing ${MCP_TINYBIRD_TOKEN} with {env:MCP_TINYBIRD_TOKEN} makes opencode connect successfully and load the tools.

opencode version: 1.15.11

Suggested fix

Update the example on line 307 (and the matching Authorization header example earlier in the file around the mcp config block) to use {env:...}, and add a one-liner near the MCP section calling out that config-string interpolation is {env:VAR} only — ${VAR} is not interpolated.

Diff sketch:

-      "headers": { "Authorization": "Bearer ${GITHUB_TOKEN}" }
+      "headers": { "Authorization": "Bearer {env:GITHUB_TOKEN}" }

Happy to send a PR if useful.

Activity

  1. github-actions commented on May 27, 2026

    @github-actions
    github-actionsBot
    on May 27, 2026 – with GitHub Actions
    Contributor
    More actions

    This issue might be a duplicate of or related to existing issues. Please check:

    • Remote MCP headers: {env:...} interpolation not working #23664: Remote MCP headers: {env:...} interpolation not working — reports that even the correct {env:VAR} syntax doesn't work in remote MCP headers; your issue documents the incorrect ${VAR} example in the skill, which are related surfaces
    • Unable to use vars in options.headers #28527: Unable to use vars in options.headers — similar report of env var interpolation not working in headers config
  2. github-actions
    assigned
    StarpTech
    on May 27, 2026
  3. rekram1-node
    closed this as completedin #31078on Jun 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @StarpTech
    StarpTech

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

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.