MCP (streamable HTTP) · Mastodon

A Claude Code Mastodon bot that asks first

Open-source maintainers on Mastodon expect release posts that are plain, useful, and free of marketing gloss. Claude Code can write that kind of post from the repository it is already working in. Through SocialHandoff's MCP server it drafts a toot from CHANGELOG.md, adds a content warning if the notes are long, and uses CamelCase hashtags so the post reads well with a screen reader. A person approves each post before it federates.

Prompt

Look at CHANGELOG.md under ## 1.9.0 and write a Mastodon post for the project account. List the 3 changes users will care about as short lines, credit the two first-time contributors by their fediverse handles from CONTRIBUTORS.md, and end with #Rust #OpenSource. Keep it under 500 characters.

How to do it

  1. Mint a Mastodon agent key In https://app.socialhandoff.com, open Connections, connect your Mastodon account, then create an agent key scoped to Mastodon with draft permission only. Copy the key when it is shown; only its hash is stored.
  2. Register the server Run claude mcp add with the HTTP transport, pointing at https://app.socialhandoff.com/mcp and passing an Authorization: Bearer header with the Mastodon key. Use --scope user if you want it in every repository.
  3. Point it at your changes From the repo, ask Claude Code to read the diff, the merged pull requests, or CHANGELOG.md since the last tag and draft a Mastodon post from them.
  4. Review in the inbox Claude Code calls draft_post and returns the post id. Open the approval inbox, adjust wording if needed, and approve. Use schedule_post if you want a specific slot.

Example draft

fsnap 1.9.0 is out.

- Snapshots now compress with zstd by default, about 40% smaller
- fsnap diff understands renamed files
- Fixed a crash on read-only mounts

Welcome to our first-time contributors @mira@hachyderm.io and @tobi@fosstodon.org, thank you both.

Release notes: codeberg.org/fsnap/fsnap/releases

#Rust #OpenSource

Gotchas

  • Publishing uses idempotency keys, so a retried request after a timeout does not produce a duplicate toot.
  • Alt text is expected on the fediverse, and many people filter posts without it. The missing alt text guardrail flags drafts before they reach you.
  • Read your instance rules on automated posting. Many ask that bot-driven accounts tick the automated account box in profile settings.
  • Claude Code registers MCP servers per project by default. Add the server with --scope user if you want Mastodon drafting available in every repository.
Mastodon
  • Character limit: 500 characters on a default Mastodon server. Each instance can raise it, so check yours.
  • Links: Every URL counts as 23 characters, however long it is.
  • Media per post: Up to 4 attachments on a default server.
  • File sizes: Images up to 16 MB and video up to about 99 MB on a default install. Instances can set their own limits.
Mastodon scheduler with approval for any instance

Frequently asked questions

Does Claude Code need the stdio server or HTTP?
Either works. HTTP at https://app.socialhandoff.com/mcp is simplest for the hosted app. The stdio server via npx -y socialhandoff-mcp suits a self-hosted instance on your machine.
Does Claude Code know my instance's character limit?
Not by itself. Tell it in the prompt or brand memory, and set the per-network length guardrail so drafts over your limit are flagged.
Is posting to Mastodon from an agent good etiquette?
It can be, if the account is labeled as automated where your instance asks for it, posts carry alt text, and a person reviews each post. The approval inbox covers the last part.

Let your agents post. Keep the final say.

Connect your first agent in minutes. Every draft waits in your inbox until you approve it.

14 days free. No card required.

The hosted version is opening soon

Leave your email and we will send one message when hosted accounts open, with your 14-day trial ready. Want it today? Self-host it free from the repo.

Start free trial