Post to X from Claude Code

You just shipped something in Claude Code. Ask it to announce it: Octopost gives Claude Code an MCP server that writes the post, splits it into a thread if it runs long, and publishes it to X now, at a set time, or after you approve it.

Why this is annoying without it

Posting to X from a script means an X developer app, OAuth 2.0 with PKCE, token refresh every two hours, media upload endpoints and reply chaining for threads. None of that is the thing you were building.

With Octopost you connect your X account once in the dashboard. Claude Code talks to one MCP endpoint and signs in to Octopost once. Token refresh, media uploads and reply chains are handled on our side.

Set it up in one command

Connect your X account in the Octopost dashboard, then run:

Terminal, then run /mcp in Claude Code and choose Authenticate to sign in

claude mcp add --transport http octopost https://octopost.ink/mcp

Or send an API key instead of signing in (for CI)

claude mcp add --transport http octopost https://octopost.ink/mcp \
  --header "Authorization: Bearer YOUR_API_KEY"

Or install the plugin (skill + server), inside Claude Code

/plugin marketplace add octopost-ink/octopost-plugin
/plugin install octopost@octopost

Then ask Claude Code

Write a short X thread announcing what we shipped today, based on the last
5 commits. Put the link to the release notes in the last reply.
Queue it for my approval instead of posting it.

Claude Code calls get_guide to learn X's limits, then queue_post with needs_approval. Octopost emails you a one-tap approve link, and the post waits in the dashboard too. Claude Code can't approve its own posts. Other clients (Cursor, Codex CLI, Gemini CLI, Windsurf) are in the MCP docs.

Limits worth knowing

  • X posts are metered in units because X bills Octopost per post: a plain post is 1 unit, a post containing a link is 13. Basic includes 500 units a month, Premium 1,500, Business 4,000, and the $1 trial 40.
  • Posts must fit 280 characters per tweet (links count as 23). Longer text goes out as a thread of up to 25 posts.
  • X Premium long posts (over 280 characters) are not supported.
  • The same server works in Cursor, Codex CLI, VS Code, Gemini CLI and Windsurf, and as a custom connector in claude.ai and Claude Desktop. ChatGPT can add it as a custom MCP server too, though we have not yet run that sign-in from a ChatGPT account.
  • Claude Code can read how posts did with get_analytics: likes, reposts, replies, quotes and X views, starting about an hour after a post goes live. There are no scheduled reports.

Questions

Do I need my own X developer account?

No. You sign in to X through Octopost once and Octopost posts on your behalf with its own X app.

Can Claude Code post without me seeing it?

It can, by calling create_post. Ask it to queue posts with approval required, or turn on "Require approval for every post" in Octopost Settings, and nothing goes out until you approve.

Can it post a thread?

Yes. Threads are posted as a native reply chain on X, up to 24 replies after the first post.

What happens if a post fails?

The post is marked failed with the reason from X, and Claude Code can call retry_failed after you fix the cause, for example a reconnected account.