Skip to main content
The OpenAI Codex CLI supports remote streamable HTTP MCP servers natively, so it talks to her directly, with no local bridge process. Servers are registered in ~/.codex/config.toml under [mcp_servers.NAME], either by editing the file or with the codex mcp add command.
You need your PostQueen API key first. In app.postqueen.ai, open Settings > Developers > Public API and click Reveal.

Add via CLI

Replace YOUR_API_KEY with your actual key. Codex writes the entry to ~/.codex/config.toml, and all 11 PostQueen tools are available in every session from then on.

The two forms

Both authenticate with the same key. They differ in where that key ends up.
The same registration codex mcp add writes, done by hand:
~/.codex/config.toml
Syntax per the official Codex MCP documentation: a streamable HTTP server entry takes a url, while stdio servers take command/args instead. If your Codex version predates codex mcp add --url support, editing config.toml directly works on every version.
Your API key grants full access to your PostQueen workspace: treat it like a password. ~/.codex/config.toml is a plain text file, so the bearer_token_env_var form is the safer choice on shared machines. If the environment variable is not visible to the Codex process, requests are sent without an Authorization header and the connection fails. Export it before launching Codex. If the key leaks, regenerate it in Settings > Developers > Public API and update every client that uses it.

Self-hosted

On a self-hosted instance, replace https://api.postqueen.ai with your NEXT_PUBLIC_BACKEND_URL in either form, for example https://postqueen.example.com/api/mcp/YOUR_API_KEY. Most self-hosted setups serve the backend under /api, so the MCP path sits at /api/mcp.
Your reverse proxy has to forward the /mcp paths and stream the response rather than buffering it. The configuration, and the Nginx setting that silently breaks this, are on MCP on a self-hosted install.

Verify

Run codex mcp list to confirm the postqueen entry is registered, then ask Codex:
“List my connected social media accounts”
Your channel names come back, because the agent reached for her integrationList tool. She is connected in every session from here.

Next steps

Tools reference

Every parameter of the 11 tools your agent just discovered

Examples

The flows where she has to look something up before she can post

Limits and troubleshooting

What MCP cannot reach, and what a bad key looks like

Self-hosted MCP

The URL to use, and the proxy setting that breaks it quietly