Schedule social media posts from OpenAI Codex CLI

To let OpenAI's Codex CLI schedule posts through Hookpost by Hookstep, add a three-line [mcp_servers.hookpost] table to ~/.codex/config.toml and put your Hookpost API key in the HOOKPOST_API_KEY environment variable. Codex can then list your connected channels and create draft, scheduled or immediate posts, and Hookpost publishes them at the set time with the terminal closed. The key comes with Hookpost Standard ($19 a month, ₹599 in India) or Pro.

By the Hookpost team ·

Set it up in four steps

  1. Copy your Hookpost API key. Connect your social accounts in Hookpost, then open Settings → Developers → Reveal → Copy.
  2. Put the key in an environment variable. Add export HOOKPOST_API_KEY="your_key" to your shell profile and open a new terminal. Codex reads the key from there, so it never sits in config.toml.
  3. Add the server to config.toml. Add a [mcp_servers.hookpost] table to ~/.codex/config.toml with url = "https://hookpost.hookstep.in/api/mcp" and bearer_token_env_var = "HOOKPOST_API_KEY".
  4. Check it and ask for drafts. Run codex mcp list, start codex and type /mcp to see the tools, then ask Codex to save posts as drafts before you let it schedule anything.

The config

Set the key once in your shell profile:

# in ~/.zshrc or ~/.bashrc, so every new shell has it
export HOOKPOST_API_KEY="your_key"

Then add this table to ~/.codex/config.toml. bearer_token_env_var names the variable; Codex reads it and sends Authorization: Bearer <key> on every request:

# ~/.codex/config.toml
[mcp_servers.hookpost]
url = "https://hookpost.hookstep.in/api/mcp"
bearer_token_env_var = "HOOKPOST_API_KEY"

Check that Codex sees it:

codex mcp list        # hookpost should be listed
codex                 # then type /mcp to see its tools

A first prompt

prompt

List my Hookpost channels. Read the last 15 commits with git log and
write one LinkedIn post and one X post under 280 characters about what
shipped. Save both as Hookpost drafts for tomorrow at 10:00 IST.
Do not publish anything.

Codex lists your channels with integrationList, reads each network's limits with integrationSchema, and saves the posts with integrationSchedulePostTool as drafts. Hookpost checks every post against the network's rules the same way its own editor does and returns any error, so Codex can fix the post and try again. There is no delete tool, and no tool edits the text or date of an existing post, reads analytics or connects a new channel. Do those in the app.

Codex, Claude Code and Gemini CLI compared

The server is the same for all three terminal agents. What differs is where the config lives and how the key is sent:

Adding Hookpost's MCP server to Claude Code, Codex CLI and Gemini CLI
AgentAdd the serverConfig fileHow the key is sentCheck it
Claude Codeclaude mcp add --transport http … --header~/.claude.json, or .mcp.json with --scope projectAuthorization header (or ${VAR} in .mcp.json)claude mcp list
Codex CLIEdit config.toml~/.codex/config.toml, table [mcp_servers.hookpost]bearer_token_env_var reads it from an environment variablecodex mcp list, or /mcp inside codex
Gemini CLIgemini mcp add --transport http … --header~/.gemini/settings.json, or .gemini/settings.json in a projectheaders, with httpUrl (url means SSE)gemini mcp list, or /mcp inside gemini

From each agent's own documentation, read 26 October 2026. Exact configs for all of them, plus Cursor, VS Code and Windsurf: the MCP page.

Questions

Can Codex CLI post to social media?
Yes, with an MCP server that does the posting. Hookpost by Hookstep's hosted server gives Codex tools to list your connected channels, read each network's rules and create posts as drafts, scheduled for a time, or published now.
Why does nothing show up after I edit config.toml?
Codex only reads tables named [mcp_servers.<name>], so check the spelling: mcp_servers, with an underscore and a plural. Then check that HOOKPOST_API_KEY is set in the shell you started codex from; without it Codex has no key to send and Hookpost refuses the connection with a 401.
Is this the same as using ChatGPT?
No. Codex CLI is OpenAI’s terminal coding agent, and this setup, with an API key in config.toml, is for Codex. ChatGPT connects differently: as a custom MCP server with OAuth sign-in and no API key (see the ChatGPT guide).
Which Hookpost plan do I need?
The API key, and with it the MCP server, comes with Standard ($19 a month, ₹599 in India: 5 channels, 500 posts a month) and Pro ($29 a month, ₹1,999 in India: 20 channels, 2,000 posts a month, up to 15 team members). Every plan starts with a 3-day trial, and the trial includes the key.
Can I try it before paying?
Yes. 3-day trial: in India ₹0 today, then ₹599/month by UPI AutoPay or card; elsewhere $19/month after, by card; cancel at least 24 hours before the first charge.
Can Codex delete or reschedule posts?
There is no delete tool, and no tool edits the text or date of an existing post, reads analytics or connects a new channel. Do those in the app. Codex can change the network settings of a post that has not gone out yet.
Which networks can Codex post to?
Any channel connected in your workspace: Hookpost connects 18 networks, and in the 30 days to 22 October 2026 it published from production to Instagram, Facebook Pages, Threads, X, LinkedIn, YouTube, Pinterest, Discord and Slack. LinkedIn Company Pages, Reddit and Mastodon are not supported; Medium stopped issuing new API tokens, so Hookpost does not connect Medium.

Related