Automate Social Media Posting and Scheduling With Claude Code (and Any AI Agent)
I just told Claude Code "post HI from postpeer on my twitter" and it did. No copy-paste, no dashboard, no OAuth dance. One sentence in the terminal and the tweet was live.
The whole thing took about three seconds, most of which was the network round-trip. Here's how the setup works, and how to do the same thing whether you're using Claude Code, the Claude API directly, or any other AI agent framework.
What's actually happening
PostPeer runs a hosted MCP server at https://mcp.postpeer.dev/mcp. MCP (Model Context Protocol) is the standard Anthropic introduced to let agents call external tools. When you wire PostPeer's MCP into Claude Code, Claude gets 34 typed tools — one per public PostPeer endpoint:
create_post,list_posts,delete_post— publish and manage postslist_scheduled_posts,reschedule_post,cancel_scheduled_post— manage the publish queuelist_integrations,get_oauth_url— see and add connected accountsget_analytics— pull cross-platform post metricsai_write_content,ai_generate_image— caption and image helpers- …plus profile management, BYOK app management, notifications, and platform-specific helpers like
get_pinterest_boardsandget_tiktok_creator_info.
From Claude's perspective, it now knows how to post to social media. From your perspective, you can talk to your terminal and your accounts get updated.
Step 1: Add the MCP server URL
Grab an API key from the PostPeer dashboard. Then add the hosted MCP to Claude Code:
claude mcp add postpeer \
--transport http \
--header "Authorization: Bearer YOUR_POSTPEER_API_KEY" \
https://mcp.postpeer.dev/mcpThat's the entire install — nothing running locally, no npx, no Docker. Claude Code will pick up the new tools on the next session.
For Claude Desktop / Cursor / Zed / any other Streamable-HTTP MCP client, drop this in the config instead:
{
"mcpServers": {
"postpeer": {
"url": "https://mcp.postpeer.dev/mcp",
"headers": {
"Authorization": "Bearer YOUR_POSTPEER_API_KEY"
}
}
}
}Step 2: Connect your social accounts
The MCP can post anywhere PostPeer can post, but it needs an account to post as. Connect your Twitter, LinkedIn, Instagram, TikTok, YouTube, Pinterest, or Bluesky in the integrations dashboard. One OAuth click per platform.
Once they're connected, you can ask Claude to list them:
"List my connected social accounts"
Claude calls the list_integrations tool and shows each account with its id, platform, and display name. Those IDs are what the publish tool needs.
Step 3: Post by talking
Here's the actual prompt I used:
"post HI from postpeer on my twitter"
Claude figured out which account ID to use from the integrations list, then called the create_post tool with publishNow: true. The tool call looked like this:
{
"name": "create_post",
"arguments": {
"content": "HI from postpeer",
"publishNow": true,
"platforms": [
{ "platform": "twitter", "accountId": "69da6882322e75b602ad2916" }
]
}
}Same shape works for every platform. Swap twitter for linkedin, instagram, tiktok, youtube, pinterest, facebook, threads, or bluesky.
Step 4: Schedule instead of post now
Want it to go out tomorrow at 9am? Just say so:
"Schedule a tweet for tomorrow at 9am ET that says 'shipping new features today'"
Claude swaps publishNow: true for scheduledFor and timezone:
{
"name": "create_post",
"arguments": {
"content": "shipping new features today",
"scheduledFor": "2026-05-02T09:00:00",
"timezone": "America/New_York",
"platforms": [{ "platform": "twitter", "accountId": "<id>" }]
}
}PostPeer queues it and delivers at the exact time. You can see all scheduled posts in the posts dashboard.
Step 5: Cross-post in one shot
Here is where it gets fun. Tell Claude:
"Post 'we just hit 10k users 🎉' to my Twitter, LinkedIn, and Bluesky right now"
One API call goes to PostPeer, PostPeer fans out to all three platforms, and Claude reports back with three live URLs. The agent doesn't have to know any platform-specific details. Character limits, OAuth scopes, media formats. PostPeer normalizes all of that.
Going beyond Claude Code
The MCP is the easy path, but PostPeer is a plain REST API underneath. Any agent framework can use it.
If you're using the Anthropic SDK with tool use, define a post_to_social tool that wraps the PostPeer endpoint and let Claude call it directly. Same idea as the MCP, just hosted in your own code.
OpenAI function calling works the same way. Define a function with the same shape and pass it to GPT. The PostPeer call is identical regardless of which model is on the other end.
LangChain, LangGraph, and CrewAI all support custom tools. Add PostPeer as one. The endpoint is POST https://api.postpeer.dev/v1/posts with an x-access-key header.
For no-code workflows, n8n, Zapier, and Make can hit PostPeer as a webhook node. Trigger from RSS, Google Sheets, a database, or wherever your content lives.
And if you're writing your own service in Node, Python, or Go, it's just HTTP. There's a TypeScript SDK if you want types.
The MCP isn't magic. It's a thin wrapper over the REST API that gives Claude Code a built-in way to use it. If you're building something more custom, skip the MCP and call the API directly.
A more interesting example: the daily content agent
Here's what I actually do with this. A scheduled Claude Code task runs every morning. Its prompt is roughly:
"Look at our changelog from yesterday and our top GitHub issues. Write 3 tweets and 1 LinkedIn post about anything notable. Schedule them across the day."
The agent reads the changelog, drafts the content, picks reasonable posting times, and calls PostPeer. I get an email summary, review what's queued, and either let it ship or tweak it in the dashboard. I wrote about an earlier version of this setup if you want the full story.
The pattern generalizes to anything text-shaped. Release notes, support themes, analytics highlights, weekly wrap-ups. Anything you'd be willing to post manually if you had time, an agent can post for you.
Caveats worth knowing
A few things I learned the hard way.
Always have the agent confirm before posting to production accounts, especially during initial setup. Get it to show you what it's about to post first, then publish.
Scheduled posts are easier to review than immediate ones. Schedule for an hour out, check the dashboard, cancel if anything's off.
Watch your credit usage. Each post is 1 credit, and an over-eager agent can burn through your quota fast. The free tier is 20 posts a month, paid plans go higher.
Media is async. If you want the agent to post images, point it at a public URL via mediaItems[].url, or have it call create_media_upload to get a presigned S3 URL first.
Try it
Grab an API key, run the claude mcp add command above, and tell Claude Code to post something. If you want a deeper look at the agent-side patterns, the Social Media API for AI Agents page has the relevant SDK examples, and the Social Media API for Claude Code page covers the MCP setup in more detail.
Add the URL, connect an account, post. About two minutes from a cold start. The real work is figuring out what you want your agent to actually say.