DEV Community

Cover image for Building an AI Social Media Agent with Claude Code and Postproxy MCP
Kevin Meneses González
Kevin Meneses González

Posted on Originally published at kevinmeneses.com

Building an AI Social Media Agent with Claude Code and Postproxy MCP

Most "AI social media agents" are a cron job with a prompt.

The model writes a caption, and then a human copies it into five different apps. The writing got automated. The work didn't.

If you're:

  • running social for a product and tired of rewriting the same update five times,
  • building agent workflows on top of Claude Code,
  • or managing several brands from one terminal,

this is the setup I'd use.

An AI social media agent needs two things: a brain and hands. Claude Code is the brain. The hands are the hard part, because every platform has its own OAuth flow, app review, media rules and rate limits. Wiring a tool for each one is weeks of work before the agent posts anything.

The model was never the bottleneck.

The integrations were.


Why the Postproxy MCP server is the missing piece

Postproxy is a unified social media API. One endpoint publishes to Instagram, Facebook, Threads, TikTok, X, YouTube, LinkedIn, Pinterest, Bluesky, Telegram and Google Business. Postproxy handles the platform app reviews and OAuth on its side.

Postproxy: one API for every social platform

The part that matters for agents is the hosted MCP server. Connect it once, and Claude Code gets more than 100 tools it can call by itself. When I listed them, the server returned 117. These are the ones this tutorial uses:

  • Posts: post_publish, post_update, post_publish_draft, post_status, post_delete, history_list
  • Scheduling: queues_create, queues_list, queues_next_slot (posting queues with weekly timeslots)
  • Analytics: post_stats, profiles_stats, and summary_get, which gives one snapshot of what went out, how it performed and what's waiting for a reply
  • Engagement: comments_list, comments_create, comments_hide, plus direct messages (dm_chats_list, dm_message_send) and Google Business review replies (profile_comments_create)
  • Accounts: auth_status, profiles_list, profile_groups_list

That's an agent that can draft, schedule, publish, measure and reply. Not just write captions.

👉 Postproxy has a free plan with 10 posts a month and no credit card, which is enough to build everything in this tutorial.


What we're building

A Claude Code agent that:

  1. Takes a source (a blog post, a changelog, a product update)
  2. Writes a version adapted to each platform
  3. Saves them as drafts in Postproxy for you to approve
  4. Schedules approved posts into a weekly queue
  5. Reports every Monday on what performed and what needs a reply

Human approval stays in the loop. More on why at the end.


On Claude web or Claude Desktop: skip steps 1 and 2

This tutorial is built around Claude Code, which connects to Postproxy with an API key. If you use Claude on the web, in Claude Desktop or on mobile, there's a shorter path: add the Postproxy connector from Claude's connector directory and sign in. No API key, no terminal command. Claude gets the same Postproxy tools.

Everything after step 2 still applies. The only difference is where the rules go: instead of a CLAUDE.md file, paste the rules from step 3 into a Claude Project's instructions. Step 7 (running headless on a schedule) is the one part that needs Claude Code.


Step 1. Get your Postproxy API key

Create an account at app.postproxy.dev, connect the social profiles you want the agent to use, and generate an API key.

Postproxy has two key types:

  • Full access: every profile group in your account
  • Profile group scoped: limited to one brand or client

If you manage more than one brand, give the agent a scoped key per brand. An agent working on client A should never be able to post to client B.

Before you hand the key to an agent, check that it works. A quick Python sanity check:

import os
import requests

API_KEY = os.environ["POSTPROXY_API_KEY"]

response = requests.get(
    "https://api.postproxy.dev/api/profiles",
    headers={"Authorization": f"Bearer {API_KEY}"},
)
response.raise_for_status()

for profile in response.json()["data"]:
    print(f'{profile["platform"]:<12} {profile["name"]:<25} {profile["status"]}')
Enter fullscreen mode Exit fullscreen mode

You should see one line per connected account. On my test account, which only has my YouTube channel connected, it printed:

youtube      Kevin Meneses González    active
Enter fullscreen mode Exit fullscreen mode

If a profile shows as expired, reconnect it now rather than finding out when the agent fails at 9am.


Step 2. Connect the Postproxy MCP server to Claude Code

One command:

claude mcp add --transport http postproxy \
  https://mcp.postproxy.dev/mcp?api_key=YOUR_KEY
Enter fullscreen mode Exit fullscreen mode

That's the hosted server. Nothing to install.

The key travels in the URL there, so keep it out of screen recordings and shared configs. If you prefer it in an environment variable, Postproxy also ships a local package (Node.js 18+):

npm install -g postproxy-mcp

claude mcp add --transport stdio postproxy-mcp \
  --env POSTPROXY_API_KEY=your-api-key \
  --env POSTPROXY_BASE_URL=https://api.postproxy.dev/api \
  -- postproxy-mcp
Enter fullscreen mode Exit fullscreen mode

Now open Claude Code and ask:

Check my Postproxy authentication status and list my connected profiles.
Enter fullscreen mode Exit fullscreen mode

Claude calls auth_status and profiles_list. If you see your accounts, the agent has hands.


Step 3. Give the agent rules in CLAUDE.md

An agent without rules will happily publish whatever it writes. Claude Code reads CLAUDE.md at the start of every session, so that's where the guardrails go.

Create a folder for the agent and add this file:

# Social media agent

## Brand
- Product: Acme Analytics, a dashboard for Shopify stores
- Voice: direct, practical, no hype words ("revolutionary", "game-changer")
- Audience: store owners doing $10k–$500k/month

## Platform rules
- LinkedIn: 80–150 words, one insight, no hashtags in the body
- X: under 260 characters, one idea per post
- Threads and Bluesky: casual, can ask a question
- Instagram: needs an image; caption under 125 words, 3–5 hashtags at the end

## Hard rules
- ALWAYS create posts as drafts. Never publish directly.
- Never publish a draft unless I approve it in this conversation.
- Never delete posts.
- Before scheduling, check queues_next_slot instead of picking a time yourself.
- X is limited to 20 posts per 24h per account. Never plan more than 3 X posts a day.
Enter fullscreen mode Exit fullscreen mode

The hard rules are the important part. The rest is taste.


Step 4. Turn one source into platform-ready drafts

Now the real workflow. Paste a changelog or point Claude at a file:

Read ./changelog/2026-11.md. Write one post per platform for LinkedIn, X,
Threads and Bluesky following CLAUDE.md. Create each one as a draft in
Postproxy and give me a table with the draft IDs and the text.
Enter fullscreen mode Exit fullscreen mode

Behind the scenes, Claude:

  1. Reads the file
  2. Calls profiles_list to find your LinkedIn, X, Threads and Bluesky profiles
  3. Writes four different versions
  4. Calls post_publish once per platform with the post as a draft
  5. Returns the table for review

Nothing is public yet. You read the drafts, ask for changes ("make the X one less salesy"), and Claude updates them with post_update.

When you're happy:

Approved. Publish the LinkedIn and Bluesky drafts now.
Schedule the X and Threads ones into the next free slots of my weekly queue.
Enter fullscreen mode Exit fullscreen mode

Claude calls post_publish_draft for the first two and uses the queue for the rest. Then post_status tells you, per platform, whether each one went out or failed and why.

From here you can build:

  • a weekly content batch from your last three blog posts
  • launch-day posting across every network from one prompt
  • a "repurpose this YouTube video" flow from a transcript

Step 5. Set up a posting queue

Picking times by hand is the kind of work the agent should take off your plate. Postproxy queues hold weekly timeslots, and the agent drops posts into the next free one.

Create a Postproxy queue called "Weekday mornings" with slots
Monday to Friday at 09:30 and 13:00, Europe/Madrid timezone.
Enter fullscreen mode Exit fullscreen mode

Claude calls queues_create with the timezone and the timeslots. The tool also accepts a jitter of up to 60 minutes, so posts don't land at exactly 09:30:00 every day. From then on, "schedule it in the queue" is enough, and the agent asks queues_next_slot where the next post goes.

The rule in CLAUDE.md about not picking times by itself matters here. It keeps the agent from stacking five posts at 9:00 on Monday.


Step 6. Close the loop: stats and replies

Publishing is half of social media. The other half is noticing what worked and answering people.

Every Monday:

Give me last week's Postproxy summary. Which 3 posts performed best,
which comments are waiting for a reply, and draft a reply to each one
for me to approve.
Enter fullscreen mode Exit fullscreen mode

summary_get gives the agent one snapshot of posts, performance and pending replies. This is part of what it returned for my YouTube channel:

"comments": {
  "received": 26,
  "awaiting_reply": 17,
  "by_platform": { "youtube": 26 }
}
Enter fullscreen mode Exit fullscreen mode

Seventeen comments waiting for a reply, which I'd never have counted by hand. post_stats adds the numbers per post, and comments_list pulls the comments. The agent drafts replies, and after you approve them it posts them with comments_create.

It can also hide spam with comments_hide (Instagram, Facebook and Threads) and reply to Google Business reviews with profile_comments_create. On Google, a review can have only one reply, so replying again updates it.

This is the part most "AI social media" setups skip, and it's where an agent saves the most time.


Step 7. Run it headless on a schedule

Everything so far happens in an interactive session. Claude Code also has a headless mode (claude -p), so the Monday report can run without you opening a terminal.

claude -p "Give me last week's Postproxy summary: top 3 posts, comments \
waiting for a reply, and draft replies. Do not publish or post anything." \
  --allowedTools "mcp__postproxy__summary_get,mcp__postproxy__post_stats,mcp__postproxy__comments_list" \
  > reports/weekly-$(date +%F).md
Enter fullscreen mode Exit fullscreen mode

Look at --allowedTools. The headless run can only read. It can't publish, schedule or reply, even if the prompt goes wrong. Write actions stay in interactive sessions, where you approve them.

Put that command in cron or a GitHub Actions schedule, and the report is waiting for you every Monday morning.


Guardrails that actually matter

An agent with publishing access is a real risk to a brand. These are the rules I'd treat as non-negotiable:

  • Drafts by default. The agent creates drafts. You publish them. post_publish_draft exists for exactly this.
  • One scoped key per brand. A profile-group key means a confused agent can't post to the wrong client.
  • Read-only automation. Anything that runs without you gets --allowedTools with read tools only.
  • Respect platform limits. X caps at 20 posts per 24h per account on Postproxy. Write that into CLAUDE.md so the agent plans around it.
  • Test in a sandbox first. Postproxy has a sandbox mode, so you can test the whole flow before anything reaches a real account.

Key takeaways

  • The hard part of an AI social media agent is the platform integrations, not the model. The Postproxy MCP server solves that with one command.
  • Claude Code plus CLAUDE.md gives you an agent with rules: drafts only, approval before publishing, no guessing at schedules.
  • The best results come from closing the loop: stats and replies, not just publishing.

You don't need a bigger model to run your social media.

You need an agent with hands and a short leash.

👉 Start with Postproxy for free: 10 posts a month and no card, enough to build and test this whole agent.


Looking for technical content for your company? I can help — LinkedIn · kevinmenesesgonzalez@gmail.com

Top comments (0)