Codex + Facebook
Post to Facebook from Codex
Through iHatePosting, Codex can publish to a Facebook Page: plain text, a link with its preview, photos, a video or stories. Add the iHatePosting entry to Codex's config.toml and sign in with codex mcp login, then ask it for the post you want.
Setup takes about a minute. A post can hold up to 63,206 characters.
Posting to Facebook from Codex
Add iHatePosting to Codex once, connect Facebook, and then describe the post. Setup takes about a minute.
Add iHatePosting to Codex once
Add the iHatePosting entry to Codex's config.toml and sign in with codex mcp login. Then connect Facebook in iHatePosting if you have not already.
Add to the end of ~/.codex/config.toml, then run the login command.
[mcp_servers.ihateposting]
url = "https://app.ihateposting.com/mcp/oauth"
# then, in a terminal:
codex mcp login ihatepostingAsk for the Facebook post
Describe the post in plain language. Codex writes it, applies the settings and schedules it.
> Post the launch article link to my Facebook Page tomorrow at 10:00 with one friendly sentence.
Codex: Done. Scheduled on Facebook.What Codex can do on Facebook
On Facebook, Codex can publish to a Facebook Page: plain text, a link with its preview, photos, a video or stories.
Text and link posts
Post words alone, or include a link and Facebook draws its preview: picture, headline and site name.
Photos
Attach one or more pictures to a post.
Videos
Attach a video, with its own title.
Stories
Publish a story; each picture or video becomes a separate story.
Scheduling
Set the time; iHatePosting publishes at that time.
How Codex gets a post onto Facebook
You say what you want and Codex makes the calls. A typical conversation goes like this.
Find your Facebook channel
Which Facebook accounts do I have in iHatePosting?
What happens
- Codex lists your channels and finds Facebook
- It also reads the channel's rules and settings
Compose your content
Post the three event photos to Facebook on Saturday at noon with a short thank-you.
What happens
- Codex drafts the text for Facebook
- It uploads any media you mention
Schedule and publish
Yes, schedule it for tomorrow at 9:00.
What happens
- Codex schedules the post in iHatePosting
- iHatePosting publishes it to Facebook at that time
Facebook settings reference
Say the option in your own words and Codex fills in the matching field. This is every Facebook setting it can use.
| Field | Type | Required | Description |
|---|---|---|---|
| url | string | No | Link to attach as a preview card (image, title, domain), used only for text posts without media. A URL inside the content alone shows as plain text with no card |
| post_type | string | No | post or story |
| text_format_preset_id | string | No | The text format preset to apply to the post |
| title | string | No | Title of the video, used only for video (non-story) posts |
Common configurations
Each case below is a request Codex understands, followed by the Facebook options it sets.
A link with a preview
Add https://example.com/launch as the link preview
- Applies: url:
https://example.com/launch
A story
Post it as a story
- Applies:
post_type: story
A video with a title
Title the video Launch day
- Applies: title: Launch day
What is Codex?
Codex is OpenAI's coding agent. The command line, the IDE extension and the ChatGPT desktop app all read the same config.toml, so one entry connects every one of them.
It can read a repository, write the announcement for a change and schedule it in iHatePosting.
How iHatePosting works with Codex
Once connected, iHatePosting hands Codex its tools: your channels, posts, media and each channel's settings (14 tools in all). Codex calls them while you describe what you want.
- iHatePosting MCP server (sign in): Entry in
~/.codex/config.toml, thencodex mcp login - iHatePosting MCP server (API key): Entry in
~/.codex/config.tomlthat names the variable holding your key - iHatePosting skill (command line): npx skills add
iHatePostingOrg/iHatePosting-Agent
# iHatePosting MCP server (sign in)
[mcp_servers.ihateposting]
url = "https://app.ihateposting.com/mcp/oauth"
# then, in a terminal:
codex mcp login ihatepostingFacebook and the other platforms Codex reaches
Ask for Facebook and other channels in a single message; every channel still applies its own settings.
Facebook requests to try in Codex
A link post
Post the launch article link to my Facebook Page tomorrow at 10:00 with one friendly sentence.
A photo album
Post the three event photos to Facebook on Saturday at noon with a short thank-you.
A story
Publish promo.png as a Facebook story today at 16:00.
Facebook limits and gotchas to know
A few of Facebook's rules shape how Codex writes your request, so it helps to know them.
- A post can hold up to 63,206 characters.
- A post can be text only, or carry photos or a video; a story needs at least one attachment, and each file becomes its own story.
- The link preview card is only used on text posts without media; a link inside the text alone is plain text.
- A video title applies to video posts, not to stories.
- A post with a video publishes the video alone; other files in the same post are left out.
Frequently asked questions
Start free for 30 daysAdd the iHatePosting entry to Codex's config.toml and sign in with codex mcp login, connect Facebook in iHatePosting, then ask Codex for the post in plain language. It schedules the post and iHatePosting publishes it at the time you set.
A post can hold up to 63,206 characters.
Codex can set url, post_type, text_format_preset_id, title. The settings reference on this page lists what each one does.
No. The first route opens an iHatePosting sign-in in your browser, and no key changes hands. The route that takes a key uses one from Settings → Agents / Dev in iHatePosting. The command line signs in with ihateposting auth:login.
Yes. Name a day and a time and iHatePosting publishes the post then, whether or not Codex is still open.