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.

In scope
Draft → schedule → publish → webhook → react. Eight social networks, one afternoon.
Out of scope
Crawling platforms for replies, scraping competitors, anything against platform ToS.

The stack

Claude (the brain)
Claude Desktop, Claude Code, or any MCP-capable client. The model writes captions and picks tools.
Posta MCP server (the tools)
Exposes typed tools — createPost, schedulePost, listAccounts, uploadMedia. More →
Webhook receiver (the loop)
A 50-line edge function or Node server that catches Posta's outbound webhooks and signals the bot.
Posta account (the rails)
Connects to eight social networks via official APIs. 14-day free trial.

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:

Auto-respond on publish
When LinkedIn fires "post.published", hand the post URL to Claude and have it draft the first comment reply.
Multi-day campaign branching
When day 1's post publishes, the bot evaluates engagement and decides what day 2 should say.
Retry-with-variation
When "post.failed" fires, the bot regenerates the caption with a different angle and re-schedules.
Slack supervision
Every publish fires a Slack message with a "kill switch" button — supervised autonomy.

Where to go from here

Three good next steps once the basic loop works:

Frequently asked questions

What is an autonomous social media bot?
A pipeline that drafts, schedules, publishes, and reacts to platform feedback without a human in the loop for each post. Three pieces: an LLM (Claude), a typed tool surface (Posta MCP), and HMAC-signed outbound webhooks for the closed loop.
What do I need to build one?
A Posta API token (free trial), the Posta MCP server, an MCP-capable LLM client (Claude Desktop, Claude Code, Cursor, or custom), and a small webhook receiver for the closed loop. The receiver is a 50-line Node file.
How long does it take?
An afternoon end-to-end if you stay in scope. MCP install is 30 seconds, prompting is iterative, the webhook receiver is the longest piece.
Will my bot get rate-limited or banned?
Posta publishes via official platform APIs with per-network rate-limit handling and retry-with-backoff baked in. As long as the bot posts at normal volumes, you stay within platform terms.
Can I supervise before going fully autonomous?
Yes. Common pattern: the bot creates drafts the first week, you review, then graduate it to scheduled mode once you trust the output.

Get a Posta token and start building

14-day free trial. MCP server, Claude Code skill, and n8n node are free and open source.