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.
MCP (recommended for agents)
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. A stdio server also exists, but it only works when running OmniPost from source — the installed app can't be launched by an external node, so installed builds must use SSE.
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=1for a ZIP).
A good agent workflow
get_status— confirm the app is up (platform / account / logged-in counts).list_accounts— see which accounts are available.preview_content— render the Markdown for a target.create_draftorpublish_post— do the work.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:
node bin/omnipost.js publish --doc post.md --targets csdn:default,juejin:default --mode draft
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).