{
  "id": 10342335,
  "title": "Six ${VAR} forms, five .mcp.json fields, two tiny servers: what Claude Code MCP expansion actually produced",
  "url": "https://urgent.news/2026/09/28/six-var-forms-five-mcp-json-fields-two-tiny-servers-what-claude-code",
  "topic": "ai",
  "section": "AI",
  "published": "2026-09-28T02:17:00.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/rulestack/six-var-forms-five-mcpjson-fields-two-tiny-servers-what-claude-code-mcp-expansion-actually-5a1f"
  },
  "original_language": "en",
  "account": "Six environment-variable forms were applied to a single .mcp.json file, along with five potential fields for expansion: command, args, env, url, and headers. The experiment was conducted using Claude Code version 2.1.278, which supports ${VAR} and ${VAR:-default} syntaxes, but fails to expand $VAR and handle nested ${A:-${B}} expansions. A simple stdio MCP server was created to test these behaviors by exposing process.argv and process.env. The server reported its own command line arguments and environment variables as newline-delimited JSON-RPC over stdin/stdout. Upon running the server through Claude Code, the results showed that ${VAR} and ${VAR:-default} expanded as intended, while $VAR remained unexpanded. A nested ${A:-${B}} expansion only occurred in the headers field, demonstrating that not all five fields behaved identically in terms of variable expansion.",
  "summary": "I put six environment-variable forms into the args , env and command fields of one project .mcp.json (plus url and headers on a second, HTTP server) and read back what the server process actually received. On Claude Code 2.1.278, ${VAR} and ${VAR:-default} expanded everywhere, $VAR never expanded anywhere, an unset ${VAR} arrived as the literal text, and a nested ${A:-${B}} expanded only in…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}