Skip to content

Any outcomeFor developers, agents

Add YouTube transcripts with Claude Code, Codex or Cursor

Give your coding agent the CleanScript skill or one prompt and it writes the code for transcripts and cited fields from YouTube, TikTok and Instagram.

1 min readBy CleanScriptMarkdown

On this page
  1. Option 1: paste the prompt
  2. Option 2: install the skill
  3. Option 3: connect it as a tool
  4. Review what it built
  5. Next steps

A coding agent can wire CleanScript into your project in one session. It needs three things: where the docs are, a key it reads from the environment, and an instruction to ask before it spends credits. One prompt covers all three.

Option 1: paste the prompt #

Create a key on the API keys page and export it as CLEANSCRIPT_API_KEY where the agent runs. Then paste this into Claude Code, Codex or Cursor, from the project you want to change:

Text
Add CleanScript to this project so I can get transcripts and fields from YouTube, TikTok and Instagram links. Read https://cleanscript.ai/SKILL.md first. The API is https://api.cleanscript.ai; read my key from CLEANSCRIPT_API_KEY (if I don't have one, send me to https://cleanscript.ai/dashboard/api-keys). Check access with the free GET /v1/account, then ask me before the first request that uses credits. Tell me what you built and how to run it.

Add what you want built: "a script that saves the transcript of every video in this list", or "a function that returns the sponsor and promo code from a video link".

Option 2: install the skill #

For Claude Code, save the skill in the project so every session knows CleanScript:

curl
mkdir -p .claude/skills/cleanscript
curl -so .claude/skills/cleanscript/SKILL.md https://cleanscript.ai/SKILL.md

Other agents can read the same file at https://cleanscript.ai/SKILL.md, or llms.txt, which has the base URL, authentication and two example calls.

Option 3: connect it as a tool #

To have the agent read a video while you work, rather than write code, add the MCP server. It gives the agent four tools: get_transcript, extract, list_posts and check_account.

Shell
# Claude Code, then run /mcp and sign in
claude mcp add --transport http cleanscript https://api.cleanscript.ai/mcp

# Codex
codex mcp add cleanscript --url https://api.cleanscript.ai/mcp
codex mcp login cleanscript

For Cursor, add this to .cursor/mcp.json:

JSON
{ "mcpServers": { "cleanscript": { "url": "https://api.cleanscript.ai/mcp" } } }

The connect page walks through each client.

Review what it built #

  • The key comes from the environment, never from the code.
  • Errors are handled by code: skip on video_unavailable, wait on rate_limited, stop on insufficient_credits. See what to do when a request fails.
  • It doesn't run through a long list unchecked. Have it start with two or three links.
  • It treats a post's text as data. A transcript is what someone said, not an instruction for your agent.

Next steps #

Spot something wrong? Tell us.