-
Notifications
You must be signed in to change notification settings - Fork 148
[BUG] apm install writes bare ${VAR} in VS Code mcp.json headers #944
Copy link
Copy link
Open
Labels
area/cliCLI command surface, flags, help text (cross-cutting).CLI command surface, flags, help text (cross-cutting).area/mcp-configMCP server configuration depth, transports, variable resolution.MCP server configuration depth, transports, variable resolution.bugDeprecated: use type/bug. Kept for issue history; will be removed in milestone 0.10.0.Deprecated: use type/bug. Kept for issue history; will be removed in milestone 0.10.0.priority/highShips in current or next milestoneShips in current or next milestonestatus/acceptedDirection approved, safe to start work.Direction approved, safe to start work.status/triagedInitial agentic triage complete; pending maintainer ratification (silence = approval).Initial agentic triage complete; pending maintainer ratification (silence = approval).theme/portabilityOne manifest, every target. Multi-target deploy, marketplace, packaging, install.One manifest, every target. Multi-target deploy, marketplace, packaging, install.type/bugSomething does not work as documented.Something does not work as documented.
Milestone
Metadata
Metadata
Assignees
Labels
area/cliCLI command surface, flags, help text (cross-cutting).CLI command surface, flags, help text (cross-cutting).area/mcp-configMCP server configuration depth, transports, variable resolution.MCP server configuration depth, transports, variable resolution.bugDeprecated: use type/bug. Kept for issue history; will be removed in milestone 0.10.0.Deprecated: use type/bug. Kept for issue history; will be removed in milestone 0.10.0.priority/highShips in current or next milestoneShips in current or next milestonestatus/acceptedDirection approved, safe to start work.Direction approved, safe to start work.status/triagedInitial agentic triage complete; pending maintainer ratification (silence = approval).Initial agentic triage complete; pending maintainer ratification (silence = approval).theme/portabilityOne manifest, every target. Multi-target deploy, marketplace, packaging, install.One manifest, every target. Multi-target deploy, marketplace, packaging, install.type/bugSomething does not work as documented.Something does not work as documented.
Type
Projects
Status
Todo
Describe the bug
When a self-defined MCP server in
apm.ymluses bare${VARNAME}syntax inheaders,apm installwrites those references verbatim into.vscode/mcp.json. The target "vscode", VS Code does notresolve bare
${VARNAME}— it only understands${env:VARNAME}(host environment) or${input:id}(runtime prompt). The result is that the header value is sent as the literalstring
${VARNAME}to the MCP server instead of the secret value.To Reproduce
Define a self-defined HTTP MCP server in
apm.ymlwith a header using bare${VAR}syntax:Set MY_SECRET_TOKEN in the shell environment.
Run apm install.
Open .vscode/mcp.json — observe "Authorization": "Bearer ${MY_SECRET_TOKEN}" written verbatim.
Start the MCP server in VS Code — the header value is Bearer ${MY_SECRET_TOKEN} (literal string), not the token.
Expected behavior
apm install should translate bare ${VARNAME} references in headers to VS Code-compatible
${env:VARNAME} syntax before writing .vscode/mcp.json, so VS Code resolves them from the
host environment at runtime.
Expected output in .vscode/mcp.json:
"headers": { "Authorization": "Bearer ${env:MY_SECRET_TOKEN}"}
Actual output:
"headers": { "Authorization": "Bearer ${MY_SECRET_TOKEN}"}
Environment
OS: Windows 11
Python Version: 3.12
APM Version: 0.9.2
The target "copilot" should also take this into consideration, but removing the "env:" in case it exist.