How-To Guide

How do you post to X with Claude Code?

Claude Code has no built-in X access. Two honest routes: an MCP server that publishes, or a script on the X API with your own credentials. What each costs.

9 min read

By the Superdirector editorial team. Anthropic's Claude Code docs, the Model Context Protocol docs and X's API pages, plus the practitioner guides cited, read November 14, 2026.

At a glance

How do you post to X with Claude Code?

Claude Code has no built-in way to post to X. You give it one through an MCP server (register the server with claude mcp add --transport http, authorize the connection in a browser, then ask Claude Code for the post), or you have Claude Code write and run a small script against the X API's POST /2/tweets endpoint with credentials you create at console.x.com, where X API v2 billing is credit-based and deducted per request. Keep the permission prompt on for a first post, and have the draft shown to you before anything goes out.

  • Server route: register an MCP server you trust, authorize it in your browser, and let Claude Code call its posting tool; the server's plan or subscription is where the X connection lives.
  • Script route: Claude Code writes and runs the call to POST /2/tweets itself; the X API v2 uses pay-per-usage pricing, credits purchased and deducted per request, under your console account.
  • Review comes first: Claude Code's documents describe a permission system that asks before actions run, and every vendor guide read for this page keeps a human review step before publishing.
A decision fork that asks who drives: under you, a second question about maintaining code leads to your own script on the X API or an MCP server, and under the service, to the $29 Starter plan or the $199 Growth plan.

The first question is who drives, and the second, whether you maintain code, picks the script or the server while the service side splits into Starter and Growth. Original diagram from the route table, Claude Code's MCP documentation and X's API pages, read November 14, 2026.

Superdirector

Make it work for your brand

Find it. Remake it. Post it. Superdirector turns the viral formats in your niche into your brand's carousels, X posts and video scripts, and keeps the calendar full.

The short answer: give Claude Code a tool that can post, then keep your review step

Claude Code has no built-in way to post to X. The tool you install to run it, the one Anthropic describes as a composable CLI that follows the Unix philosophy (pipe logs into it, run it in CI, chain it with other tools), writes code and calls the tools you connect, so posting means connecting a tool that carries an X write access. The Model Context Protocol is the standard both sides speak here: MCP's own docs call it an open-source standard for connecting AI applications to external systems, and its favorite comparison is a USB-C port: plug in a server, and the agent gains the tools behind it.

The credentials decide the routes. On the direct route, you sign up at console.x.com, create an app and get credentials, and X API v2 bills per request: X's docs describe pay-per-usage pricing with credits purchased and deducted per request, and the write endpoint is POST /2/tweets, which X titles Create or Edit Post. On the server route, you connect an MCP server that already exposes posting tools; Claude Code's docs put one line behind it, claude mcp add --transport http, and the authorization happens in a browser. Whichever route you pick, the posting step stays a tool call Claude Code makes only after its permission system asks you, so the review step is yours to keep.

Pick the route for the job

The two official routes answer different buyer jobs, and a hosted publishing plan sits at the crossing point. The strongest guide written for this exact question, the one from Blotato (whose author runs the tool and says so up front), frames it the same way: build against the X API yourself, or connect a server that carries the access. Our table adds the two shapes this site sells, because the operated route changes what the review step means.

RouteWhat you set upWho holds the X credentialsWhat a post costsFits when
Hosted MCP serverclaude mcp add --transport http with the server's URLThe server, after you authorize it in a browserThe server's subscription or planYou want to post from the terminal without maintaining API code
Your own script on the X APIAn app, credentials and a small script Claude Code writes and runsYou, at console.x.comX API v2 credits, deducted per requestYou need API fields no server exposes, or posting belongs inside your own code
Superdirector Starter ($29, MCP)Connect Claude or Claude Code to Superdirector's MCP from a paid planSuperdirectorPlan credits cover AI work by taskDirected jobs from Claude: research, ideas, scripts and drafts, with you driving
Superdirector Growth ($199, operated)Turn posting on for the account, after one warningSuperdirector, under its standing posting permissionPlan credits; the $199 plan grants 2,000 a monthA channel that posts eligible Instagram carousels and single X text posts by itself

Two questions settle it. Do you want your hands on every post, with Claude Code as the driver and your review as the gate? Then the server or the script row. Do you want the posting decisions handled once a direction is set, with the review loop living inside the service instead of your terminal? Then the operated row is the fit, and the rest of this guide is mostly not about it.

Connect an X MCP server in Claude Code

Registering the server is one command plus one browser authorization. Claude Code's documentation recommends HTTP transport for remote MCP servers and shows the same syntax every vendor guide reuses, so the shape below is the official one, with real vendor lines as examples. Start with trust, before any terminal keystroke: the docs tell you to verify you trust each server before connecting it, because servers that fetch external content carry prompt-injection risk.

  1. Choose the server and read its trust story first. The X posting servers cited by the engines for this question are Postiz, Opentweet, Composio and Blotato; the choice is a vendor decision, so read each one's page before you paste its URL into a terminal.
  2. Add it with the transport flag: claude mcp add --transport http <name> <url>. A real example from Postiz's own page: claude mcp add --transport http postiz https://mcp.postiz.com/mcp-oauth-dynamic.
  3. Authenticate where the server asks. Composio's page says the first attempt to use its Twitter tools prompts you to authenticate; Postiz signs you in through a browser OAuth flow instead of a pasted API key. You authorize in the browser, and what Claude Code sees afterwards is the server's tool list.
  4. Check that it landed: claude mcp list shows a health status next to each configured server, such as connected, needs authentication or failed. A failure means Claude Code could not reach the server, not that the setup is lost.
  5. Connect your X account on the server's side if the server manages connections itself. Postiz's flow links X inside Postiz first; Claude Code then finds the account through the server's tools.
  6. Run something harmless before you let anything post. Postiz's example conversation starts with a question, Is my X account connected, and that is the right first move in every cited flow.

Configuration you save travels with you. The Claude Code overview says a repo's CLAUDE.md files, settings and MCP servers work across all of its surfaces, so the same server follows you from terminal to desktop. And a note that saves an afternoon: the 280-character facts and the field names below are X's, not the server's, so read the next section before you queue a week the connection cannot carry.

Six numbered steps from trusting a server to reviewing the post: add it with claude mcp add --transport http, authorize in a browser, confirm with claude mcp list, link the X account on the server, then review before anything publishes.

Registering a server is one command plus one browser authorization, and the review step stays last. Original diagram from Claude Code's MCP documentation and the browser OAuth flows the cited vendors describe, read November 14, 2026.

Publish with a prompt, and keep your review step

Once the server is connected, the loop Postiz describes is the honest picture: you describe what you want in plain language and Claude Code handles the Postiz calls. Ask for the draft before the post. Three prompts worth copying on the first day:

  • Read the git log since the last release and draft one X post about what changed. Show me the draft before you post.
  • Break this changelog into a thread. Keep each part under 280 characters and number the thread.
  • Post it with the hero image attached, and set replies so only people I follow can reply.

The 280 fact is X's, not the tool's. X's create-post endpoint caps the text field at at most 280 characters unless the account has X Premium, so a long draft is the most common first failure. The server-side answer is a thread: Postiz's X page documents a request where Claude Code splits content into separate tweets under the limit and keeps them in order, and Opentweet's guide shows the same batching pattern for a five-tweet thread. Reply settings are not as uniform as the prompts suggest; Postiz requires its who_can_reply_post field on every X post it publishes, which is one vendor's design with five levels, everyone through verified.

Then the review step, which is the part no one should skip on a first post. Claude Code's permission docs describe a tiered permission system to balance power and safety, so the agent asks before actions run; Postiz documents that its publishing route asks first, and the Blotato pipeline guide keeps a manual gate out of habit: Claude asks before it publishes, and you should keep that approval gate on. X's write surface carries its own lever for AI content, a made_with_ai field that discloses AI-generated media in the post, and Superdirector's rules say to label AI content where a platform requires it and never publish invented reviews, testimonials, results or customers.

Build the direct route with the X API

The direct route stays on Claude Code's home turf: it writes the script and runs it. The endpoint is POST /2/tweets; the request carries a bearer authorization header, and the text field is required unless media is included. That is the whole call shape for a text post, and it is the part no MCP server can hide from you in code.

The setup happens in X's developer console: X's docs point to signing up at console.x.com, creating an app and getting credentials. Billing is credit-based: X API v2 uses pay-per-usage pricing, credits purchased and deducted per request, with usage tracked in the console. Prices move, so read your own console pricing page rather than copying a per-post figure out of a blog post, and treat any figure a vendor publishes about X's billing (the Blotato guide carries its own numbers, as its author's own math) as that vendor's claim until your console says so.

Edges worth knowing before you write the script: a post may include up to 4 photos, 1 animated GIF, or 1 video; quote-posting requires X's Enterprise plan and is not available on the self-serve tiers; and the made_with_ai disclosure field sits on the same endpoint for posts with AI-generated media. Claude Code's composable-cli nature suits this route, since the same session that runs your tests can send the announcement after they pass. Where it loses to the server route is maintenance: the credentials, the credits and the code are now yours, which is exactly what the server route hands to its vendor.

The direct route drawn as one annotated call: credentials from console.x.com, Claude Code writing and running the request, and POST /2/tweets carrying a bearer header and a text field, with X billing credits per request.

The direct route is one annotated call: an app at the developer console, a bearer header, and a required text field unless media is attached. Original diagram from X's create-post endpoint documentation and its X API v2 pricing page, read November 14, 2026.

Check the numbers: pricing, credits and limits

Four cost lines decide whether this pipeline is worth your month. Each one comes from a stored page read for this guide, and none of them is a projection.

Cost lineWhat the stored pages documentSource
Claude planMost surfaces require a Claude subscription or an Anthropic Console accountClaude Code docs
X API, direct routePay-per-usage pricing; credits purchased and deducted per request; usage tracked in the developer consoleAbout the X API
MCP server routeVendor subscription; Postiz's connection runs through browser OAuth with no API key for you to pastePostiz X page
Superdirector by planStarter at $29 declared as live social data, ideas, scripts and downloads from Claude; a 20-credit MCP starter covers one account check and one X post draft for eligible accounts; Growth at $199 declared for scheduled research, routines and supported Instagram and X publishing; monthly grants run 300 credits on $29 and 2,000 on $199Pricing and how it works
  • Text: at most 280 characters unless the account has X Premium (X's endpoint docs).
  • Media: up to 4 photos, 1 animated GIF, or 1 video per post (X's endpoint docs).
  • Quote-posting: Enterprise plan and above; unavailable on self-serve tiers (X's endpoint docs).
  • Threads: not one call on every server. Postiz requires its who_can_reply_post field on every X post and splits threads into ordered separate tweets; other servers differ, so read the settings page before you depend on it.
  • Credits are task-sized, not outputs-sized: Superdirector's page says credits cover AI work and vary by task, and are not a count of finished videos.

What Superdirector adds to this job

Superdirector, which publishes this guide, sits on both sides of this question. On the hands-on side, connecting your own AI is how the product works: the how-it-works page says you run it from your own AI through ChatGPT, Claude, Codex or Claude Code, and the $29 Starter plan is declared for exactly that job: live social data, ideas, scripts and downloads. For a first look, a separate once-per-account 20-credit MCP starter may be available to eligible verified free accounts, covering up to one account check and one X post draft, and it grants nothing broader than that.

On the operated side, Growth at $199 a month is one customizable AI-run account: Superdirector watches your niche, remakes what is working into carousels, X posts and video scripts, and publishes eligible Instagram carousels and single link-free X text posts by itself once you turn posting on for the account. The enabling decision is one warning that names the account, the public effect and the cost; after it, no post asks for approval, and you can turn posting off at any time. AI video and fully autonomous channels are still upcoming, nothing video posts yet, and the buyer job differs from the terminal one on purpose: if the job you want is this article's job, driving Claude Code post by post, Starter and the MCP starter are the fit; if the job is a channel that posts on its own under standing permission, Growth is the fit. See how it works.

Sweep for the traps that sink first posts

Every guide read for this page lists a version of the same failures, so the list below carries them in one place, with the source that says so.

  • Pasting a long draft against a 280 account. X's endpoint caps text at 280 characters unless the account has X Premium; the split-into-a-thread request is the normal fix (X's endpoint docs; Postiz's X page).
  • Registering a server you have not vetted. The docs say to verify you trust each server before connecting it, because servers that fetch external content carry prompt-injection risk (Claude Code MCP docs).
  • Letting the first post out unreviewed. Every cited flow keeps a gate: Claude Code's permission system asks before it acts, Postiz documents asking before publishing, and the Blotato pipeline guide keeps a manual approval gate by habit (permissions docs; Postiz; Blotato).
  • Assuming one settings model fits every tool. Postiz requires who_can_reply_post on every X post; X's raw endpoint exposes different fields, including made_with_ai; servers differ, and so does what each can set (Postiz; X's endpoint docs).
  • Mistaking volume for the job. Wonda's guide decides up front that automation is for research and drafting first, not volume, and keeps the publish decision with a person; the reply-first daily loop it describes beats a content factory (Wonda).
  • Unlabeled AI media. X's write endpoint carries the made_with_ai disclosure for AI-generated media, and Superdirector's rule is to label AI content where a platform requires it and never publish invented reviews, testimonials, results or customers (X's endpoint docs; Superdirector pricing).

More on X posting and the agent loop

Frequently asked questions

How do you post to X with Claude Code?

Two routes. A server route: register an X MCP server with claude mcp add --transport http, authorize it in a browser, confirm it connects with claude mcp list, and then describe the post in plain language so Claude Code calls the server's posting tool. A script route: have Claude Code write and run a script against X's POST /2/tweets endpoint with bearer credentials you create at console.x.com, where X API v2 bills through credits deducted per request. Either way, keep Claude Code's permission prompts on and review the draft before it publishes.

Can Claude Code post to X without installing anything?

No. Claude Code is Anthropic's terminal coding agent: it writes and runs code and calls the tools you connect. The MCP and Claude Code docs describe the connection as the open standard for giving it external tools, so posting always means registering a server or configuring your own app and credentials. One plan note from the docs: most Claude Code surfaces require a Claude subscription or an Anthropic Console account before you get that far.

Do you need an X developer account or API key?

It depends on the route. Through an MCP server, the server holds the X connection and you authorize it in the browser; Postiz's flow uses OAuth with no API key to paste, and Composio prompts you to authenticate Twitter the first time its tools touch your account. The direct X API route needs the real thing: sign up at console.x.com, create an app and get credentials, and pay under X API v2's pay-per-usage pricing.

How much does posting to X from Claude Code cost?

Three lines worth adding. Your Claude plan, since most Claude Code surfaces require a Claude subscription or Console account. The posting layer: server subscriptions differ by vendor, and the X API charges per request through purchased credits, so read your developer console for current figures rather than copying a per-post price from a blog. And if the posting runs through Superdirector, plan credits cover AI work and its monthly grants run 300 credits on the $29 plan and 2,000 on the $199 plan.

Does Claude Code ask before it publishes a post?

By default it stays in the loop. Claude Code's permission docs describe a tiered permission system that asks before actions run, Postiz's X page documents Claude Code asking for permission before it publishes, and the Blotato pipeline guide says Claude asks before it publishes and that you should keep that gate on. Headless runs (claude -p) are documented for cron-style jobs, which is exactly when something can publish while you are not looking, so keep unattended runs to machines you set up deliberately.

Can Claude Code schedule X posts for later?

Scheduling is a feature of the posting layer, not of Claude Code itself. Postiz documents scheduled posting with precise timestamps and a queue you fill in a conversation, and its guide shows the claude -p form that reads a git log and schedules one tweet from a cron-style call. A script route can put the POST /2/tweets call on a cron of your own. Whatever the mechanism, a scheduled post is still a reviewed post; the schedule does not remove the review.

Related practical guides

Register one server and send the test prompt today

Add a server you trust with claude mcp add, ask Claude Code to list your connected accounts, then send one reviewed post before you queue a week.