github plugin MCP: Authorization header not built correctly from ${GITHUB_PERSONAL_ACCESS_TOKEN} template (trailing brace leaks into header)
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
- Install
github@claude-plugins-officialat project scope withghauthenticated. claude mcp listshows the plugin's MCP server failing with the error above — reproduced withGITHUB_PERSONAL_ACCESS_TOKENunset.- Set
GITHUB_PERSONAL_ACCESS_TOKENas a persistent user env var (setxon Windows) to a workinggh auth tokenvalue, open a new terminal, start a freshclaudesession. claude mcp listshows 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.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗