Support environment variable expansion
Open 💬 5 comments Opened Aug 25, 2025 by Epokhe
What feature would you like to see?
From CC docs: https://docs.anthropic.com/en/docs/claude-code/mcp#environment-variable-expansion-in-mcp-json
I think codex doesn't support this yet, at least the same ${ENV_VAR} syntax didn't work for me. Currently I have to put secrets directly into ~/.codex/config.toml, I think?
Are you interested in implementing this feature?
No
Additional information
_No response_
5 Comments
I tried different syntaxes as well and couldn't manage to make environment variable interpolation work, so I believe Codex CLI does not yet support this feature indeed.
This kind of feature would be great when you need to share and sync Codex CLI config across multiple, possibly ephemeral, dev environments (e.g., devcontainers, Gihub Codespaces) while letting each machine manage its own secrets or instance specific params.
Env var expansion will help a lot with stuff like this:
GIT_CONFIG_GLOBALneeds to be absolute, so~/won't work.I have this in my dotfiles that automatically pulled in Dev Containers, so having project-specific config is not an option.
I currently have an Ansible playbook that solves this (that also merges local config), sharing it in case anyone needs a workaround:
I use such a script to run it:
can't believe codex still doesn't support the env expansion......
Really need this as well there is now way to have a shared config now.
What is the best workaround today? assuming i have dynamic url for remote MCP that i want to plant in plugin ?