Configuring Codex
Codex reads its MCP definitions from a configuration file in the Tom's Obvious Minimal Language (TOML) format.
Creating the Configuration File
To create the folder and the file, run the following commands in PowerShell:
mkdir $HOME\.codex -Force
notepad $HOME\.codex\config.toml
The first command creates the .codex folder and continues without an error when the folder already exists. The second command opens config.toml in Notepad.
Adding the MCP Server Definition
Add the following definition to config.toml:
[mcp_servers.KronPAMServer]
command = "npx.cmd"
args = [
"-y",
"mcp-remote",
"https://KronPAM_IP_Address:18443/mcp",
"--transport",
"http-only",
"--header",
"Authorization: Bearer ${MCP_BEARER_TOKEN}"
]
[mcp_servers.KronPAMServer.env]
MCP_BEARER_TOKEN = "TOKEN"Replace the KronPAM_IP_Address and TOKEN placeholders, then save and close the file.
Verifying the Definition
To confirm that Codex loads the definition:
1. Start Codex in the terminal:
codex
2. Run the following command:
/mcp
3. Confirm that KronPAMServer appears in the list of defined MCP servers.