github plugin MCP: Authorization header not built correctly from ${GITHUB_PERSONAL_ACCESS_TOKEN} template (trailing brace leaks into header)

Status Open
Reported on v2.1.222
Maintainer reply None cached
Activity 1 comment · opened Aug 6, 2026

Claude Code version: 2.1.222
OS: Windows 11
Plugin: github@claude-plugins-official

Summary

The github plugin's bundled MCP server (https://api.githubcopilot.com/mcp/) fails to connect with:

HTTP 400: Streamable HTTP error: Error POSTing to endpoint: bad request: Authorization header is badly formatted

Evidence pointing at the template substitution

The plugin's .mcp.json defines the header as:

"Authorization": "Bearer ${GITHUB_PERSONAL_ACCESS_TOKEN}"

Running claude mcp get "plugin:github:github" shows:

Headers:
    Authorization: [REDACTED]}

Note the stray } sitting outside the redacted value. This suggests the ${VAR} substitution is matching ${GITHUB_PERSONAL_ACCESS_TOKEN but not consuming the closing brace, so the literal } from the template survives into the final header value — producing Bearer <token>}, which is malformed regardless of whether the token itself is valid.

Repro steps

  1. Install github@claude-plugins-official at project scope with gh authenticated.
  2. claude mcp list shows the plugin's MCP server failing with the error above — reproduced with GITHUB_PERSONAL_ACCESS_TOKEN unset.
  3. Set GITHUB_PERSONAL_ACCESS_TOKEN as a persistent user env var (setx on Windows) to a working gh auth token value, open a new terminal, start a fresh claude session.
  4. claude mcp list shows the exact same error, unchanged.

Getting an identical error before and after setting the variable — rather than a different error (e.g. a 401 for an invalid/wrong-type token) — points at the header being corrupted after substitution rather than at the token's presence or validity.

Expected

${GITHUB_PERSONAL_ACCESS_TOKEN} should fully resolve to Bearer <token> with no leftover template characters.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗