How to get a YouTube transcript in Claude Code
Add the Subtext MCP server to Claude Code, sign in through /mcp, and ask Claude to fetch the transcript for a public YouTube video with captions. The server returns the caption text with timestamps so Claude can save it to your project or use it to write notes.
By Subtext
Connect Claude Code to the transcript server
Open a terminal in the project where you want to use transcripts. Run this command before starting Claude Code. It adds the server for that project on your machine.
claude mcp add --transport http subtext https://youtubevideototranscript.com/mcp
claude
- In Claude Code, enter
/mcpand select subtext. - Choose to authenticate and follow the link to sign in and approve access in your browser.
- Return to Claude Code and check that the server shows as connected in
/mcp.
Browser sign-in uses OAuth and connects Claude Code to your Subtext account. If you already use a Subtext API key, the reference has a configuration example for that method. Anthropic's MCP sign-in instructions ยท Subtext MCP reference
Fetch a transcript and keep the timestamps
Try the captioned video from the download guide and ask Claude to save the text in the current project.
Use Subtext's get_transcript tool once for
https://www.youtube.com/watch?v=arj7oStGLkU.
Request text format with timestamps enabled.
Save the returned text unchanged as transcript.txt.
If the call fails, report the tool error.
The TXT file should have a time marker at the start of each paragraph, such as [0:30]. Compare a passage with the same transcript in the browser. To get exact start times and durations for individual caption segments, request json. For subtitle files, request srt or vtt. Each successful transcript request uses one credit. Save the result if you plan to use it again. How credits work
To write a summary or turn the video into study notes, ask Claude to work from the saved file and include a timestamp for each point you want to check against the video.
Create a YouTube transcript skill for Claude Code
If you fetch transcripts often, save the instructions below to .claude/skills/youtube-transcript/SKILL.md in your project. The skill uses the MCP connection you just set up.
---
name: youtube-transcript
description: Fetch a timestamped YouTube transcript with Subtext.
disable-model-invocation: true
---
Call Subtext's get_transcript once for $ARGUMENTS.
Use text format with timestamps enabled.
Return the transcript text. If the call fails, report the tool error.
Run /youtube-transcript https://www.youtube.com/watch?v=arj7oStGLkU in Claude Code. Replace the example URL with the video you want. Anthropic's guide to Claude Code skills
If Claude Code cannot fetch the transcript
- The server is missing or needs sign-in. Start Claude Code from the project where you added the server, then check
/mcpand sign in if prompted. - The caption language is unavailable. Ask Claude to call
list_languagesfor the same video and retry with one of the returned codes. Listing languages uses no credits. - The video has no transcript. Check that the video is public and that its captions play in YouTube. The server reads existing caption tracks. See what to do when a YouTube transcript is missing.
- The account is out of credits. Check your account balance. For a one-off transcript, use the free browser tool.