How to post to social media from your terminal (Claude Code, MCP & CLI)

How to post to social media from your terminal (Claude Code, MCP & CLI)

Most social schedulers assume you live in a browser tab. Posta does too — but it also exposes the same publishing engine to the command line, so you can draft, schedule, and publish to eight networks without ever leaving your editor. This guide covers the three developer surfaces and when to reach for each.

Why post from the terminal?

If you already write content in Markdown, generate captions with an LLM, or keep a content calendar in code, the round-trip through a web UI is friction. Driving Posta from the terminal means you can script a whole week of posts, wire publishing into CI, or let an AI agent manage your queue — all against the same accounts, plan limits, and analytics as the web app.

Three developer surfaces

1. The Claude Code / OpenClaw skill

The Posta skill turns Claude Code (or any OpenClaw agent) into a social media command center. You talk to it in natural language — “generate an image and schedule it to LinkedIn and Bluesky for 9am tomorrow” — and it calls Posta under the hood. Install it from ClawHub for OpenClaw, or from the GitHub repo as a Claude Code plugin. See the CLI posting guide for the full walkthrough.

2. The MCP server (posta-mcp)

Prefer a tool that speaks the Model Context Protocol? posta-mcp exposes Posta’s tools to any MCP client — Claude Desktop, Cursor, Windsurf, VS Code, or Zed. One npm install, one API token, and your assistant can list accounts, upload media, create posts, and check analytics. Add it to your client config:

{
  "mcpServers": {
    "posta": {
      "command": "npx",
      "args": ["-y", "posta-mcp"],
      "env": { "POSTA_API_TOKEN": "posta_your_token_here" }
    }
  }
}

3. The REST API

When you want full control — a custom script, a backend job, a Zapier/n8n step — go straight to the REST API. Bearer-token auth, an OpenAPI spec, and outbound webhooks. Creating a post is a single request:

curl -X POST https://api.getposta.app/v1/posts \
  -H "Authorization: Bearer posta_your_token" \
  -H "Content-Type: application/json" \
  -d '{"caption":"Hello from my terminal","socialAccountIds":[123]}'

A three-step workflow

Whichever surface you pick, the flow is the same:

  1. Connect your accounts once in the Posta dashboard and generate an API token (Settings → API tokens; tokens start with posta_).
  2. Create a post — caption, media, and target account ids. Upload media from a URL or a local file first if you need it.
  3. Schedule or publish — set an ISO timestamp to schedule, or publish immediately to every target platform at once.

Which one should you use?

  • Skill — you live in Claude Code / OpenClaw and want natural-language posting from your terminal.
  • MCP server — you use Claude Desktop, Cursor, Windsurf, VS Code, or Zed and want Posta as a set of typed tools.
  • REST API — you’re writing your own script or integration and want maximum control.

All three run through the same authentication and plan enforcement as the web app, so your account limits and analytics stay consistent no matter how you post. Start with a 14-day free trial — no credit card required.

Ready to simplify your social media workflow?

Join creators and teams who save hours every week with Posta.