API reference

All three interfaces sit on one core, so names and behavior match across MCP, CLI, and HTTP.

MCP tools

The desktop app exposes these tools over MCP. Address targets by targets (specific accounts, recommended), platforms, or groups. Pass images as file paths or http URLs — not base64.

Status

  • get_status — confirm the app is ready (platform / account / logged-in counts).

Platforms, accounts & groups

  • list_platforms — all platforms and their capabilities.
  • list_accounts — logged-in accounts and their session state.
  • list_account_groups — account groups and members.
  • check_auth — is a platform account logged in?
  • request_login — re-login an existing account (opens a window; fresh=true forces a re-scan).
  • add_account — add a new account (supports multiple per platform).
  • set_account_label — rename an account.
  • remove_account — remove an account and clear its local session.

API credentials

  • list_platform_credentials — list API credentials (secrets masked).
  • set_platform_credentials — configure API credentials (e.g. a WeChat appId/appSecret).
  • remove_platform_credentials — delete a platform's credentials.

Drafts & publishing

  • create_draft — save as a draft (nothing public).
  • publish_post — attempt a real publish (returns stage / published / code).
  • publish_draft — promote an existing draft (by post id) to a real post.
  • preview_content — render Markdown to HTML with the publishing renderer.
  • list_platform_categories — the categories / columns a platform offers.

Scheduling

  • schedule_post — publish at a given time.
  • list_schedules — query scheduled tasks (pending / running / done / failed / canceled).
  • cancel_schedule — cancel a pending task.

Records & metrics

  • list_posts — query publish/draft records (by platform, account, status, stage, keyword, date; paged).
  • get_post_metrics — fetch engagement (views / likes / comments / shares) — supported on some overseas platforms only.

Policy

  • get_policy / set_policy — read/write the safety policy (daily limit, de-dup, circuit breaker, blackout hours).

Stock images (bring your own key)

  • search_stock_images — search Pixabay / Pexels / Unsplash for commercial-use images.
  • use_stock_image — pick one and get a public URL.

CLI commands

node bin/omnipost.js <command>. Everything needs the desktop app running except mcp and oauth-connect.

  • status · platforms · accounts
  • account add|remove|label|list <platform> — manage accounts
  • login <platform> [--accountId] · check-auth <platform>
  • groups · group save|rm <name> (--targets|--platforms)
  • preview --doc <file.md>
  • publish --doc <file.md> (--platforms|--targets|--group) [--mode draft|publish] [--title --tags --summary --category --cover --video --canonical --baseDir]
  • publish-draft <platform> <postId>
  • posts [--platform --accountId --status --stage --q --limit]
  • categories <platform> [--accountId]
  • metrics <platform> (--recordId|--postId) [--accountId --force]
  • images providers|search <provider> "<query>"|use <provider> (--item|--url) [--mode cover|inline --out]
  • schedule --doc <file.md> --at "YYYY-MM-DD HH:mm" (--platforms|--targets) [--mode --baseDir]
  • schedules [--status --platform --q] · schedule-cancel <id>
  • api-config list|set|remove <platform> [--accountId] [--key value ...]
  • oauth-connect <platform> [...] — interactive OAuth (Mastodon family, LinkedIn); runs without the desktop app
  • media-test --file <image> — test the S3 image host
  • policy show|set [...]
  • mcp — start the stdio MCP server (runs without the desktop app)

--platforms targets every logged-in account on a platform; --targets csdn:default,csdn:a2 targets specific accounts.

HTTP endpoints

Localhost only, under http://127.0.0.1:8787/api/*. Highlights:

  • GET /api/health — status, port, MCP SSE address, data/log dirs.
  • GET /api/agent-tools — live MCP tool list.
  • GET /api/skill — a ready-made Claude Skill (?download=1 for a ZIP).
  • POST /api/publish/stream — streaming publish (NDJSON per-account events).

The MCP SSE endpoint is http://127.0.0.1:8787/sse (messages posted back to /mcp/messages).

Configuration

  • Data lives under ~/.omnipost/ (accounts, posts, schedules, groups, policy, license). Login cookies stay in isolated browser partitions.
  • Port defaults to 127.0.0.1:8787.
  • Environment: OMNIPOST_PORT (port), OMNIPOST_DATA_DIR (data dir), OMNIPOST_API_BASE (CLI/MCP target API).