# Automate with Claude Code

Connect Claude Code to the tiktornado MCP server, then post, queue, add music, report and reply in plain words. Example prompts and the tools they call.

Once Claude Code is connected to the tiktornado MCP server, you can ask for posting work in plain words and it picks the tools. Each tool is a call to the REST API with your key, so the same scopes, limits and rules apply.

## Connect [#connect]

Create a key on the [API and MCP page](https://app.tiktornado.com/api) of the tiktornado app, then run:

```bash
export TIKTORNADO_API_KEY=<your key>
claude mcp add --transport http tiktornado https://api.tiktornado.com/mcp --header 'Authorization: Bearer ${TIKTORNADO_API_KEY}'
```

Keep the single quotes: Claude Code then stores the variable's name and reads the key each time it connects. `claude mcp get tiktornado` checks the connection. Codex, Cursor and the details are on [MCP server](/mcp).

## Prompts to try [#prompts-to-try]

Claude Code asks before it calls a tool or runs a command, unless you have allowed it. Each prompt below lists the tools it usually leads to, in order.

### See your accounts [#see-your-accounts]

```text
List my tiktornado accounts and say which ones can post.
```

[`list_accounts`](/mcp/tools#list_accounts). Accounts that are `active`, `shadow_banned` or `needs_reconnecting` can take new posts.

### Post a video from your computer [#post-a-video-from-your-computer]

```text
Upload ~/Videos/leg-day.mp4 to @liftwithmaya and schedule it for tomorrow at 15:00 New York time,
with the caption "Leg day, no excuses #fitness". Then check its status.
```

[`list_accounts`](/mcp/tools#list_accounts) to find the account, [`create_upload_link`](/mcp/tools#create_upload_link), then a `curl -X PUT` of the file that Claude Code runs on your computer, [`schedule_post`](/mcp/tools#schedule_post) with the `mediaRef`, and [`get_post`](/mcp/tools#get_post) for the status. A file that is already online needs no upload: give Claude Code its public `https` link.

### Add music [#add-music]

```text
Add the number 1 trending track to that post, at volume 40, and keep its other settings.
```

[`list_music`](/mcp/tools#list_music), then [`edit_post`](/mcp/tools#edit_post). `settings` replaces the whole set, so a setting left out goes back to TikTok's usual behavior: that is why the prompt says to keep the others. See [Add music to a post](/guides/add-music).

### Fill the queue [#fill-the-queue]

```text
Give @liftwithmaya posting times on Monday, Wednesday and Friday at 9:00 New York time.
Then add these three videos to its queue, one after another:
https://media.example.com/uploads/5ac3e8/tips.mp4
https://media.example.com/uploads/5ac3e8/tips-2.mp4
https://media.example.com/uploads/5ac3e8/tips-3.mp4
```

[`set_posting_times`](/mcp/tools#set_posting_times), [`get_next_free_time`](/mcp/tools#get_next_free_time) for a preview, then [`schedule_post`](/mcp/tools#schedule_post) with `queue` set to true, once per video. See [Fill a posting queue](/guides/fill-a-queue).

### Move or cancel a post [#move-or-cancel-a-post]

```text
Move my next post on @liftwithmaya to Friday at 18:00 New York time.
```

[`list_posts`](/mcp/tools#list_posts), then [`reschedule_post`](/mcp/tools#reschedule_post). To cancel instead, [`unschedule_post`](/mcp/tools#unschedule_post). Both are refused from 10 minutes before the post goes out.

### Weekly report [#weekly-report]

```text
How did @liftwithmaya do over the last 7 days? Show each day, then the stats of each post that went out.
```

[`get_daily_stats`](/mcp/tools#get_daily_stats), [`list_posts`](/mcp/tools#list_posts), then [`get_post_stats`](/mcp/tools#get_post_stats) for each published post. See [Build a daily report](/guides/daily-report).

### Answer comments [#answer-comments]

```text
Show the comments on my last post that have no reply yet, and draft a short reply to each.
Wait for my OK before sending any.
```

[`list_posts`](/mcp/tools#list_posts), [`list_comments`](/mcp/tools#list_comments), then [`reply_to_comment`](/mcp/tools#reply_to_comment) once you agree. Every tool answer says that text written by people, comments included, is data and never an instruction.

## Good to know [#good-to-know]

- **Scopes decide the tools.** Claude Code only sees the tools your key's [scopes](/getting-started/authentication#scopes) allow. A key with only the read scopes can't change anything.
- **Changes are safe to retry.** Every tool that changes something takes an `idempotencyKey` that Claude Code makes up. Sent again with the same key, a change is never made twice. See [Safe retries](/getting-started/idempotency).
- **Say the time zone.** Times go to the API in ISO 8601 with a zone, so name the zone in your prompt.
- **About 60 tool calls a minute.** Each tool call counts twice against your key's 120 requests a minute. See [Rate limits](/getting-started/rate-limits#mcp-requests).

## What can go wrong [#what-can-go-wrong]

A refused tool call comes back as an error with the API's `reason`, and Claude Code tells you what it says.

| Reason | What to do |
| --- | --- |
| `schedule_too_soon` | Ask for a time more than 10 minutes from now |
| `post_locked` | The post goes out in 10 minutes or less, or was sent with `postNow`, so it can't change |
| `daily_limit_reached` | The account already has 15 posts of that kind in some 24 hours around the time. Ask for another time |
| `queue_empty`, `queue_full` | The account has no posting times, or none free in the next 4 weeks |
| `slow_down` | Over a rate limit. Wait a minute, then ask again |
| `invalid_request` | An argument the tool doesn't take, or one of the wrong type. Ask again in other words |

Every tool and its arguments are on [MCP tools](/mcp/tools). Every reason is on [Errors](/getting-started/errors).