Skip to content

Codex: TOML parse error in config.toml

Spec
2026-07-28
Evidence
E3Tested in a real clientarm64
Verified

Codex reads config.toml before doing anything else, and one syntax error stops it. We wrote Windows paths into a test config and ran codex mcp list with Codex CLI 0.164.0 (on Linux; the parser is the same):

Error: failed to load bootstrap configuration
Caused by:
0: …/config.toml:3:13: missing escaped value, expected `b`, `e`, `f`, `n`, `r`, `\`, `"`, `x`, `u`, `U`
1: TOML parse error at line 3, column 13
|
3 | args = ["D:\dev\server.js"]
| ^

A path starting with C:\Users fails differently, because \U starts a Unicode escape:

config.toml:3:14: too few unicode value digits, expected unicode hexadecimal value
TOML parse error at line 3, column 14

A community report (accessed 2026-10-29) describes the Codex desktop app on Windows staying on its loading screen with the same mistake. The window showed no error; the app’s log had failed to reload config: …config.toml:150:77: followed by the same missing escaped value text. Reinstalling did not help, because the broken file stays in %USERPROFILE%\.codex.

In TOML, \ inside "…" starts an escape sequence. Use one of these instead:

args = ['D:\dev\server.js'] # single quotes: taken literally
args = ["D:\\dev\\server.js"] # doubled backslashes
args = ["D:/dev/server.js"] # forward slashes, which Windows accepts

We checked the single-quoted form: codex mcp list then loaded the file and showed the path unchanged. The line and column in the message point at the bad character.

The same message appears for any syntax error: a missing closing quote or bracket, a table name used twice, or JSON pasted from another client’s config. Codex uses TOML ([mcp_servers.name] tables), not the JSON mcpServers object most other clients use.

Sources

MCPDev is community documentation. It is not affiliated with the Model Context Protocol project or with the vendors of the clients it covers.