You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Document how to use shell environment variables in MCP server configuration #7521
CLIIssues related to the Codex CLIdocumentationImprovements or additions to documentationmcpIssues related to the use of model context protocol (MCP) servers
There is no documentation explaining how to reference shell environment variables when configuring MCP servers in config.toml. Users need to pass API keys and other secrets to MCP servers, but it's unclear which syntax works:
Whether variable expansion happens at config load time or command execution time
Any gotchas with quoting or escaping
Important
Users should also be aware that they may need to set shell_environment_policy.ignore_default_excludes to true for environment variables to be passed through correctly. See #3064 for related discussion.
CLIIssues related to the Codex CLIdocumentationImprovements or additions to documentationmcpIssues related to the use of model context protocol (MCP) servers
Activity
github-actions commentedon Dec 3, 2025
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
PaulRBerg commentedon Dec 3, 2025
Issue #7367 is related but not quite the same. I am asking to document how to load env vars.
jpcaparas commentedon Dec 30, 2025
This is the correct way to pass environment variables to MCP servers
#3064 (comment)
docs(mcp): document how to pass environment variables to MCP servers
fix: relocate uv venv to a short path to dodge Windows MAX_PATH
chore(codex): de-personalize .codex/config.toml paths (#27)
Free skip-list path when keyless; actionable key-missing error; Codex…