env_var_expansion
Whether MCP server configuration supports environment variable expansion. Reduces the need for hardcoded secrets in config files.
Type: bool Content type: mcp
Provider Support
Section titled “Provider Support”| Provider | Supported | Mechanism |
|---|---|---|
| claude-code | ✓ | mcp_env_var_expansion: ${VAR} and ${VAR:-default} syntax in command, args, env, url, and headers fields of .mcp.json |
| codex | ✓ | mcp_env_vars: Codex RawMcpServerConfig supports an env_vars array of McpServerEnvVar entries; each entry is either a plain string or a structured object with name and optional source fields enabling named environment variable sourcing |
| crush | ✓ | Crush MCP configuration supports environment variable references in server env blocks |
| cursor | ✓ | Server configuration supports variable interpolation using ${env:NAME} for environment variables, ${userHome} for the user's home directory, and ${workspaceFolder} for the workspace root — not limited to env blocks alone. |
| factory-droid | ✓ | stdio server add command accepts --env KEY=VALUE flags; env field documented in configuration schema for stdio servers |
| gemini-cli | ✓ | env_variable_expansion: Gemini CLI MCP configuration supports environment variable expansion for secrets and paths |
| kiro | ✓ | kiro_mcp_env_var_expansion: Environment variables referenced dynamically using ${VARIABLE_NAME} syntax within MCP config values; recommended pattern for secrets instead of hardcoded values |
| opencode | ✓ | Remote MCP server headers and OAuth fields support {env:VAR_NAME} syntax for environment variable interpolation; local servers accept an environment object with key-value pairs |
| roo-code | ✓ | env_variable_expansion: server env blocks accept environment variables so secrets can be referenced from the shell environment |
| windsurf | ✓ | config_interpolation: Windsurf MCP configuration supports ${env:VAR_NAME} and ${file:/path} interpolation for environment variables and file contents |
| amp | ✗ | Amp MCP configuration does not document environment variable expansion |
| cline | ✗ | Cline MCP configuration does not document environment variable expansion syntax |
| copilot-cli | ✗ | Copilot CLI MCP configuration does not document environment variable expansion |
| pi | ✗ | not documented |
| zed | ✗ | no automatic environment variable expansion documented in Zed MCP env blocks |