Agent access

Make StoryTok videos from your coding agent

One package, storytok, gives Claude Code, Claude Desktop, Cursor, Windsurf and Codex an MCP server, and gives every other agent a CLI and a skill file. You ask for a video in plain English. The agent writes the script, picks a voice and background from the catalog, shows you the cost in credits, renders it on StoryTok and saves the MP4 into your folder.

It spends the same credits as the app: 1 per rendered minute, 2 with premium voices, from the 3 free trial minutes onward. No plan, no OAuth setup, nothing to host. StoryTok does not post the video anywhere; you do.

Install

Get a key under Settings, Developer API, then paste the line for your client. Replace stk_live_… with the key.

Claude Code

Anthropic's terminal agent. One command, then talk.

claude mcp add storytok -e STORYTOK_API_KEY=stk_live_… -- npx -y github:juanditb/storytok-agent mcp

Codex

~/.codex/config.toml

[mcp_servers.storytok]
command = "npx"
args = ["-y", "github:juanditb/storytok-agent", "mcp"]
env = { STORYTOK_API_KEY = "stk_live_…" }

Cursor

Cursor → Settings → MCP → Add new server (or .cursor/mcp.json)

{
  "mcpServers": {
    "storytok": {
      "command": "npx",
      "args": [
        "-y",
        "github:juanditb/storytok-agent",
        "mcp"
      ],
      "env": {
        "STORYTOK_API_KEY": "stk_live_…"
      }
    }
  }
}

Claude Desktop

Claude Desktop → Settings → Developer → Edit Config

{
  "mcpServers": {
    "storytok": {
      "command": "npx",
      "args": [
        "-y",
        "github:juanditb/storytok-agent",
        "mcp"
      ],
      "env": {
        "STORYTOK_API_KEY": "stk_live_…"
      }
    }
  }
}

Windsurf

~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "storytok": {
      "command": "npx",
      "args": [
        "-y",
        "github:juanditb/storytok-agent",
        "mcp"
      ],
      "env": {
        "STORYTOK_API_KEY": "stk_live_…"
      }
    }
  }
}

Any shell or agent

The CLI works anywhere Node runs, and ships a skill file for agents without MCP.

export STORYTOK_API_KEY=stk_live_…
npx -y github:juanditb/storytok-agent story --title "…" --script-file story.txt --background "Minecraft 4.mp4" --wait --out .

Or skip the key: storytok login

If you would rather not copy a key, run the login command. It prints a short code and a link; approve it in the browser while signed in to StoryTok, and the CLI stores a fresh key for that machine. The MCP server picks the stored key up automatically when STORYTOK_API_KEY is not set.

$ npx -y github:juanditb/storytok-agent login
Open https://storytok.ai/connect?code=K7QD4M2X
and approve code K7QD-4M2X (expires in 10 min). Waiting…
Connected as "Claude Code (2026-09-08)". Key saved to your config; STORYTOK_API_KEY overrides it if set.

What the agent can do

ToolWhat it does
get_accountBalance, the key's daily cap and what is left of it, pricing rules
get_catalogValid voice ids (with the premium flag), caption presets, chat themes, backgrounds, music and highlight types
import_reddit_postA Reddit URL to a title, the post body as a script, and the stats for the intro card
create_story_videoA narrated story over gameplay, with an optional Reddit-style intro card
create_texting_storyChat bubbles revealed one by one in a phone theme, a voice per side
create_captions_videoUploads a local video and burns in word-timed captions
create_splitscreen_videoYour clip over gameplay, or the streamer layout that cuts a facecam out of a VOD
create_highlights1 to 20 AI-picked clips from a long recording, each scored with a hook line
get_job / wait_for_jobStatus, stage and charge; wait_for_job blocks until the render finishes
download_jobSaves the MP4 (or every clip plus the zip) into a folder on your machine
list_jobsRecent jobs, filterable by status and type

The CLI mirrors the same list: story, text, captions, splitscreen, highlights, estimate, reddit, job, wait, download, jobs. Run npx -y github:juanditb/storytok-agent --help for every flag.

The confirm-cost rule, and the daily cap

Every creating tool is two-phase. Called without confirm it returns an estimate: minutes, credits, your balance, and whether you are short. Only a second call with confirm: true reserves credits and queues the render. The tool descriptions instruct the agent to show you the estimate and wait for a yes, so a sensible agent will not spend on its own. On the CLI the same rule is the --yes flag: without it the command prints the estimate and exits with code 3.

Two more guards sit underneath. Job creation sends an idempotency key derived from the inputs, so a retried call returns the job it already made instead of rendering twice. And every API key carries a rolling 24-hour credit cap, 30 credits by default, which you can change per key under Settings, Developer API. If a render fails for any reason the reservation is refunded automatically.

Three example conversations

A Reddit story from a URL

youTurn https://www.reddit.com/r/tifu/comments/… into a video. GTA footage, Hormozi captions.
agentimport_reddit_post: "TIFU by replying-all to the whole company", 412 words, 3.1k upvotes.
agentI rewrote it as a 140-word first-person script in original wording, not the post verbatim. Voice Matthew, background GTA 1, preset hormozi, intro card on.
agentcreate_story_video estimate: about 55 s, 1 credit. Balance 3. Render it?
youyes
agentcreate_story_video (confirm): job 8f3a… queued. wait_for_job: completed in 96 s, 1 credit charged.
agentdownload_job: ./tifu-reply-all.mp4

A texting story from a premise

youWrite a texting story where my sister texts that she's marrying my ex, then render it.
agentDrafted 22 messages with long pauses before the two reveals. Contact "Sis", iMessage dark, Joanna for her and Matthew for you, Subway Surfers 2 underneath.
agentcreate_texting_story estimate: about 70 s, 2 credits. Balance 3. Go ahead?
youmake it shorter, 1 credit
agentCut to 15 messages. create_texting_story estimate: about 48 s, 1 credit. Go ahead?
youyes
agentwait_for_job: completed. download_job: ./sister-texts.mp4

Captions on a local file

youCaption ./raw/interview.mp4 with the karaoke preset and save it next to it.
agentffprobe says 2 min 14 s. create_captions_video estimate: 3 credits, billed on the source length and settled before rendering. Balance 3. Upload and render?
youyes
agentUploaded 84 MB straight to storage. wait_for_job: completed. download_job: ./raw/interview-captioned.mp4

Troubleshooting

no_api_key
No key in STORYTOK_API_KEY or ~/.config/storytok/config.json. Run npx -y github:juanditb/storytok-agent login, or put the key in your MCP config as shown above.
insufficient_credits (402)
The estimate is larger than your balance. The tool refuses to confirm and nothing is charged. Shorten the script, or add a pack at /pricing.
too_many_active_jobs (429)
Three renders are already running on your account. Wait for one to finish (wait_for_job), then retry.
daily_cap_reached (429)
This key has reserved its 24-hour cap, 30 credits by default. Raise it under Settings, Developer API, or wait for the window to roll.
idempotent_replay
Identical inputs rendered recently, so that job was returned instead of a second charge. Pass fresh: true (MCP) or --fresh (CLI) to force a new render.
not_confirmed (CLI exit code 3)
The command printed the estimate and stopped because --yes was not passed. Show the estimate, get a yes, then re-run with --yes.

Questions

Do I need a paid plan to use StoryTok from Claude Code?

No. A key works on any account and spends the same credits as the app. New accounts get 3 free trial minutes, which is enough for the first two or three videos. After that, packs start at $5 for 20 minutes and never expire.

Can the agent spend credits without asking me?

Not by design. Every creating tool is two-phase: called without confirm it only returns the estimate, and the tool description tells the agent to show you the cost and wait for a yes. On top of that, each key has a rolling 24-hour credit cap, 30 by default, that you can lower or raise under Settings, Developer API. Failed renders refund themselves.

Does it post the video to TikTok for me?

No. The agent downloads the finished MP4 into a folder on your machine and you post it yourself. StoryTok does not connect to social accounts.

Which agents and editors are supported?

Claude Code, Claude Desktop, Cursor, Windsurf and Codex through the MCP server (npx -y github:juanditb/storytok-agent mcp). Any other agent or shell can use the CLI, and the package ships a skill file that teaches agents without MCP how to drive it.

Do Crayo or AutoShorts have something like this?

Not as of September 2026. Crayo has a REST API that needs a paid plan and no MCP server or agent integration; AutoShorts has none we could find. Of the Reddit-story and texting-story tools we checked (Crayo, AutoShorts, Faceless.so), StoryTok is the one an agent can drive, on pay-per-minute credits, with a local option that needs no OAuth server and works on the free trial. Revid and OpusClip offer hosted MCP servers on their own plans.

Building something that is not an agent? The raw REST API, job schema and webhook signing are documented at /developers. The package is open source at github.com/juanditb/storytok-agent.