Post to X from Codex
Codex is OpenAI's coding agent. It runs as the Codex CLI in your terminal, as an IDE extension and inside the ChatGPT desktop app, and all three can use MCP servers. A text-only post or a video with text, cut to X's 280-character count.
Connect Codex to Kreatix
Sign in with Kreatix
No key to copy: paste the address, sign in to Kreatix and press Allow.
- Run once in a terminal: codex mcp add kreatix --url https://api.kreatix.cc/mcp
- Run codex mcp login kreatix, sign in to Kreatix in the browser and press Allow.
- Start codex and type /mcp to check that kreatix is listed.
codex mcp add kreatix --url https://api.kreatix.cc/mcpWith a key
For setups without sign-in. The key works like a password, so keep it to yourself.
- In Kreatix, open Settings > AI agent and create a key. It is shown once.
- Add the [mcp_servers.kreatix] table from the snippet to the end of ~/.codex/config.toml.
- To keep the key out of the file instead, run export KREATIX_API_KEY=YOUR_KEY in your shell and then codex mcp add kreatix --url https://api.kreatix.cc/mcp --bearer-token-env-var KREATIX_API_KEY.
- Check with codex mcp list, or with /mcp inside codex.
[mcp_servers.kreatix]
url = "https://api.kreatix.cc/mcp"
http_headers = { "Authorization" = "Bearer YOUR_KEY" }What Codex can do on X
A text-only post or a video with text, cut to X's 280-character count.
| Setting | Values | Needed | What it does |
|---|---|---|---|
caption | string (max 5000) | No | The post text. Only the first 280 go, counted X's way: a link is 23, an emoji 2. A text-only post needs it. |
media_url | URL | No | One video to attach: a link from your Kreatix library or a public YouTube, TikTok, Instagram or Facebook post. Leave it out for a text-only post. |
Ask in plain words
Ask inside the codex terminal app, or one-off from a script: codex exec "Which of my Kreatix pages got the most views this week?"
codex exec "Post this on X tomorrow at 10:00: Our spring sale starts Monday, 30% off everything."codex exec "Share my newest video on X and LinkedIn tomorrow at 9:00 with the same caption."codex exec "What do I have planned on X this week?"
X rules to know
- Only the first 280 characters go to X, counted X's way: a link counts as 23 and an emoji as 2.
- A longer text is cut, not refused, and never in the middle of a link or an emoji.
- A text-only post needs a caption.
- get_stats has no numbers for X.
Tips for Codex
- Add default_tools_approval_mode = "writes" to [mcp_servers.kreatix]. Codex then asks before schedule_post, reschedule_post and cancel_post, and runs the reading tools straight away.
- Set it up once: the Codex CLI, the IDE extension and Codex in the ChatGPT desktop app share ~/.codex/config.toml.
- In the IDE extension you can skip the terminal: gear menu > MCP servers > Add server, choose Streamable HTTP, enter the address, save, select Restart extension, then Authenticate.
- The agent checks the pages, caption and time with you before it posts. It cannot delete pages, read messages or change your account, and you can remove it any time in Settings > AI agent.
Questions
How do I post to X from Codex?
Connect Codex to Kreatix once, as shown above. Then ask it to post: name your X pages or a page group, the video or text and the time. Codex shows you the plan and posts after you say yes.
What happens to a caption longer than 280 characters?
Kreatix sends the longest start that fits in 280, counted the way X counts: a link is 23 and an emoji 2. It never cuts a link or an emoji in half.
Can I post text only, without a video?
Yes. X, LinkedIn and Facebook take text-only posts. Leave media_url out and give a caption.
Can my agent read how my X posts did?
No. get_stats measures Instagram, Facebook, TikTok and YouTube; X, LinkedIn and Pinterest have no numbers in Kreatix.
Can I share a TikTok or YouTube video on X?
Yes. Give the agent the public link: Kreatix imports the video into your library first, then attaches it to the X post with your text.
Can I sign in on a machine without a browser?
Yes. Run codex mcp login kreatix --no-browser, open the printed link on another device, sign in and press Allow, then paste the full redirect URL back into the terminal.
Does the config go in my home folder or the project?
~/.codex/config.toml works everywhere. A project's .codex/config.toml also works, but only in projects you trust.
Kreatix schedules one video to every page you run, each with its own platform settings.
Start free, then connect Codex