Prompt
Take recordings/cli-init.mp4 (22 seconds, vertical). Write a TikTok caption for developers about the new init command: a hook, what it sets up, and 4 hashtags. It is over 8 MB, so upload it with curl to /v1/media, then call draft_post with the id in mediaIds. How to do it
- Connect TikTok and mint a key In https://app.socialhandoff.com, open Connections, connect TikTok, then open TikTok settings on the account and choose visibility, comment/duet/stitch, and commercial disclosure. Then create an agent key named Claude Code scoped to TikTok with draft and schedule permission.
- Register the server with claude mcp add Export the key as SOCIAL_AGENT_KEY, then run claude mcp add with the HTTP transport, the URL https://app.socialhandoff.com/mcp, and an Authorization: Bearer header that reads the variable.
- Attach media from the workspace Claude Code calls attach_media for the video or up to 35 photos: a public url, or the file as base64 data (up to 8 MB) with its mime type and alt text. Larger files go to POST https://app.socialhandoff.com/v1/media as multipart. The ids go into draft_post as mediaIds.
- Ask for the draft Give Claude Code the prompt. It writes the caption, shows the curl upload for your review, then calls draft_post with the returned id.
- Approve with the consent text The approval screen shows the visibility and interaction settings chosen in Connections and TikTok's consent text. Approve, and it publishes; a video is sent to TikTok in chunks.
Example draft
One command. Whole project set up. init now creates the config, the CI workflow, and a first test, so you can push in under a minute. #coding #developer #cli #programming [Video: recordings/cli-init.mp4, 22-second vertical terminal recording]
Gotchas
- Record vertical. A landscape terminal capture still posts, but on TikTok it shows letterboxed with most of the screen empty.
- Until TikTok audits your developer app, every post is private (visible only to the account), the posting account must be private, and only 5 accounts can post per day.
- For a file over 8 MB, Claude Code falls back to curl with your shell's permissions. Keep the key in an environment variable so it never lands in a committed script or shell history.
- Visibility has no default. Posts are refused until the owner picks it in TikTok settings under Connections, along with comment, duet, and stitch.
- Media: Every post needs one video or up to 35 photos. Text-only posts are not possible.
- Video upload: Videos upload in chunks of 5 to 64 MB; smaller files go in one piece. Maximum duration depends on the creator account.
- Photo posts: Up to 35 JPEG or WebP images, a title up to 90 characters, and a description up to 4,000 characters.
- Required choices: TikTok requires a visibility setting with no default, comment/duet/stitch toggles, and a commercial content disclosure.
Frequently asked questions
Where do I choose who can see the video?
In Connections, TikTok settings reads the creator's live options and asks for visibility, comment, duet, stitch, and commercial content disclosure. Those choices apply to every post from that account.
Does Claude Code need the stdio server?
No. It connects over streamable HTTP with claude mcp add. The stdio package with npx also works if you prefer a local process.
What does the reviewer see before approving?
The approval screen shows the caption, the media, the account's chosen settings, and TikTok's consent text, so the person approving knows exactly what will be posted.