Intro

Scheduling thirty posts by hand is annoying. Scheduling a hundred and twenty across five platforms, with images, alt text and a different voice per account, is where most content plans quietly die — not because the writing stops, but because the assembling does.

This is how we build and publish a week of content without a CMS: content lives in Python files, assets are rendered from a template, and a small MCP client talks to our self-hosted Postiz instance. Two scripts, one JSON file per day, one cron job.

Context: what "a week" means here

The shape of the problem matters more than the tooling:

  • 5 channels in Postiz — three Instagram accounts with different voices, Threads, Facebook — plus a Telegram channel that is published directly through the Bot API.
  • 3 posts per channel per day, at staggered times, so no two posts land in the same minute.
  • One image per post for Instagram and Facebook, plus a cover for Threads; Telegram gets long-form text.
  • A separate video stream: one short video per day, cross-posted to the same channels plus YouTube.

That is 15 platform posts per day in Postiz, 3 in Telegram, and 15 rendered covers. Over seven days: 105 + 21 posts and 105 covers.

Step 1: content as data, not documents

Each day is a single file:

DAY = "2026-12-01" IG = { "account_a": [ {"slot": "09:00", "title": "Cover headline", "sub": "Subtitle", "caption": "Body text… "}, # … ], } THREADS = [("09:00", "Cover headline", "Post text…")] FB = [("09:00", "Cover headline", "Longer post text…")] TG = [("09:00", "Telegram headline", "HTML caption…")] 

Why code instead of a spreadsheet or a CMS? Three practical reasons:

  1. It diffs. A week of content is a reviewable pull request, not a database nobody can read.
  2. It lints. Length limits are checked in a script before anything reaches an API. Instagram allows 2200 characters, Threads 500, Telegram captions 1024 — a post that violates them fails locally, in milliseconds.
  3. It is idempotent. Re-running a step does not duplicate content, because the source of truth is a file, not a sequence of clicks.

Every row carries its own cover headline. This is the part people skip: if the image is generated from the post body, the headline is always too long. A separate title field forces a decision at authoring time.

Step 2: render assets, upload once

Covers are rendered locally — background image, veil, heading fitted to two to four lines — then uploaded to object storage and referenced by public URL:

python3 build_day.py 2026-12-01 # account_a -> 3 covers # fb -> 3 covers # threads -> 3 covers # total: 15 

The script writes content/2026-12-01.json with the final URLs. Two details that cost us a rebuild cycle each:

  • Fit the heading, don't trust the font size. A fixed font size puts a 60-character headline into one tiny line. Fit the block to a maximum number of lines, then step the size down until it fits.
  • Check that text actually rendered. File size proves nothing. A quick pixel check — count rows containing high-contrast pixels — catches the "font collapsed to 6pt" case that looks fine in a thumbnail.

Step 3: publish through MCP, not through a UI

Our scheduling client speaks JSON-RPC to the Postiz MCP endpoint. Upload first, then schedule with the returned media path:

def call(tool: str, args: dict) -> dict: r = requests.post(MCP_URL, headers=HEADERS, json={"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": tool, "arguments": args}}, timeout=180) raw = r.content.decode("utf-8") # not r.text — no charset in headers payload = json.loads(raw[raw.index("data: ") + 6:].rstrip("\n")) return json.loads(payload["result"]["content"][0]["text"]) 

Two traps that are worth knowing before you copy this:

  • SSE is not JSON. The response is event: message followed by a single data: line whose JSON can contain literal newlines. Parsing line by line truncates long payloads. Take everything after the first data: and parse that.
  • Decode explicitly. If the server omits charset, requests falls back to ISO-8859-1 and Cyrillic becomes mojibake. This looks like data corruption and is not.

Uploads are cached in a JSON map (source URL -> platform media path), so a retry after a failure does not re-upload 54 images.

Step 4: Telegram needs its own scheduler

The Bot API has no "publish later". So the queue is a file and cron is the clock:

for item in due_items(now): if item.get("video"): endpoint, payload = "sendVideo", {"video": item["video"], "caption": item["text"]} else: endpoint, payload = "sendMessage", {"text": item["text"]} requests.post(f"{BOT}/{endpoint}", json={"chat_id": CHAT_ID, **payload, "parse_mode": "HTML"}) 

The cron runs every ten minutes with a twelve-minute window; each sent item gets sent: true and the returned message_id. Text goes as a caption for videos, which is why the 1024-character caption limit matters at authoring time, not at send time.

Step 5: verify by reading back

Never trust a 200 response as proof. Three checks catch almost everything:

select to_char(p."publishDate", 'MM-DD HH24:MI'), i.name, p.state, case when p.image is not null and p.image <> '[]' then 1 else 0 end as has_media from "Post" p join "Integration" i on i.id = p."integrationId" where p."deletedAt" is null and p."publishDate" >= '2026-11-30' and p."publishDate" < '2026-12-07'; 

Expected: exactly three posts per channel per day, state = QUEUE, media present on every channel that needs it. Two more queries: duplicate (channel, publishDate) pairs (should be empty) and deleted rows.

That last filter is not optional. Deleting a post in Postiz is a soft delete — the row stays with deletedAt set. Count without the filter and a "successful" replacement looks like a duplicate.

Limitations

  • Platforms differ in what they require. YouTube rejects a post without a title and visibility setting; Bluesky counts graphemes, not characters, so len() is the wrong check.
  • Media cannot be edited in place on several providers. Replacing an attachment means creating a new post and deleting the old one — create first, delete second, or a failure leaves the day empty.
  • MCP is not a stable public API. Tool names and argument schemas are whatever the server exposes today. Pin the version you test against.
  • This pipeline does not write for you. It removes assembling, not thinking. If the brief is empty, formatted emptiness is still emptiness.

Conclusion

Content plans fail in the assembling, not in the writing. Putting the plan in files, rendering assets from one template, and publishing through a script that verifies its own work turns a two-day manual job into two commands and a database query.

The rule we keep: the script is allowed to be boring. Every place where it is clever is a place where it will break silently.

This article was prepared with AI assistance. The numbers above describe our own pipeline, not a benchmark.