How to Let AI Agents Publish to Social Media via MCP
MCP gives Claude Code, Cursor, and other LLM agents the ability to publish posts. Here's how to wire the Postproxy MCP server.
What MCP is, briefly
MCP is a protocol for giving an LLM access to tools, resources, and prompts that live outside the model. An MCP server exposes a set of tool definitions; an MCP client (Claude Code, Claude Desktop, Cursor) discovers them and can call them with structured arguments.
For social media publishing, MCP turns “the model wants to post this” into “the model called post_publish(profiles=['twitter','linkedin'], body='...') and got back a post ID.”
Postproxy’s MCP server
Postproxy ships two ways to run it:
- Hosted (remote) —
https://mcp.postproxy.dev/mcp. No install. Auth via?api_key=.... - Local (stdio) — npm package
postproxy-mcp. Runs on your machine.
Both expose the same tools.
Wiring it into Claude Code (remote)
claude mcp add --transport http postproxy \ https://mcp.postproxy.dev/mcp?api_key=YOUR_POSTPROXY_API_KEYRestart your Claude Code session. Ask: “Check my Postproxy authentication status.” Claude Code will call auth_status and report back.
Wiring it into Claude Code (local)
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-mcpThere’s also an interactive setup that runs the claude mcp add command for you:
postproxy-mcp setupAvailable tools
The Postproxy MCP server exposes these tools (full schemas at postproxy.dev/automation/mcp):
Authentication
auth_status— verify API key, list workspaces
Profiles
profiles_list— list connected social accountsprofiles_placements— list company pages, boards, organizations available for a profile
Posts
post_publish— create and publish a postpost_publish_draft— turn an existing draft into a published postpost_status— get a post’s current state and per-platform resultspost_update— edit a draft or scheduled postpost_delete— remove a postpost_delete_on_platform— delete from social platforms (where supported)post_stats— engagement metrics
Queues
queues_list,queues_get,queues_create,queues_update,queues_delete,queues_next_slot
Comments
comments_list,comments_get,comments_create,comments_deletecomments_hide,comments_unhide,comments_like,comments_unlike
History
history_list— published-post history with stats
A real example
Prompt to the agent: “Read this week’s changelog at /CHANGELOG.md, draft a post per major item, ask me to approve, then schedule them across LinkedIn and X for the next 5 weekdays at 10am ET.”
The agent will:
- Read the changelog (its file system tool).
- Draft 5 posts.
- Show each one for approval.
- On your approval, call
post_publish5 times with the rightscheduled_at. - Confirm back the 5 post IDs.
Without MCP this is “an agent that suggests” — with MCP it’s “an agent that ships.”
Building your own MCP-driven agent
Beyond Claude Code and Cursor, you can use the Anthropic SDK with MCP tool access:
from anthropic import Anthropicclient = Anthropic()
mcp_servers = [{ "type": "url", "url": "https://mcp.postproxy.dev/mcp?api_key=YOUR_POSTPROXY_API_KEY", "name": "postproxy",}]
response = client.beta.messages.create( model="claude-opus-4-7", max_tokens=4096, mcp_servers=mcp_servers, messages=[{ "role": "user", "content": "Schedule a post for tomorrow 9am ET on LinkedIn and X: 'New release out, link in bio'." }],)Claude calls post_publish itself, returns the post ID, and you didn’t write a line of platform-specific code.
Useful jobs to delegate to the agent
- Repurpose a blog post — read the blog, draft platform-specific captions, schedule across 5 platforms.
- Reply to comments — watch
comments_list, draft replies, post on approval (comments_create). - Weekly recap — read commits, ship an X thread + LinkedIn post.
- Calendar audit —
queues_list+queues_next_slot+history_list→ “what’s scheduled, what’s missing.”
All routed through MCP → Postproxy. The agent doesn’t see OAuth tokens. The platforms don’t see the agent.
Security model
The MCP server scopes everything to your Postproxy API key — same auth boundary as our REST API. The agent gets only the profiles you’ve connected. Rate limits and per-platform quotas apply. There’s no separate “agent permission” — the API key is the permission.
For deeper context, see MCP servers for social media, Social media MCP server, and Remote MCP server.