# Codex CLI MCP: Publish Social Posts From the Terminal **Source:** https://posteverywhere.ai/connectors/codex-cli --- # Publish social posts from Codex CLI Yes, but Codex CLI uses TOML rather than JSON, so the block looks different from every other client. Codex CLI speaks the Model Context Protocol like the others, but it configures servers in TOML rather than JSON. The shape is the same and the fields are the same, so if you have set this up elsewhere you already know what goes where. The section header is the part worth copying carefully: mcp_servers with an underscore, then the server name. Get that wrong and Codex starts cleanly without ever loading the server, which looks like nothing happened at all. If you have configured an MCP server anywhere else, everything here will look familiar except the syntax. The command, the arguments and the environment variable are the same; only the file format differs. [Start your 7 day trial](https://app.posteverywhere.ai/signup)[All connectors →](https://posteverywhere.ai/connectors)Card required · $0 charged today · cancel any time ## How to connect PostEverywhere to Codex CLI Codex CLI configures MCP servers in TOML, so the block below is not interchangeable with the JSON used elsewhere. Before you start - Codex CLI installed, with a config file at ~/.codex/config.toml. - Node on your PATH, since the server is launched via npx. - A PostEverywhere API key and at least one connected social account. ~/.codex/config.tomltoml`[mcp_servers.posteverywhere] command = "npx" args = ["-y", "@posteverywhere/mcp"] env = { POSTEVERYWHERE_API_KEY = "pe_live_YOUR_KEY" }` - 1Get an API key from your PostEverywhere account. The same key works for the REST API and the SDK. - 2Add the block below to ~/.codex/config.toml. - 3Restart Codex CLI. The 33 tools appear once it reloads its MCP configuration. **Worth knowing:** The underscore in mcp_servers matters. With a mistyped header Codex starts cleanly and loads nothing, giving you no error to chase. ## What you can ask Codex CLI once it is connected Codex CLI is the right choice when publishing should be a command rather than a visit to a dashboard. Each one maps onto a real tool, covering scheduling, [AI captions](https://posteverywhere.ai/ai-content-generator) and [analytics](https://posteverywhere.ai/social-media-analytics). The [AI agents page](https://posteverywhere.ai/agents) has the full surface. Publish a release announcement from the same terminal you deployed in Turn a commit range into a set of scheduled posts Draft and queue updates without leaving the shell List what is scheduled and change it in place Retry failures without opening a browser Generate a caption and schedule it in one command The publishing tools become available to Codex in every session, so scheduling can be one line at the end of whatever you were already running. ### What the tools cover All 33 tools are available to Codex, and in a terminal that matters because they pipe. Scheduling, media upload, campaign grouping, analytics and account health can each be one step of a longer command, which is what turns publishing from a task into a line at the end of a script. ### Prompts that work, and what comes back “Read the last release tag, draft an announcement, and schedule it for 9am.” Codex reads from the repo, drafts the post and queues it as one command rather than a browser trip. “Schedule these five bullet points as five posts across next week.” It writes each one distinctly and spaces them, rather than concatenating them into one update. “List everything scheduled in the next seven days.” It returns the queue in the terminal, so you can pipe or grep it like any other output. ## Codex CLI MCP troubleshooting The three things that actually go wrong, and what fixes each one. Codex starts normally and loads nothing The section header is wrong. It must be [mcp_servers.posteverywhere] with an underscore, and a mistyped header produces no error at all, which is the hardest kind of failure to chase. The TOML is rejected Inline tables are strict. The env line needs braces and an equals sign rather than JSON-style colons, which is the most common mistake when copying from another client's config. The server runs but every call is unauthorised The API key is wrong or has been revoked. Generate a fresh one and replace the value; the process itself will start regardless. ## What it will not do Worth knowing now rather than after you have started a trial. - A mistyped section header fails silently. Codex starts normally and simply loads nothing, with no error to chase. - It is a terminal integration, so it runs when you do. Scheduled posts publish from our infrastructure independently. - It does not poll or monitor. For reacting to a publish, subscribe to the webhook events instead. ## When to use Codex CLI rather than a browser client Codex CLI is the right choice when publishing belongs in a command rather than a conversation. It composes with everything else in your shell, which a browser-based connector cannot. Reference material: [The Codex CLI repository](https://github.com/openai/codex), [The Model Context Protocol spec](https://modelcontextprotocol.io). The full agent surface, including the REST API, is on the [AI agents page](https://posteverywhere.ai/agents). ## Included on every paid plan from $9/mo The open-source server costs nothing. The API key comes with any PostEverywhere plan, from $9 a month. One key covers the connector, the [REST API](https://posteverywhere.ai/social-media-api) and the SDK. Prefer a graphical client? [See all connectors](https://posteverywhere.ai/connectors), wire it up from [n8n, Make or Zapier](https://posteverywhere.ai/integrations), or read how the whole [agent setup](https://posteverywhere.ai/agents) fits together. [Start your 7 day trial](https://app.posteverywhere.ai/signup) ## Codex CLI MCP FAQ ### How do I connect PostEverywhere to Codex CLI? Get an API key from your PostEverywhere account. The same key works for the REST API and the SDK. Then: Add the block below to ~/.codex/config.toml. Then: Restart Codex CLI. The 33 tools appear once it reloads its MCP configuration. There is no plan restriction on this client. ### Can Codex CLI post to social media? Yes, but Codex CLI uses TOML rather than JSON, so the block looks different from every other client. Codex CLI is the right choice when publishing should be a command rather than a visit to a dashboard. ### Why does Codex CLI use TOML instead of JSON? That is simply its configuration format. The fields match every other MCP client, so the same command, args and env carry over, they are just expressed as TOML in ~/.codex/config.toml. ### What is the correct section header? [mcp_servers.posteverywhere], with an underscore in mcp_servers. A mistyped header means Codex starts normally and silently loads nothing, which is easy to mistake for the server failing. ### Can I use the hosted server instead? Codex CLI uses the local open-source server with an API key. If you would rather not run anything locally, Claude, ChatGPT, Grok and Cursor take the hosted URL with an OAuth sign-in. ### What does it cost to use Codex CLI this way? The open-source server costs nothing. The API key comes with any PostEverywhere plan, from $9 a month. Every plan has a 7-day trial and a card is required to start it. ## Other assistants [Claude](https://posteverywhere.ai/connectors/claude)[ChatGPT](https://posteverywhere.ai/connectors/chatgpt)[Cursor](https://posteverywhere.ai/connectors/cursor)[Claude Code](https://posteverywhere.ai/connectors/claude-code)[Grok](https://posteverywhere.ai/connectors/grok)[Windsurf](https://posteverywhere.ai/connectors/windsurf)[Cline](https://posteverywhere.ai/connectors/cline)[Zed](https://posteverywhere.ai/connectors/zed)