Skip to main content
This page shows how to add the Telivy MCP server to the OpenAI Codex CLI. Codex connects to Streamable HTTP MCP servers and can read a header value from an environment variable, so the key never has to be written into its configuration file. The Codex CLI, the ChatGPT desktop app and the Codex IDE extension share the same MCP configuration. The codex mcp add command has no option for custom headers, so you add Telivy by editing the configuration file.

Prerequisites

Store the key in an environment variable

Add this line to your shell profile (for example ~/.zshrc or ~/.bashrc), then open a new terminal:

Add the server

1

Open the configuration file

Open ~/.codex/config.toml in your home folder, creating it if it does not exist. To add Telivy to one trusted project only, use .codex/config.toml in that project instead.
2

Add the Telivy table

env_http_headers maps the x-api-key header to the name of the environment variable, and Codex reads the value from the environment when it connects. Write the variable name exactly as shown, without $ or ${}. default_tools_approval_mode = "writes" makes Codex ask for approval before it runs any Telivy tool that is not marked read-only.

Verify the connection

Run codex mcp list in a terminal and check that telivy is listed. Then start codex and type /mcp to see the active MCP servers and their tools. If Telivy is listed without tools or reports an error, see Troubleshooting.

Approvals

With default_tools_approval_mode = "writes", Codex runs Telivy tools that read data without asking and asks before tools that create, update, rescan or uninstall something. To be asked before every Telivy tool call, set the value to "prompt". You can also override a single tool with tools.<tool name>.approval_mode, or hide tools with disabled_tools. Avoid "auto" for the Telivy server, because it lets the assistant change data without asking.

Try it

Start codex and send a prompt such as:
For more prompts, see Example workflows.

Remove the server

Run:
You can also delete the [mcp_servers.telivy] table from config.toml, or keep it and add enabled = false to turn the server off without deleting it.