I am trying to configure a local MCP server in .codex/config.toml using the following example:
[mcp_servers.system-mcp]
command = "dotenvx"
args = ["-q", "run", "-f", ".env", "-f", ".env.local", "-o", "--", "tools/system-mcp/run.sh"]
startup_timeout_sec = 180
cwd = "."
The server definition appears to be picked up, but the actual startup fails because the working directory is different from what the command expects, so the relative path to tools/system-mcp/run.sh is not visible/resolvable for Codex.
Expected behavior#
The local MCP server should be started with the expected working directory, or relative paths in args / cwd should be resolved consistently relative to the project root.
Actual behavior#
The MCP configuration is present, but the server does not start successfully because the runtime working directory differs from the expected one, causing the relative script path to fail.