Make Instagram carousels with Codex

Add a few lines to ~/.codex/config.toml to connect Codex to the MCP server inside hookflock. Codex can then plan, write and schedule Instagram carousels, and on a paid ChatGPT plan its image generation can make new slide images.

Updated

Set it up

  1. Download hookflock and open it. You don’t need a license for this. Go to Agent, then the MCP setup tab: it shows the setup line with your real port and token.
  2. Copy the Codex block into ~/.codex/config.toml. The token goes in a header, and `codex mcp add` has no header option, so this one is a config edit.
    [mcp_servers.hookflock]
    url = "http://127.0.0.1:41751/mcp"
    http_headers = { Authorization = "Bearer <token from hookflock>" }
  3. Renders and image generation can take about a minute each, longer than Codex’s 60-second default. Raise the tool timeout in the same block.
    tool_timeout_sec = 600
  4. Optional: in hookflock, open Settings, then Agent, and copy the AGENTS.md snippet into your project. It teaches Codex the workflow.

The token in these examples is a placeholder. The app’s setup line has the real one, and the port if the default one was taken.

Approvals

hookflock marks its reading tools read-only, so Codex runs them without asking; others may ask, depending on your approval settings. In `codex exec`, which can’t ask, set `default_tools_approval_mode` for the server; posting still needs an explicit confirm in the call.

Images from Codex

hookflock uses Codex image generation to make new slide images (images_generate, drafts_remake_images). It needs Codex signed in on a paid plan, and it uses your plan’s limits faster than text.

Prompts to start with

  • List my products in hookflock and pick the blueprint that fits the first one best. Draft a carousel from it.
  • Make new background images for slides 2 to 5 of my latest draft. Keep the text.
  • Run the originality check on that draft and fix anything too close to its source.
  • Check best_times for my account and schedule the draft for the next good slot.
  • Create an auto-DM rule: when someone comments LINK on my latest post, send my App Store link. Show me a preview first.

What Codex can and can’t do here

  • Instagram has no drafts through its API, so drafts live in hookflock on your Mac until you post or schedule them.
  • A carousel takes 2 to 20 slides, and each account has a posting quota per 24 hours that the agent can read with instagram_publishing_limit.
  • Posting now, public replies and deleting comments need an explicit confirm in the call, so an agent can’t do them by accident.
  • Some settings are yours alone: the agent can’t turn on AI access to Instagram comments and captions, or add your RevenueCat key.
  • Until you allow it in Settings, captions and comments from Instagram reach the agent redacted.
  • The MCP server runs inside the app, so hookflock has to be open on your Mac. Scheduled posts go out from our server even when your Mac is shut.

See all 86 tools, and which ones work without a license, on the MCP server page.

Security

  • The server listens on 127.0.0.1 only, so other computers on your network can’t reach it.
  • Every request needs the token from the app. Regenerate it in the MCP setup tab whenever you like; agents then need the new one.
  • Your Instagram tokens stay encrypted on our server. The agent never sees them.

Questions

Do I need a license to use hookflock from my agent?
No, not to make carousels: products, blueprints, drafts, the editor, the originality check and exports work in Free mode. Tools that connect Instagram, post, schedule, read comments or show results answer with a clear message and the link to get a license.
Does my agent post to Instagram right away?
Posting needs a license and a connected account. Connecting Instagram for every license rolls out once Meta approves hookflock. Until then the agent can make and check carousels.
Can I use a project config instead?
Yes. Codex also reads .codex/config.toml in a trusted project, with the same keys.

Other agents