How to use MCP (Context7) in Codex MacOS app?

Add the following to your codex config file (i.e ~/.codex/config.toml).

[mcp_servers.context7]
args = ["-y", "@upstash/context7-mcp"]
command = "npx"
enabled = true

[mcp_servers.context7.env]
CONTEXT7_API_KEY = <your_api_key>

Or from the Codex App UI settings > MCP Servers> + Add servers