How to post to Mastodon from Claude Code
claude mcp add --transport http postwire https://postwire.io/api/mcp, sign in with your email, connect Mastodon once with your server's address and an access token, and ask "write a Mastodon thread about what shipped in CHANGELOG.md and post it". Claude Code writes it with generate_posts, shows it to you, and publishes it with post_to_social or queues it with schedule_post: a toot of up to your instance's own character limit (500 on mastodon.social), a thread of up to 10 posts with the link in a reply under it, and up to 4 images or videos with alt text. It works on any instance, and Mastodon is on the free plan: 1 business, 10 posts a month, 5 AI drafts a day, 2 networks per post, no card.When you ask for a thread with "thread": true, PostWire splits the text at your instance's own limit, read from the server when you connect (any limit from 100 to 100,000 characters), not at a fixed 500. So on an instance that allows 1,000 characters, a release note becomes two posts instead of four.
Updated . Written from PostWire's own code; vendor prices read on Oct 29, 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 Mastodon is connected: Read CHANGELOG.md, write a Mastodon thread of 3 posts about v2.4 with CamelCase hashtags and the release link in a reply under the last one, show it to me, and schedule it for Thursday at 10am.
- Add PostWire to Claude Code
In your terminal run
claude mcp add --transport http postwire https://postwire.io/api/mcp(add--scope userto have it in every project), then type/mcpin Claude Code and pick postwire to sign in. The sign-in asks for your email and a 6-digit code, which also creates a free PostWire account if you have none: no password and no card. - Or install the skill instead
npx skills add https://postwire.io --skill schedule-postsadds PostWire's scheduling skill to Claude Code instead. It uses your key from the environment: copy it in the dashboard under API & MCP and setPOSTWIRE_API_KEY. The skill is a plain file you can read first: schedule-posts/SKILL.md. - Create a Mastodon access token
On your Mastodon server, open Preferences → Development → New application, name it "PostWire", tick only
write:statusesandwrite:media, save, and copy Your access token. With those two scopes the token can post and upload media; it cannot read your timeline or your messages. Deleting the application in Mastodon disconnects PostWire. - Connect Mastodon
Ask "connect my Mastodon". Claude Code calls
create_connect_linkand prints a one-hour link; choose Mastodon there and paste your server's address (https://mastodon.social,https://fosstodon.orgor your own instance) and the token. Before saving, PostWire asks your server whether the token is valid, so a wrong token is refused on that page, and it reads the server's post length limit to measure your toots against it. The address has to be https and a public server. - Ask for the toot or the thread
"Write a Mastodon post about the new CSV import."
generate_postsreturns a draft and publishes nothing: within 500 characters, community-first with no marketing-speak, and 2 to 4 hashtags in CamelCase (#OpenSource, which screen readers read out word by word). Ask for a thread, or give it an idea too long for one post, and it returnstext(the first post) plusthread(the posts after it); a link comes back infirst_comment, to go in a reply under the last post. - Post now, or schedule it
Say "post it" and Claude Code calls
post_to_social; say "schedule it for Thursday at 10am" and it callsschedule_post, up to 365 days ahead, or withrun_at: "next_slot".threadholds up to 9 posts after the first, each a reply to the one before, andfirst_commentis one more reply under the last one. Images and videos go inmedia, each with its ownalt. This is the call:{ "name": "schedule_post", "arguments": { "platforms": ["mastodon"], "per_platform": { "mastodon": { "text": "v2.4 is out. Sync is twice as fast, and conflicts finally show you both versions. #OpenSource #SelfHosted", "thread": [ "We stopped syncing on every keystroke. Saves now batch every 2 seconds, which is most of the speed-up.", "Conflicts get a side-by-side view instead of a silent overwrite. Pick a side, or merge by hand." ], "first_comment": "Release notes and upgrade steps: https://example.com/changelog/2-4" } }, "media": [ { "url": "https://postwire.io/m/…/conflict-view.png", "alt": "Two versions of a note side by side, with the changed lines highlighted" } ], "run_at": "2026-11-05T10:00:00-05:00" } } - Open the toot
The result carries the post's link on your server and, for a thread, the link of every post in it. If your server refuses a later post of a thread, the earlier ones stay up and the result says which went out and which did not; each reply carries an idempotency key, so nothing is posted twice.
"What's scheduled on Mastodon?" calls list_scheduled_posts, and "cancel Thursday's thread" calls cancel_scheduled_post; the same queue is on the dashboard's Queue page. Without Claude Code, the same post is POST /api/post with {"platforms": ["mastodon"], "text": "…"} and your key. Prefer to set it up by hand first? Open the dashboard, connect Mastodon under Accounts and copy your key under API & MCP.
Ways to post to Mastodon from Claude Code, side by side
How each service plugs into Claude Code and what it starts at, read on its own Claude Code, home and pricing pages on Oct 29, 2026.
| Service | How it plugs into Claude Code | Free to start | Cheapest paid plan |
|---|---|---|---|
| PostWire | claude mcp add with https://postwire.io/api/mcp (OAuth sign-in), or the schedule-posts skill | Yes — free plan: 10 posts a month, Mastodon included, no card | $9/mo — 3 businesses |
| Upload-Post | npx skills add Upload-Post/upload-post-skill with an API key | Free plan: 10 uploads a month, 2 profiles, no card | $24/mo — 5 profiles |
| Postiz | claude mcp add with mcp.postiz.com/mcp-oauth-dynamic, or the Postiz skill | 7-day free trial | $29/mo — 5 channels |
Checked on Oct 29, 2026 (2026-10-29) 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
- A thread counts as one post: up to 10 posts and a reply with the link use one of the plan's 10 free posts a month. Upload-Post's free plan counts 10 uploads a month.
- The cheapest paid plan here: $9 a month for 3 businesses. Upload-Post $24, Postiz $29.
- Your instance's own limit: a thread is split at the character limit your server sets, read when you connect, so a long-post instance gets fewer, fuller posts.
- No key to paste to start:
claude mcp addand a sign-in with your email and a 6-digit code, which creates the free account too. - The toot is written for Mastodon:
generate_postswrites a community-first post with CamelCase hashtags and, from the same news, the Bluesky and LinkedIn versions in one call. - The token is tested before it is saved, so a wrong token is caught on the connect page, not when a scheduled post was due.
- Upload-Post — Claude Code + Mastodon skill (npx skills add Upload-Post/upload-post-skill; free API key, "no card"; text toots, photos and videos; any instance via its URL and an access token): www.upload-post.com/skills/claude-code/mastodon/
- Upload-Post plans (llms-full.txt: Free 10 uploads a month, 2 profiles, no credit card; Basic $24 a month, 5 profiles): www.upload-post.com/llms-full.txt
- Postiz — Claude Code (claude mcp add --transport http postiz https://mcp.postiz.com/mcp-oauth-dynamic, or npx skills add gitroomhq/postiz-agent with POSTIZ_API_KEY): postiz.com/claude-code
- Postiz — home page (supported channels include Mastodon): postiz.com/
- Postiz pricing ("Start with a 7-day free trial"; Standard $29 a month, 5 channels): postiz.com/pricing
Mastodon threads from Claude Code
- Up to 10 posts in one chain: the first post plus up to 9 more in
thread, each a reply to the one before, so Mastodon shows them as one thread. Images and videos stay on the first post. - Let PostWire split it at your instance's limit:
"thread": trueinstead of a list cuts the text at a paragraph, then a sentence, then a word, at the limit your server set, and never inside a link. - Counted the way Mastodon counts: a link is 23 characters whatever its length, and an emoji counts once. A post over the limit is refused before the first one is sent, never cut halfway.
- The link goes under the thread:
first_commentis a reply under the last post, where people look for it. - One thread, one post of your plan: a thread counts as one post however many replies it has, and the first comment is free too.
Source: PostWire's Mastodon publisher and thread code, read Oct 29, 2026.
Why post to Mastodon from Claude Code
- The facts are already in your repo: Claude Code reads the changelog, the commit log or the release notes and writes the toot from what actually shipped, which suits the fediverse's taste for plain, specific posts.
- One release, every network: "announce v2.4 on Mastodon, Bluesky and LinkedIn" sends one request with a version written for each network; on the free plan, a post goes to 2 networks at a time.
- From a script or CI:
claude -p "post a Mastodon thread about today's release from CHANGELOG.md" --allowedTools "mcp__postwire__*"runs it without a chat. - A person can have the last word: on paid plans, a brand's approval rules hold what Claude Code queues until you approve it from an emailed link.
More on Mastodon itself: Mastodon MCP server, with the limits PostWire works within.
What it does not do
Claude Code with PostWire writes, publishes and schedules your own toots and threads on Mastodon, at your account's default visibility. It does not add content warnings or polls, it does not read your timeline or notifications, and it does not boost, favourite, follow or send direct messages.
Questions people ask
Can Claude Code post to Mastodon?
Yes, with an MCP server or a skill. Claude Code has no Mastodon access of its own; with PostWire added (claude mcp add --transport http postwire https://postwire.io/api/mcp) and Mastodon connected once with your server's address and an access token, it writes toots and threads and publishes or schedules them when you ask.
Does it work with my own instance, not just mastodon.social?
Yes. You paste your server's address, so it works with any Mastodon instance reachable over https. PostWire reads that server's character limit when you connect and writes and splits posts to fit it.
Which permissions does the token need?
Two: write:statuses and write:media, from Preferences → Development → New application on your server. The token can then post and upload media, and cannot read your timeline or messages. You paste it on PostWire's connect page, not in the chat.
Can Claude Code post a Mastodon thread?
Yes. The posts after the first go in thread (up to 9 more), and first_comment adds a reply under the last one for the link. Or send "thread": true and PostWire splits the text itself at your instance's limit, at paragraph, sentence or word boundaries.
Can it post images and video to Mastodon?
Yes, up to 4 attachments per post, each with alt text of up to 1,500 characters. A video is held until your server finishes processing it, up to 45 seconds, so the post does not fail on an unprocessed file. A file on your computer goes through create_upload_link, a page where you pick it.
Can Claude Code schedule Mastodon posts?
Yes. It calls schedule_post with a time up to 365 days ahead, or "next_slot" for your next free posting hour, and PostWire publishes it at that time with Claude Code closed. The free plan keeps 3 posts waiting in the queue at once.
How much does it cost?
Mastodon is on the free plan: 1 business, 10 posts a month, 5 AI drafts a day, 2 networks per post, no card. Starter is $9 a month with 3 businesses and every network in each post, Pro $29 with 10 businesses; paid plans have a 14-day refund.
Try it on one business, free.
The free plan is 1 business, 10 posts a month, 5 AI drafts a day (about 20 a month) and 2 networks per post — every network connects free, no card, no time limit. Paid plans start at $9 a month and have a 14-day refund; Pro can be tried free for 7 days and Agency for 14, with a card at checkout and nothing charged that day.