Description
A custom mcp-servers container that declares an empty-valued env var to forward a same-named ADO pipeline variable never actually receives the value. The variable arrives empty inside the container, which shows up later as an opaque MCP startup/auth failure rather than a compile-time error.
Repro
mcp-servers:
azure-devops:
container: "node:20-slim"
entrypoint: "npx"
entrypoint-args: ["-y", "@azure-devops/mcp", "myorg", "-a", "envvar"]
env:
ADO_MCP_AUTH_TOKEN: "" # intended: pass through the pipeline var of the same name
Set a pipeline variable ADO_MCP_AUTH_TOKEN, compile, and run. The MCP container starts with an empty ADO_MCP_AUTH_TOKEN.
Root cause
The passthrough requires two outputs, both in src/compile/common.rs:
- generate_mcpg_docker_env emits the docker run -e ADO_MCP_AUTH_TOKEN flag (host process env → container). This already handled user mcp-servers env vars.
- generate_mcpg_step_env emits the step-level env: { ADO_MCP_AUTH_TOKEN: $(ADO_MCP_AUTH_TOKEN) } mapping (pipeline variable → host process env). This only mapped extension pipeline vars and skipped user mcp-servers env entirely.
With (2) missing, the host process running MCPG never has the variable, so the -e VAR flag forwards an empty value. The two halves of the passthrough are out of sync.
Description
A custom mcp-servers container that declares an empty-valued env var to forward a same-named ADO pipeline variable never actually receives the value. The variable arrives empty inside the container, which shows up later as an opaque MCP startup/auth failure rather than a compile-time error.
Repro
Set a pipeline variable ADO_MCP_AUTH_TOKEN, compile, and run. The MCP container starts with an empty ADO_MCP_AUTH_TOKEN.
Root cause
The passthrough requires two outputs, both in src/compile/common.rs:
With (2) missing, the host process running MCPG never has the variable, so the -e VAR flag forwards an empty value. The two halves of the passthrough are out of sync.