Open the config file
Open ~/.codex/config.toml; on Windows it is %USERPROFILE%\.codex\config.toml.
Way one: sign in
Add a [mcp_servers.ravands] section with only url = "https://ravands.app/mcp". Then run codex mcp login ravands in a terminal; the browser opens the Ravand approval page.
Way two: token in the file
In the same section write url = "https://ravands.app/mcp" and http_headers = { Authorization = "Bearer <token>" }. It does not depend on an environment variable, which makes it the most reliable for the desktop app.
Environment variable only if permanent
With bearer_token_env_var = "RAVANDS_MCP_TOKEN" the variable must exist in the environment Codex started in. On Windows save it with setx RAVANDS_MCP_TOKEN "<token>" and reopen Codex. Do not set bearer_token_env_var and an Authorization header together.
Check it
codex mcp list should show ravands. In a chat ask “What can you access in Ravand?”.
Tips
- For plugin mode use /mcp/plugin instead of /mcp; it accepts both ways.
- If you rename the server, run login with the same name.
Common questions
What does “Environment variable … is not set” mean?
Codex could not find the variable named in bearer_token_env_var and did not start the server at all. Either set the variable permanently and reopen Codex, or delete that line and put the token in http_headers.
Codex gets 401?
The token is revoked or expired, or MCP is off for the business. Create a new token or run codex mcp login again.