Purpose
tiktok-agent-publisher is a TikTok content publishing tool for AI agents, provided in two forms: a CLI and an MCP server. It wraps TikTok's official Content Posting API, letting agents check publish readiness, build OAuth authorization URLs, rehearse the publish flow, and upload TikTok videos after live mode is explicitly enabled, all without browser automation.
The tool is positioned as "agent-first": traditional social publishing scripts target human users in front of a terminal, whereas this tool provides a different contract for agents—a manifest containing installation and run rules, a connection status check before write operations, a privacy boundary that never returns token values, dry-run by default, and structured JSON output for planning, retrying, and auditing.
Main Capabilities
- Readiness check (doctor): Reports the current mode and the configuration items still missing, but never returns any token values.
- Privacy audit (privacy-audit): Explains which data stays local and which is sent to TikTok, letting agents understand the contract before write operations.
- Build publish payload (dry-run): Validates the task structure and copy without uploading anything; the returned platformPostId is a synthesized dryrun_* id and raw.dryRun is true, making it safe to wire into retry and audit logs.
- Poll status (dry-run): publish-status returns a DRY_RUN status, allowing the polling loop to be rehearsed end to end.
- List recent videos (dry-run): Returns an empty but well-formed list matching the structure returned by the live API, so post-publish confirmation code needs no changes.
- OAuth support: Provides auth-url to generate authorization links; the OAuth PKCE verifier is persisted locally in .agent-data/ and does not appear in MCP output.
- MCP server: Uses stdio transport by default, with optional Streamable HTTP (no session id, JSON responses, loopback address only).
How to Use
The first trial run requires no TikTok credentials. Without a .env, dry-run is enabled by default and all commands return structured JSON without touching the live API. Agents are advised to perform the following in order before their first real publish:
- Check readiness status (doctor).
- Confirm the privacy boundary (privacy-audit).
- Build the publish payload (dry-run).
- Poll status (dry-run).
- List recent videos (dry-run).
Entering live mode: fill in TIKTOK_CLIENT_KEY / TIKTOK_CLIENT_SECRET, complete OAuth (see auth-url), confirm that doctor reports ready_for_live_publish: true, then set TIKTOK_DRY_RUN=false. After that, the same five commands will act on the real Content Posting API.
For MCP configuration, stdio is the default; optional Streamable HTTP is enabled via the environment variables TIKTOK_MCP_HOST, TIKTOK_MCP_PORT, TIKTOK_MCP_TRANSPORT=http. The recommended first tools to call are tiktok_connection_status, tiktok_privacy_audit, tiktok_publish_video.
When configuring, copy .env.example to .env and fill in only the values you need. Do not commit .env, token files, or .agent-data/. Video inbox uploads can upload local files directly via TikTok's upload URL; photo and URL-pull workflows can use Supabase Storage or other public media hosting.
Applicable Scenarios
- An agent needs to publish or check TikTok content and does not want to use browser automation, hidden state, or token leakage.
- Automated publishing flows that require safe rehearsal and auditing before write operations.
- Agent runtimes using MCP clients such as Codex, Claude, Cursor, Hermes, OpenClaw.
Limitations
- Live publishing is disabled by default and is only enabled after setting TIKTOK_DRY_RUN=false.
- Tokens are read from environment variables or a local .env, and tool responses never contain token values.ed JSON without touching the live API. Agents are advised to perform the following in order before their first real publish:
- Check readiness status (doctor).
- Confirm the privacy boundary (privacy-audit).
- Build the publish payload (dry-run).
- Poll status (dry-run).
- List recent videos (dry-run).
Entering live mode: fill in TIKTOK_CLIENT_KEY / TIKTOK_CLIENT_SECRET, complete OAuth (see auth-url), confirm that doctor reports ready_for_live_publish: true, then set TIKTOK_DRY_RUN=false. After that, the same five commands will act on the real Content Posting API.
For MCP configuration, stdio is the default; optional Streamable HTTP is enabled via the environment variables TIKTOK_MCP_HOST, TIKTOK_MCP_PORT, TIKTOK_MCP_TRANSPORT=http. The recommended first tools to call are tiktok_connection_status, tiktok_privacy_audit, tiktok_publish_video.
When configuring, copy .env.example to .env and fill in only the values you need. Do not commit .env, token files, or .agent-data/. Video inbox uploads can upload local files directly via TikTok's upload URL; photo and URL-pull workflows can use Supabase Storage or other public media hosting.
Applicable Scenarios
- An agent needs to publish or check TikTok content and does not want to use browser automation, hidden state, or token leakage.
- Automated publishing flows that require safe rehearsal and auditing before write operations.
- Agent runtimes using MCP clients such as Codex, Claude, Cursor, Hermes, OpenClaw.
Limitations
- Live publishing is disabled by default and is only enabled after setting TIKTOK_DRY_RUN=false.
- Tokens are read from environment variables or a local .env, and tool responses never contain token values.
- Uses the official TikTok API interface, does not automate browser sessions.
- For more information on fees, pricing, platform support scope, etc., the materials do not currently provide it.