You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
${env:VAR} is not substituted in mcp.json server headers #336232
Set MY_VAR as a persisted Windows user-level env var. Confirm it resolves correctly in a fresh terminal ($env:MY_VAR).
Fully quit and relaunch VS Code (not just "Reload Window") so the process inherits the env var.
Server fails to connect / registers no tools - consistent with the literal unsubstituted string ${env:MY_VAR} being sent as the header value (401 from the remote endpoint).
Workaround: hardcoding the literal secret value directly in headers works immediately - confirms substitution is the issue, not auth/connectivity/env-var scoping.
Expected:${env:VAR} should resolve in headers the same way it does in other MCP config contexts, or docs should explicitly state headers only supports ${input:...} (current docs are ambiguous/silent on this).
I confirm the issue. Nothing is interpolated, i.e. ${env:} or even ${input:paddle-sandbox-api-key} VS Code version: 1.140
I've used mitmproxy to see what vscode does:
Portable config the syntax is ${MY_VAR}, not ${env:MY_VAR} or ${input:...} - those not supported there.
So for example "Authorization": "Bearer ${MY_VAR}"
Could you please try the correct syntax and let me know if it still does not work for you?
Activity
oburlaca commentedon Oct 7, 2026
I confirm the issue. Nothing is interpolated, i.e.
${env:}or even${input:paddle-sandbox-api-key}VS Code version: 1.140
I've used
mitmproxyto see what vscode does:Here is my workspace
.mcp.jsonconfig:{ "inputs": [ { "id": "paddle-sandbox-api-key", "type": "promptString", "description": "Paddle sandbox API key", "password": true } ], "mcpServers": { "sandbox-paddle": { "url": "https://sandbox-mcp.paddle.com/mcp", "type": "http", "headers": { "Authorization": "Bearer ${input:paddle-sandbox-api-key}" } } }oburlaca commentedon Oct 7, 2026
In my example above I'm using the new
.mcp.jsonformat. It doesn't support interpolation. Use the old/.vscode/mcp.json.see this issue
dmitrivMS commentedon Oct 27, 2026
Portable config the syntax is
${MY_VAR}, not${env:MY_VAR}or${input:...}- those not supported there.So for example
"Authorization": "Bearer ${MY_VAR}"Could you please try the correct syntax and let me know if it still does not work for you?