Driving OmniPost from an agent

OmniPost is built to be driven by an agent. The agent prepares the content; OmniPost owns accounts, sessions, publishing, and records. The same publishing core is reachable three ways, plus a Skill that needs no setup at all.

Skill (easiest, works with any agent)

The open-source repo github.com/OmniGoAI/omnipost-skill (MIT) ships a ready-made SKILL.md: it teaches the agent how to locate the local OmniPost, to use MCP when it is mounted and the CLI otherwise, and the full publishing workflow. It also bundles content-rule cheat sheets for 10 Chinese platforms that the agent reads before publishing. Copy the repo's skills/omnipost/ folder into your agent's skills directory:

  • Claude Code: ~/.claude/skills/omnipost/
  • OpenClaw: ~/.openclaw/skills/omnipost/
  • Any other agent: its skills directory, or feed SKILL.md as a system prompt

The app can also generate a version tailored to this machine, with every path filled in: GET /api/skill?download=1.

The desktop app hosts an MCP server over SSE. Point your agent at it:

claude mcp add --transport sse omnipost http://127.0.0.1:8787/sse

The app must be running. Clients that only speak stdio can use the mcp.stdio entry (command / args / env) returned by GET /api/health; it works with installed builds too.

To help an agent set itself up, the app also serves:

  • GET /api/health — status, port, the MCP SSE address, and data/log directories.
  • GET /api/agent-tools — the live list of MCP tools.
  • GET /api/skill — a ready-made Claude Skill (?download=1 for a ZIP).

A good agent workflow

  1. get_status — confirm the app is up (platform / account / logged-in counts).
  2. list_accounts — see which accounts are available.
  3. preview_content — render the Markdown for a target.
  4. create_draft or publish_post — do the work.
  5. list_posts — inspect results, schedules, and failures.

Tips: address targets (specific accounts) rather than whole platforms when you can; pass images as file paths or http URLs — don't base64-encode them yourself, OmniPost reads and re-hosts them.

CLI

For scripts, or agents that don't speak MCP:

omnipost publish --doc post.md --targets csdn:default,juejin:default --mode draft

omnipost ships with the installed app: the cli.shell field returned by GET /api/health is the full path that runs on this machine (usually omnipost.cmd in the install directory on Windows, OmniPost.app/Contents/Resources/bin/omnipost-cli on macOS). The desktop app must be running for everything except omnipost mcp (starts the stdio MCP server) and omnipost oauth-connect (connect a Mastodon-family or LinkedIn account). See the API reference for the full command list.

HTTP

Everything is a localhost REST call under http://127.0.0.1:8787/api/* (non-local requests get a 403). There is also a streaming publish endpoint (POST /api/publish/stream, NDJSON per-account events) that powers the UI progress panel.

Free vs Pro for agents

Read-only calls (get_status, list_platforms, list_posts…) work on the free tier. Write calls from an agent — creating drafts, publishing, scheduling — are a Pro feature; on the free tier they return LICENSE_REQUIRED. The desktop UI is not subject to this agent gate (but still follows the publishing rules).