Post to Bluesky and Mastodon from Claude Code
Wire the Chirpie MCP server into Claude Code so you can post to Bluesky and Mastodon without leaving your terminal.
Updated September 2026
How do you post to Bluesky and Mastodon from Claude Code?
Install the Chirpie CLI, run chirpie login, then register the Chirpie MCP server with claude mcp add chirpie -- npx @chirpie/mcp. Claude Code gets a chirpie_post tool, and you can say "post this to Bluesky and Mastodon" in the middle of a coding session. Bluesky connects with an app password; Mastodon connects with OAuth against whichever instance you use.
Step 1 — Authenticate once
npm install -g chirpie
chirpie loginchirpie login opens your browser, signs you in, and writes an API key to ~/.chirpie/config.json with 0600 permissions. The CLI and the MCP server share that file, so one login covers both. In CI or a container, set CHIRPIE_API_KEY instead — it takes precedence over the config file.
Step 2 — Connect Bluesky
Bluesky uses the AT Protocol with an app password, not OAuth. Generate one in Bluesky Settings → App Passwords — never use your account password.
chirpie accounts connect-bluesky \
--handle yourname.bsky.social \
--app-password xxxx-xxxx-xxxx-xxxxChirpie validates the credentials against the AT Protocol, stores them encrypted, and the account shows up immediately — no browser round trip.
Step 3 — Connect Mastodon
Mastodon is instance-agnostic. Pass your instance URL and Chirpie registers itself as an OAuth app there:
chirpie accounts connect-mastodon --instance https://mastodon.socialThe command prints an authorization URL. Open it, approve, and you are done. Mastodon tokens do not expire. Any Mastodon-compatible instance works — fosstodon.org, Hometown, Glitch-soc, your own server.
Check both landed:
chirpie accountsStep 4 — Add the MCP server to Claude Code
claude mcp add chirpie -- npx @chirpie/mcpOr commit it to the repo so your whole team gets it, in .mcp.json:
{
"mcpServers": {
"chirpie": {
"type": "stdio",
"command": "npx",
"args": ["@chirpie/mcp"]
}
}
}No API key goes in this file — the server reads ~/.chirpie/config.json. That is the point: the config is safe to commit.
Step 5 — Post from a coding session
Restart Claude Code so it picks up the server, then just ask:
Post to Bluesky and Mastodon: "Shipped a fix for the scheduler race condition — threads now publish atomically."
Claude calls chirpie_list_accounts to resolve the two account UUIDs, then chirpie_post twice. Each post comes back with a platform_post_id.
Chirpie handles Bluesky's RichText facets for you — links, mentions, and hashtags in your text are detected and linked correctly rather than posted as plain text.
What can the agent do once it is wired up?
| Tool | What you ask for |
|---|---|
chirpie_post | "Post this to Mastodon" |
chirpie_thread | "Turn this changelog into a 4-post Bluesky thread" |
chirpie_list_posts | "What did I post this week?" |
chirpie_get_post | "Show me post abc123" |
chirpie_delete_post | "Delete that last Bluesky post" |
chirpie_list_accounts | "Which accounts am I connected to?" |
chirpie_analytics | "How did yesterday's post do?" |
How do you post a thread?
Both platforms support native reply threading, so a thread stays a thread:
Turn my last three commits into a Bluesky thread, 300 characters max per post.
Under the hood that is POST /api/v1/threads:
curl -X POST https://chirpie.ai/api/v1/threads \
-H "Authorization: Bearer chirpie_sk_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"account_id": "660f9500-f30c-52e5-b827-557766551111",
"posts": [
{ "text": "Three things landed in the scheduler this week." },
{ "text": "1. Threads publish atomically — one failure reschedules the whole chain." },
{ "text": "2. Compare-and-swap guard means no duplicate publishes." },
{ "text": "3. Retries back off and cap at three attempts." }
]
}'A thread counts as N posts against your monthly quota, where N is the number of posts.
Character limits to give the agent
| Platform | Max post length |
|---|---|
| Bluesky | 300 |
| Mastodon | 500 |
Tell the agent the limit in your prompt, or let it read max_post_length from chirpie_list_accounts — the field is returned per account.
Troubleshooting
The tool does not appear. Restart Claude Code after claude mcp add. Confirm with claude mcp list.
unauthorized errors. Run chirpie whoami. If it fails, run chirpie login again.
An account shows is_active: false. For Bluesky, generate a fresh app password and reconnect. For Mastodon, re-authorize from the dashboard.
FAQ
Do I need separate API keys for Bluesky and Mastodon? No. One Chirpie API key covers every connected account across all platforms.
Can I use a self-hosted Mastodon instance?
Yes. Pass its URL as --instance. Chirpie registers as an OAuth app dynamically.
Does this work in Claude Desktop or Cursor? Yes — same server, different config file. See the MCP docs.
Can I schedule from Claude Code?
Yes. Ask for a time and the agent passes schedule_at. Posts publish within about five minutes of the target.
Is my app password stored in plaintext?
No. Credentials are encrypted at rest, and nothing sensitive lives in your .mcp.json.
Next steps
Post to Instagram from an AI Agent
How to let an AI agent publish Instagram posts and carousels through the Chirpie API, including the image requirement.
Schedule a Week of LinkedIn Posts with an Agent
Have an AI agent draft and schedule five LinkedIn posts in one pass using the Chirpie scheduling API.