← Back to blog
AI Agents10 min read

How to Automate Social Media with OpenAI Codex (MCP Guide)

PostAxis Team·
OpenAI Codex logo next to the PostAxis logo with the title How to Automate Social Media with OpenAI Codex

You can automate social media with OpenAI Codex by adding the PostAxis MCP server with two commands: one registers the server, one signs you in. From then on, Codex can read the pull request or deploy it just worked on, write the announcement for X, LinkedIn, Telegram or Threads, and schedule it in PostAxis. It is for engineers and founders who already live in Codex and want the "tell people about it" step to happen in the same place as the code.

What you can automate with Codex

Codex sees your working tree, your git history and the files you point it at. That is most of what a good product announcement needs.

  • PR announcements: a short X post and a LinkedIn post about the feature in the current pull request, scheduled for the next morning.
  • Deploy notes as drafts: a Telegram announcement for today's deploy, saved for you to review before it goes out.
  • Breaking-change notices: a planned sequence that warns users before a deprecation and confirms it on the day.
  • Calendar housekeeping: list what is scheduled this week and move posts when a release slips.
  • Scripted release posts: run Codex non-interactively from a release script.

What you need

  • A PostAxis account. Every plan starts with a 7-day free trial at app.postaxis.io and includes MCP access with OAuth sign-in.
  • Social accounts connected under Accounts in PostAxis. Codex can only post to those.
  • The Codex CLI, or the Codex IDE extension. Both read the same config, so one setup covers both.
  • The PostAxis API add-on only if you plan to use an API key, for example on a server where nobody can click through a browser sign-in.

How to connect Codex to PostAxis (step by step)

It takes about a minute.

  1. Create your PostAxis account. Sign up at app.postaxis.io. The trial includes MCP access.

  2. Connect your social accounts. Open Accounts in PostAxis and connect Instagram, TikTok, YouTube, X, LinkedIn, Facebook Pages, Threads or Telegram channels. Codex never sees your social media passwords.

  3. Add the server. Run this in your terminal. It writes PostAxis into ~/.codex/config.toml:

codex mcp add postaxis --url https://postaxis.io/api/mcp

If you open config.toml afterwards you should see an entry for it, something like this (the exact keys can differ between Codex versions):

[mcp_servers.postaxis]
url = "https://postaxis.io/api/mcp"
  1. Sign in. Run the login command and approve access on the PostAxis page that opens in your browser. Codex stores the OAuth token.
codex mcp login postaxis
  1. Check it works. Start Codex and type /mcp. postaxis should be listed with its tools. Then ask:
Which accounts can you post to, and what is scheduled this week?

Codex calls list_accounts and list_posts. If both answer, you are set up. Codex asks for approval before calling tools that create or change posts, so you can try it without worrying about a stray publish.

5 workflows you can copy

Announce the feature in this PR

Run this on the PR branch once review is done. Scheduling for the next morning gives you time to change your mind.

Read the PR description and the diff against main. Write an X post (one
sentence on what users can now do, under 240 characters) and a LinkedIn
post with a short bullet list of what changed. No jargon, no ticket IDs.
Schedule both for tomorrow 10:00 UTC.

Codex reads the diff, calls list_accounts to find the X and LinkedIn profiles, checks limits with get_platform_rules, and sends one create_post with a separate caption for each account. You get something like: "Scheduled both for tomorrow 10:00 UTC. The X version is 201 characters; LinkedIn has a short bullet list of what changed."

Draft today's deploy note for review

Some teams want a human to read every word that goes out. Drafts give you that without losing the speed.

Look at the commits deployed today (since the tag deploy-2026-10-04).
Draft a Telegram announcement for our channel: a one-line headline, then
New / Fixed sections. Save it as a draft. Do not schedule or publish.

Codex writes the post and calls create_post with draft status. It appears under Drafts in PostAxis, where you or a teammate can edit and schedule it. Telegram allows up to 4,096 characters for a text post, so there is room for a full list.

Warn users about a breaking change

Deprecations are the posts people most need to see and teams most often forget. Plan the sequence once, while you are writing the migration guide.

We remove the v1 export endpoint on November 3. Read docs/migration-v2.md.
Plan three posts for X, LinkedIn and Telegram:
1. October 13 09:00 America/Chicago: announcement + link to the guide
2. October 27 09:00 America/Chicago: one-week reminder
3. November 3 09:00 America/Chicago: "it's done" + where to get help
Validate all three, show me the text, then schedule them.

Codex calls create_posts_bulk with validate_only set to true first. PostAxis checks every caption against each network's rules and saves nothing. After you approve, Codex sends the same batch for real. Bulk calls take up to 50 posts and cannot publish immediately, which suits a planned sequence.

Move everything when a release slips

The release moved from Thursday to Monday. The announcement posts did not get the memo.

List my scheduled posts between Thursday and Sunday this week. Any post
that mentions v4.1 should move to Monday at the same local time
(Europe/Amsterdam). Show me the list of changes before you apply them.

Codex uses list_posts with the date range, get_post to read each one, and update_post to change the time after you confirm. Posts that do not mention the release stay where they are.

Post from a release script

Codex has a non-interactive mode, codex exec, that takes a prompt and runs it to completion. That lets you add a social step to the script you already use to cut releases:

git tag v4.1.0 && git push --tags
codex exec "Read the v4.1.0 section of CHANGELOG.md. Write a short X post and a LinkedIn post about it and schedule both for 17:00 UTC today. Print the post ID."

How tool approvals behave in exec mode depends on your Codex version and settings, so run it once by hand and check the Codex docs before you rely on it unattended. If the machine has no browser for the OAuth sign-in, configure the server with an Authorization: Bearer header carrying a PostAxis API key instead. That needs the API add-on.

Network limits Codex works within

NetworkCaption limitMedia rules
X (Twitter)280 charactersText-only allowed; up to 4 images or a video
LinkedIn3,000 charactersText-only allowed; up to 9 images or a video
Telegram4,096 characters (1,024 with media)Text-only allowed; up to 10 images or a video
Threads500 charactersText-only allowed; up to 10 images or a video
Facebook63,206 charactersPages only; up to 10 images or a video

Video must be MP4 or MOV, 3 to 300 seconds long, with a 16:9, 9:16, 4:3, 3:4 or 1:1 aspect ratio. One video per post, and you cannot mix images and video.

PostAxis validates every post against these rules before saving it. When Codex sends a 300-character X caption, it gets an error back explaining the limit, rewrites the text and tries again. Nothing broken lands in your calendar.

Tips for better posts

  • Write your voice into AGENTS.md. Codex reads AGENTS.md for project instructions. Add a short "Social posts" section: audience, tone, words to avoid, whether you use hashtags or emoji, and which accounts are for what ("Telegram is for customers, LinkedIn is for hiring and company news").
  • Ask for validation on anything multi-post. "Validate first and show me a table" makes Codex call create_posts_bulk with validate_only set to true. You see problems before anything is saved.
  • State the timezone every time. "10:00 UTC" or "09:00 America/Chicago". Without one, the agent uses the timezone it was told or UTC.
  • Prefer drafts for customer-facing news. Breaking changes, pricing and outages deserve a second pair of eyes. Drafts sit in PostAxis until someone schedules them.
  • Bring your own media. PostAxis does not generate images or video. Give Codex a public URL for a screenshot (it uses upload_media_from_url) or ask for a one-time upload link for a local file (create_upload_link).
  • Keep the PR description good. Codex writes better announcements from a clear PR description than from a raw diff. Time spent there pays twice.

Troubleshooting

/mcp lists postaxis but calls fail with 401 or "sign in again". The sign-in expired or was revoked. Run codex mcp login postaxis again. With an API key, check it is still active under Settings → API keys.

Codex says no accounts are connected. Connect at least one social account under Accounts in PostAxis. If you have several workspaces, name one: "use my Acme workspace".

It works in the CLI but not the IDE extension. Both read ~/.codex/config.toml. Make sure the extension is using the same Codex install and restart it after adding the server.

A post was rejected before saving. PostAxis checks caption length, media count, video length and format first. The error says what to change. Ask Codex to fix it and try again.

Posts are scheduled at the wrong time. Say the timezone in your request, for example "9:00 Europe/Berlin".

FAQ

Can OpenAI Codex post to social media?

Yes, through an MCP server. With PostAxis added, Codex can draft, schedule, publish, edit and delete posts on Instagram, TikTok, YouTube Shorts, X, LinkedIn, Facebook Pages, Threads and Telegram channels.

Do the Codex CLI and IDE extension share the setup?

Yes. Both read ~/.codex/config.toml, so after codex mcp add and codex mcp login, PostAxis works in the CLI and the IDE extension.

Is Codex the same as ChatGPT here?

They use the same PostAxis MCP server, but they are different products. Codex is OpenAI's coding agent for the terminal and IDE; ChatGPT is the chat app. Use whichever you work in.

Does Codex see my social media passwords?

No. You connect social accounts in PostAxis, and Codex only holds a PostAxis OAuth token. You can revoke it at any time under Settings → API keys → Connected agents, and it loses access immediately.

Can I use an API key instead of signing in?

Yes. Configure the server with an Authorization: Bearer header carrying a PostAxis API key. API keys need the API add-on; OAuth is included in every plan.

How much does it cost?

MCP access with OAuth is included in every PostAxis plan, and every plan starts with a 7-day free trial.

To get going, open the Codex agent page for the two setup commands, the MCP server reference for all 11 tools, and the complete guide to AI agents for social media. If you also use other tools, see how to automate social media posts with Claude Code or schedule posts with ChatGPT. Then start your free trial and let your next PR announce itself.

openai codex social mediacodex mcp servercodex cli social media postsannounce pull requests on social mediasocial media mcp server

Ready to simplify your social media?

PostAxis helps builders and creators publish to all platforms from one dashboard with scheduling, cross-posting, and automation.

Join the waitlist →

Wide list of social channels
on one axis

Harness every network you need. Platforms orbit PostAxis; you stay at the center.

Browse all platform pages

Frequently asked questions

You get a 7-day free trial. A card is required to start. Cancel before the trial ends and you pay nothing. After that, you pick a Creator, Growth, or Pro plan.