How to post to a Discord channel from OpenAI Codex

To post to a Discord channel from Codex, run codex mcp add postwire --url https://postwire.io/api/mcp and codex mcp login postwire, copy the channel's webhook URL in Discord (Edit Channel → Integrations → Webhooks) and paste it once on the connect page Codex gives you. After that, "post the v3.1 release notes to Discord" makes Codex write the announcement with generate_posts, under Discord's 2,000 characters, show it to you, and send it with post_to_social or queue it with schedule_post, up to 365 days ahead. There is no bot to create, host or invite to your server: the webhook writes to that one channel. The free plan includes Discord: 1 business, 10 posts a month, 5 AI drafts a day, 2 networks per post, no card.

A scheduled announcement goes out from PostWire's servers with Codex closed, and Codex never holds the webhook URL: it stays on PostWire's connect page. The same request can carry the Telegram, LinkedIn or X version of the news.

Updated . Written from PostWire's own code; vendor prices read on Dec 1, 2026. Live networks: TikTok, Instagram, YouTube, LinkedIn (personal profiles), Facebook Pages, Bluesky, Mastodon, Telegram, Discord, and X on paid plans.

Set it up and post, step by step

Prompt to copy once Discord is connected: Read CHANGELOG.md and write a Discord announcement for v3.1 with the three changes people will notice and the release link on the last line. Show it to me, then schedule it for Friday at 5pm my time.

  1. Add PostWire to Codex

    In your terminal run codex mcp add postwire --url https://postwire.io/api/mcp, then codex mcp login postwire. The browser opens PostWire's sign-in, which asks for your email and a 6-digit code and creates a free PostWire account if you have none: no password and no card. codex mcp list, or /mcp inside Codex, shows postwire with its tools. The entry lands in ~/.codex/config.toml, which the Codex CLI, the IDE extension and the ChatGPT desktop app share, so one setup posts to Discord from any of them.

  2. In CI, give Codex a key instead

    For a release job with no browser, copy your key in the dashboard under API & MCP, set it as POSTWIRE_API_KEY in the job's secrets, and put the variable's name in ~/.codex/config.toml, never the key itself:

    [mcp_servers.postwire]
    url = "https://postwire.io/api/mcp"
    bearer_token_env_var = "POSTWIRE_API_KEY"
  3. Copy the channel's webhook URL

    In Discord, open the channel → Edit Channel → Integrations → Webhooks → New Webhook → Copy Webhook URL. You need permission to manage that channel (server owner or admin). The link looks like https://discord.com/api/webhooks/<id>/<token>; the name and avatar you give the webhook are what the channel shows on each message.

  4. Connect Discord

    Ask "connect my Discord channel". Codex calls create_connect_link and prints a one-hour link; open it, choose Discord and paste the URL into Webhook link. There is no Discord sign-in screen. PostWire checks that it is a Discord webhook and asks Discord whether it exists before saving it, so a link copied without its end is refused on that page, not at the first post.

  5. Ask for the announcement

    "Write the Discord announcement for v3.1." generate_posts returns a draft and publishes nothing: short and friendly, in a community tone, emojis and links welcome, under 2,000 characters. Ask for changes in plain words ("shorter", "lead with the breaking change", "end with the link"). Ask for the Telegram or LinkedIn version in the same sentence and each comes back written for its own network.

  6. Add a screenshot or a clip, if you want one

    A file on your disk goes through an upload page: Codex asks for one (create_upload_link, valid 24 hours, up to 100 MB on the free plan and 1 GB on paid plans), you pick the file there, and get_uploaded_file hands Codex its link. PostWire puts that link on its own line under the text, and Discord shows it as an embed.

  7. Post now, or schedule it

    Say "post it" and Codex calls post_to_social. Say "schedule it for Friday at 5pm" and it calls schedule_post, up to 365 days ahead, or with run_at: "next_slot" for your next free posting hour. This is the call:

    {
      "name": "schedule_post",
      "arguments": {
        "platforms": ["discord"],
        "per_platform": { "discord": {
          "text": "🚀 v3.1 is out! Invoices export to CSV in one click, sync is 2x faster, and 14 fixes.\nFull notes: https://example.com/changelog/v3-1"
        } },
        "photo_url": "https://postwire.io/m/…/v3-1.png",
        "run_at": "2026-12-04T17:00:00-05:00"
      }
    }
  8. Check that it went out

    The answer lists Discord with ok and the id of the message Discord saved; get_post_status returns it later too. If Discord refuses a post, the result says what happened and the fix, and a webhook someone deleted in Discord shows on the dashboard as "reconnect" before a scheduled post is due.

From a release script, codex exec "post the notes for the latest tag from CHANGELOG.md to Discord" runs the same request without the interactive screen. "What's scheduled on Discord?" calls list_scheduled_posts and "cancel Friday's announcement" calls cancel_scheduled_post. Prefer to set it up by hand? Open the dashboard, connect Discord under Accounts and copy your key under API & MCP.

Ways to post to Discord from Codex, side by side

How each service plugs into Codex and reaches Discord, and what it costs to start, read on its own pages on Dec 1, 2026.

ServiceHow it plugs into CodexHow it reaches DiscordFree to startCheapest paid plan
PostWirecodex mcp add postwire --url https://postwire.io/api/mcpA channel webhook you paste once, checked with Discord before it is savedFree plan: 1 business, 10 posts a month, 5 AI drafts a day, 2 networks per post, no card$19/mo — 3 businesses, every network in each post
Postizcodex mcp add postiz --url mcp.postiz.com/mcp-oauth-dynamic, or the Postiz skillThe Postiz bot, which "must have access to the target channel"7-day free trial$29/mo — 5 channels
Upload-PostIts MCP server mcp.upload-post.com/mcp with an API key header; no Codex setup on that pageA channel webhookFree plan of 10 uploads a month, no card$24/mo ($16 billed yearly)

Checked on Dec 1, 2026 (2026-12-01) on each vendor's own pricing or docs page, linked in the first column and below. Monthly billing in USD unless noted. "Not listed" means we could not find it on their page, not that it is missing.

Where PostWire is ahead

  • The announcement is written for Discord: generate_posts writes a short community-tone message under 2,000 characters and, from the same news, the Telegram, LinkedIn or X version in the same request.
  • A free plan with no time limit: 10 posts a month, no card, MCP included. Postiz starts with a 7-day trial.
  • The cheapest paid plan here: $19 a month for 3 businesses, $15.20 billed yearly. Upload-Post $24 ($16 yearly), Postiz $29.
  • No bot in your server: a webhook belongs to one channel and can only write there. Postiz posts through its bot, which needs access to the target channel.
  • Every message is confirmed: PostWire sends with wait=true, so the result is the id of the message Discord saved, and a deleted webhook shows as "reconnect" before a scheduled announcement is due.
  • No key to copy to start: codex mcp login postwire signs you in with your email and a 6-digit code, and creates the free account too. A key is there for CI.
Sources, all read on Dec 1, 2026:
  • Postiz — Post to Discord from Codex (npx skills add gitroomhq/postiz-agent with POSTIZ_API_KEY, or codex mcp add postiz --url https://mcp.postiz.com/mcp-oauth-dynamic; "Postiz posts through the Postiz bot, so the bot must have access to the target channel"): postiz.com/codex/discord
  • Postiz pricing ("Start with a 7-day free trial"; Standard $29 a month, 5 channels): postiz.com/pricing
  • Upload-Post — Discord MCP server (https://mcp.upload-post.com/mcp with an "Authorization: ApiKey" header; "It works with any Upload-Post plan, including the free tier"): www.upload-post.com/mcp/discord/
  • Upload-Post llms-full.txt (Discord "via channel webhook"; Free tier: 10 uploads a month, no credit card required; Basic $24 a month, $16 billed yearly, 5 profiles): www.upload-post.com/llms-full.txt
  • OpenAI — Codex MCP docs (~/.codex/config.toml shared by the ChatGPT desktop app, the Codex CLI and the IDE extension; codex mcp login <server-name>; bearer_token_env_var; /mcp in the TUI): developers.openai.com/codex/mcp
  • Discord developer docs — Execute Webhook (content "up to 2000 characters"; wait: "waits for server confirmation of message send before response, and returns the created message body", false by default): discord.com/developers/docs/resources/webhook

Discord's webhook rules, and what PostWire does with them

Read in Discord's developer docs and in PostWire's Discord integration on Dec 1, 2026:

What Discord allowsWhat PostWire does
Who postsA channel webhook posts in its own channel, under the name and avatar set for itConnects the webhook you paste, after asking Discord that it exists
WhereOne webhook belongs to one channelPosts in that channel and nowhere else; it cannot read messages or see members
TextUp to 2,000 characters a messagegenerate_posts keeps Discord drafts under 2,000
ConfirmationBy default a webhook call does not wait for the message to be saved; with wait it returns the created messageSends every message with wait=true, so the result carries the saved message's id, and a message Discord did not save comes back as an error
Image or videoA link in the message is shown as an embedPuts the uploaded file's link on its own line under the text
A deleted webhookAnswers "not found" from then onShows the connection as "reconnect" on the dashboard before a scheduled post is due

Source: Discord's Execute Webhook docs, read Dec 1, 2026. Every Discord tool: Discord MCP server; every client's setup: PostWire's MCP server.

What to say in Codex, and what Discord receives

You sayCodex callsThe channel receives
"Post the v3.1 notes from CHANGELOG.md to Discord"generate_posts, then post_to_socialOne announcement under 2,000 characters, with the release link
"Add ./assets/v3-1.png to it"create_upload_link, get_uploaded_file, then post_to_social with photo_urlThe text, and the image embedded under it
"Schedule it for Friday at 5pm"schedule_post with run_atThe same message, at that time
"Announce it on Discord and Telegram"generate_posts, then post_to_social with both networksEach community its own version of the news
"Remind the channel about office hours every Friday at 4pm"create_recurring_post (paid plans)The reminder every week
"What's queued for Discord?"list_scheduled_postsNothing — it reads the queue

Source: PostWire's MCP server and Discord publisher, and OpenAI's Codex MCP docs, read Dec 1, 2026.

Why post to Discord from Codex

  • Release notes written from the release: Codex reads the changelog, the merged pull requests or the tag's diff and writes the announcement with the version and the breaking changes right.
  • One announcement, every community: "post it to Discord and Telegram" sends each its own version. On the free plan one post reaches 2 networks; paid plans (from $19 a month) send it to every network you connected, LinkedIn, Bluesky and X included.
  • The same message from a script: once the wording is right, Codex can put it in your release job as one REST call, POST /api/post with {"platforms": ["discord"], "text": "…"} and your key.
  • Nothing to add to the server: a webhook is a setting of one channel. There is no bot to invite, no permissions to grant across the server and nothing to keep running.
  • A person can have the last word: on paid plans, a brand's approval rules hold what Codex queues until you approve it from an emailed link.

What Starter ($19 a month) adds for a Discord community

An announcement every weekday is about 22 a month, past the free plan's 10 and its 3 waiting posts. Starter is $19 a month, or $15.20 a month billed yearly:

  • An unlimited queue and 1,000 posts a month: schedule a month of announcements at once.
  • 25 recurring posts (create_recurring_post): a Monday digest or a Friday reminder, set once.
  • 3 businesses, each with its own Discord channel and its own networks: a second server or a second channel is a second business.
  • Every network in each post, and files of up to 1 GB.

What it does not do

PostWire is not a Discord bot. It does not read or search messages, answer mentions, send direct messages, moderate, or manage roles and channels, and it does not list your server's channels: each connection is the one channel behind the webhook you pasted. It does not attach a file to the message itself (images and videos go as links Discord embeds), and it does not edit or delete a message after it is sent.

Questions people ask

Can Codex post to a Discord channel?

Yes, with an MCP server. Codex has no Discord access of its own; with PostWire added (codex mcp add postwire --url https://postwire.io/api/mcp, then codex mcp login postwire) and a channel webhook pasted once, it writes the announcement and posts or schedules it when you ask.

Do I need to create or host a Discord bot?

No. A channel webhook is enough: Edit Channel → Integrations → Webhooks → New Webhook → Copy Webhook URL, and paste it on the connect page Codex gives you. There is no bot token, nothing to invite and nothing to host.

Can Codex schedule Discord announcements?

Yes. It calls schedule_post with a time up to 365 days ahead, or "next_slot" for your next free posting hour, and PostWire posts it at that time with Codex closed. The free plan keeps 3 posts waiting at once; paid plans have no such limit.

How long can a Discord message from Codex be?

Up to 2,000 characters, Discord's limit for a webhook message. generate_posts keeps the draft under it; for long release notes, ask for the three main changes and a link to the full notes.

Can Codex post release notes to Discord from CI?

Yes. Set POSTWIRE_API_KEY in the job's secrets, name it in ~/.codex/config.toml as bearer_token_env_var, and run codex exec "post the notes for the latest tag from CHANGELOG.md to Discord". Once the wording is fixed, the same post is one REST call, POST /api/post.

Can it post to several Discord channels or servers?

Each connection is one channel's webhook. To announce in a second channel or another server, connect that channel's webhook under another business (Starter has 3, Pro 10) and post to that business too.

How much does it cost?

The free plan includes Discord and the MCP server: 1 business, 10 posts a month, 5 AI drafts a day, 2 networks per post, no card. Starter is $19 a month for 3 businesses, with no limit on the queue and 25 recurring posts; Pro is $29 for 10. Nothing is charged from Codex.