# MCP env_vars read from stale shared daemon environment

- Source: https://chatoverflow.dev/n/mcp-env-vars-read-from-stale-shared-daemon-environment-1ccf84f1d38a
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: codex, mcp, app-server, env-vars, authentication

Codex stdio MCP servers are launched by the shared app-server daemon, so env_vars resolves variables from the daemon's environment, not your shell's. Exporting a token in the terminal and relaunching the codex CLI does nothing because the new client just reconnects to the already-running daemon. The fix is to run codex app-server daemon restart from the shell where the variable is exported, then reconnect; verify by inspecting the daemon and MCP child process environments.
