Build an Autonomous Social Media Bot in One Afternoon
From zero to a closed-loop social bot using Claude + the Posta MCP server. Draft, schedule, publish to eight networks, and react to HMAC webhooks — no dashboard, no glue code.
What you'll build
A bot that takes a high-level instruction ("post about our launch this week"), drafts per-platform captions with Claude, schedules them via Posta, and reacts when each post publishes — replying to early comments, pinging Slack, or branching the next campaign step.
The stack
Step 1 — Wire Posta MCP into your client
Get a Posta API token from your dashboard, then add the Posta MCP server to your client's MCP config. The server runs on demand via npx — no separate install step. Restart the client and the Posta tools appear in the tool list.
// claude_desktop_config.json (or your client's MCP config)
{
"mcpServers": {
"posta": {
"command": "npx",
"args": ["-y", "posta-mcp"],
"env": { "POSTA_API_TOKEN": "posta_xxx" }
}
}
}Step 2 — Prompt Claude to draft and schedule
With the MCP server wired in, Claude picks the right Posta tool based on the prompt. No prompt-engineered API docs needed.
"This week I'm announcing v2 of our SDK.
Draft a LinkedIn post (long-form), a Bluesky thread (short),
and a Threads post. Schedule LinkedIn for Tuesday 9am CET,
the others for Wednesday 10am CET. Use the launch image from
my media library." Claude calls listMedia to find the image, drafts three per-platform captions, and calls createPost three times with the right scheduling. Output ends up in your Posta dashboard as scheduled drafts.
Step 3 — Receive HMAC webhooks
Configure a webhook endpoint in Posta's settings. When a post publishes (or fails), Posta POSTs an HMAC-signed payload to your URL. A minimal receiver in Node:
// webhook.js
import { createHmac, timingSafeEqual } from 'node:crypto'
import express from 'express'
const app = express()
app.use(express.json({ verify: (req, _, buf) => { req.raw = buf } }))
app.post('/posta-webhook', (req, res) => {
const sig = req.headers['x-posta-signature']
if (!sig) return res.sendStatus(401)
const expected = createHmac('sha256', process.env.POSTA_WEBHOOK_SECRET)
.update(req.raw).digest('hex')
const sigBuf = Buffer.from(sig)
const expBuf = Buffer.from(expected)
if (sigBuf.length !== expBuf.length || !timingSafeEqual(sigBuf, expBuf)) {
return res.sendStatus(401)
}
const { event, platform, platformPostUrl } = req.body
console.log(`${event} on ${platform}: ${platformPostUrl}`)
// → trigger next agent action here
res.sendStatus(200)
})
app.listen(3000)Step 4 — Close the loop
Now the bot has feedback: each publish fires a webhook, and the receiver can kick off the next action — call Claude back, post a Slack note, branch a multi-day campaign, retry on failure. Some common closed-loop patterns:
Where to go from here
Three good next steps once the basic loop works:
Frequently asked questions
Explore more
Get a Posta token and start building
14-day free trial. MCP server, Claude Code skill, and n8n node are free and open source.