DEV Community

Stewan Silva
Stewan Silva

Posted on

How an AI agent schedules my social posts over MCP

I build Statuz, a scheduler for X, Bluesky, Mastodon, LinkedIn and Reddit. For the last few months most of my own posts haven't been typed into a composer. I ask Claude Code something like "schedule a short thread about today's release for tomorrow 9am, X and Bluesky, show me first", and it does the rest over MCP.

Here's how that works: the tools the agent calls, plain-word times, checks before saving, and why nothing goes out twice.

Every command is a tool

Statuz started as a CLI. The MCP server isn't a separate API: it registers one tool per CLI command, and the tool name is the command id with dots turned into underscores. statuz posts create is posts_create, statuz posts list is posts_list, and so on.

The tools an agent uses most:

  • accounts_list to see which accounts are connected and which ones are defaults
  • posts_create to write a post or a thread, then publish it, schedule it or keep it as a draft
  • posts_list and posts_get to read the queue back
  • posts_edit, posts_delete and posts_publish to change things later
  • media_add to upload an image with alt text before attaching it

Each tool carries MCP's hints, so clients can tell reads from writes: posts_list is read-only, posts_delete is destructive. Some commands aren't exposed to agents at all: starting or stopping the daemon and setting secrets stay with the person.

The server also sends one instruction up front: posts_create without an at time publishes immediately, so ask first, or pass draft: true or a time. That line saved me from many accidental posts.

Times in plain words

The at field takes an ISO time or words: "tomorrow 9am", "fri 17:30", "in 2 hours". It's parsed in the machine's time zone (or the org's on Statuz Cloud), and it never lands in the past: "9am" asked at 10am means tomorrow. Agents are bad at time zone arithmetic, so letting them pass the words through and having the server resolve them removed a whole class of bugs.

Checked before it's saved

Every post is checked against the limits of every account it's going to before anything is written to the queue. Some real numbers from the repo:

  • Bluesky: 300 graphemes, up to 4 images, images up to 2 MB
  • X: 280 characters, or 25,000 for Premium accounts, with X's own weighting (a link counts as 23, an emoji as 2)
  • Mastodon: whatever the instance says, 500 by default
  • Reddit: a title is required, up to 300 characters

If a post is too long for one destination, the call fails with invalid_input and a message per problem, like Bluesky (you.bsky.social): 342 characters, the limit is 300. The agent reads that, shortens the text and tries again, while it's still in the conversation instead of at 9am the next day when nobody is watching.

Nothing goes out twice

Agents retry. Networks time out. Two things handle this:

  1. posts_create takes an optional idempotencyKey. Creating again with the same key returns the first post instead of making a second one. It runs under a lock named after the key's hash, so two concurrent calls with the same key can't both win.
  2. Publishing holds a lock per post, so the CLI and the daemon never publish the same post at the same time. Each destination's result is saved as it lands, so a crash doesn't forget what already went out, a destination that was published is never posted again, and a half-published thread continues where it stopped.

One queue

The Mac app bundles the same CLI. So the menu bar app, the statuz CLI in my terminal and the MCP server my agent talks to all read and write the same queue. What the agent schedules shows up in the app's calendar, and what I change there is what the agent sees next time it calls posts_list.

Trying it

Locally, it's free:

npm i -g statuz-cli
statuz init
statuz accounts connect --platform bluesky
statuz mcp
Enter fullscreen mode Exit fullscreen mode

statuz mcp serves this computer's Statuz over stdio. X and LinkedIn need your own developer app keys when you run it locally; Bluesky and Mastodon need nothing.

In Claude Code there's a plugin, from the MIT-licensed statuz-agents repo (the plugin, skill and MCP config; Statuz itself is closed source):

/plugin marketplace add intenseloop/statuz-agents
/plugin install statuz@statuz
Enter fullscreen mode Exit fullscreen mode

For Claude or ChatGPT, add a custom connector with https://api.statuz.cloud/mcp and sign in. That's Statuz Cloud, which keeps posting while your laptop sleeps. It's pay per published post from prepaid credits (from $5, good for 6 months): $0.01 on Bluesky, Mastodon, LinkedIn and Reddit, $0.03 on X, $0.30 on X with a link. Drafts, scheduling, edits, agent calls and failed posts are free, and there's no subscription.

Then ask for something like: "Schedule three posts about this week's changes, one a day at 9am to Bluesky and Mastodon. Show me the list before saving." A typical run is accounts_list, a few posts_create calls with draft: true, then posts_edit to schedule them once I've said yes.

More at https://statuz.app.

Feedback

I'd like honest feedback, especially from people wiring agents to MCP servers: is one tool per CLI command the right shape, or would you rather have fewer, bigger tools? And what would you want checked before a post is saved that I'm not checking yet?

Top comments (2)

Collapse
 
gautamtalksdev profile image
Gautam K •

On what to check before saving, I'd look at the defaults more than the limits. "posts_create without at publishes immediately" is handled by a server instruction, but an instruction is the thing an agent is most likely to lose after a long context. For calls arriving over MCP I'd make a missing at mean draft on the server side, and require an explicit publish now flag.

Same idea for idempotencyKey: since it's optional, an agent that retries after a timeout without sending one still creates a second post. Deriving a fallback key from the text, the accounts and the time would cover that.

One tool per command reads fine to me, since the hints already split reads from writes. Was there a reason to keep immediate publish as the default for agent calls?

Collapse
 
junfengzhou01 profile image
Junfeng Zhou •

A dry-run option on the create tool that returns the final text and publish time before saving gives the agent one clear confirm step.