[BUG] variable expansion not working in `.mcp.json`
Resolved 💬 3 comments Opened Jul 9, 2025 by Morriz Closed Jul 10, 2025
Environment
- Platform (select one):
- [x] Anthropic API
- Claude CLI version: 1.0.44
- Operating System: macOS 15.5
- Terminal: VSCode
Bug Description
When starting Claude from an env where a var is set, that var is not expanded in .mcp.json. Injecting the token string directly does work, so the config is correct.
Steps to Reproduce
- export TOKEN=...
- create
.mcp.jsonwith, for example, the GitHub MCP server:
{
"mcpServers": {
"github": {
"type": "http",
"url": "https://api.githubcopilot.com/mcp/",
"headers": {
"Authorization": "Bearer ${TOKEN}"
}
},
...
claude --debug- Choose
/mcp - Check that the server is not starting correctly, and see output:
[DEBUG] MCP server "github": No token data found
[DEBUG] MCP server "github": Using redirect port: 52240
[DEBUG] MCP server "github": Generated new OAuth state
[DEBUG] MCP server "github": Starting SDK auth
[DEBUG] MCP server "github": Server URL: https://api.githubcopilot.com/mcp/
[DEBUG] MCP server "github": No client info found
[DEBUG] MCP server "github": SDK auth error: Error: Dynamic client registration failed: HTTP 404
Expected Behavior
The env var to be expanded
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗