~/.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
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.- Key in the URL
- Bearer token
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.Self-hosted
On a self-hosted instance, replacehttps://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
Runcodex 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