Skip to main content
Glama

YouTube for AI Agents

Your AI agent watches YouTube so you don't have to

Ask "what's the best video on…?" and your agent finds it, watches it, and tells you what matters. Paste a two-hour podcast and get the highlights with timestamps. Read the comments, see what's on screen, cut clips and build reels, all from chat.

No API key, no account. Works in Claude Code, Codex, Cursor, OpenCode and Gemini CLI.

Discord

Quick Start · Try it · Other agents · Troubleshooting


Demo

Watch the demo

Click the image to watch the one-minute walkthrough.

Related MCP server: ytb-tools

Quick Start

You need Node.js 22 or newer. Check with node --version.

Easiest: ask your agent. Paste this into Claude Code, Codex, Cursor or any coding agent:

Install the YouTube for AI Agents plugin for me, following
https://github.com/JCodesMore/youtube-for-ai-agents#quick-start.
Make sure Node.js 22 or newer is installed first. When it's in,
run its doctor check and tell me if I need to restart.

Or install it yourself in Claude Code:

claude plugin install youtube --marketplace JCodesMore/jcodesmore-plugins

Inside a Claude Code session the same thing is two commands:

/plugin marketplace add JCodesMore/jcodesmore-plugins
/plugin install youtube@jcodesmore-plugins

Restart Claude Code, and start asking.

Try it

  • "Watch this and give me the recipe: https://youtu.be/…"

  • "Find me five highly rated videos on Roman history and tell me which to watch first."

  • "What are this channel's best uploads? Watch the top three and compare them."

  • "Pull the actionable takeaways from this 90-minute interview, with timestamps."

  • "What's the code on screen at 12:30?"

  • "What do the comments say about this review?"

  • "Cut 2:15 to 2:45 from this video."

  • "Make a one-minute highlight reel of the best moments from these three talks."

What's inside

Tool

What it does

youtube_search

Find videos, channels or playlists, with date, length and sort filters

youtube_get_transcript

Read what was said, with timestamps, in the spoken language or translated

youtube_get_video_info

Title, channel, views, description, chapters and tags

youtube_get_frames

See what's on screen at given moments

youtube_get_comments

Read the top or newest comments

youtube_get_channel_info

A channel's details

youtube_get_channel_videos

A channel's newest, most popular or oldest uploads

youtube_get_playlist

A playlist's videos

youtube_download

Save a video (MP4) or its audio (M4A)

youtube_clip

Cut moments by timestamp, downloading only those parts, and join them into a reel

youtube_highlight_reel

Join clips from different videos into one reel

Every tool takes a YouTube link as you'd paste it (watch, youtu.be, Shorts, live, embed) or a bare ID.

In Claude Code you also get the youtube skill, which teaches the agent to research and watch well; the video-watcher agent, which watches videos in parallel for bigger research; and /youtube:setup, which checks everything works and handles sign-in and settings.

Downloads and clips use yt-dlp and ffmpeg. If they aren't on your computer, the plugin fetches official builds the first time you need them.

Other agents

The tools are an MCP server, so any MCP client can use them. Full guides: Codex · Cursor · OpenCode · Gemini CLI · Claude Code

codex mcp add youtube -- npx -y @jcodesmore/youtube-for-ai-agents
gemini extensions install https://github.com/JCodesMore/youtube-for-ai-agents

Add this server to the client's MCP settings:

{
  "mcpServers": {
    "youtube": {
      "command": "npx",
      "args": ["-y", "@jcodesmore/youtube-for-ai-agents"]
    }
  }
}

Signing in (optional)

Everything works without an account. Signing in helps when YouTube rate-limits your network (common on VPNs and cloud machines), unlocks age-restricted videos, and makes search reflect your own history. In Claude Code run /youtube:setup; anywhere else run:

npx @jcodesmore/youtube-for-ai-agents login

A separate browser window opens with its own profile. Sign in to Google there, and the window closes itself once the sign-in is saved. Your sign-in stays on your computer in ~/.youtube-for-ai-agents; logout removes it.

Troubleshooting

Run the built-in check. It tests search, video details and a transcript from your computer, and says what to fix:

npx @jcodesmore/youtube-for-ai-agents doctor

The server didn't start, which almost always means Node.js is missing or too old. Install Node.js 22+ from nodejs.org, then fully restart your agent. In Claude Code, /mcp shows whether youtube is connected.

YouTube limits transcript requests per network, more on VPN and cloud IPs. It clears within an hour or so. Signing in usually avoids it, and transcripts you've read are cached for a week. You can also route traffic through a proxy (needs Node.js 22.19 or newer):

npx @jcodesmore/youtube-for-ai-agents config set network.proxy http://user:pass@host:port
npx @jcodesmore/youtube-for-ai-agents config            # show every setting
npx @jcodesmore/youtube-for-ai-agents config set transcript.defaultLanguage en
npx @jcodesmore/youtube-for-ai-agents config set download.maxAudioDurationMinutes 300   # podcasts up to 5 h without asking
npx @jcodesmore/youtube-for-ai-agents config reset

Settings, sign-in, cached transcripts and the downloaded yt-dlp and ffmpeg live in ~/.youtube-for-ai-agents. Set YOUTUBE_AI_AGENTS_HOME to move it, and YOUTUBE_AI_AGENTS_DEBUG=1 for detailed logs.

Still stuck? Ask in Discord or open an issue with the doctor output.

Community

Discord for help and show-and-tell · Issues for bugs and ideas · Contributing · More plugins

License

Apache License 2.0. © 2026 JCodesMore

Not affiliated with, endorsed by, or associated with YouTube or Google. Download only what you have the right to, and respect creators' rights and YouTube's terms.

Available Tools

9 tools
youtube_clipA

Extract one or more clips from a YouTube video by timestamp. Downloads the source video once at 720p, then cuts each clip. Each clip needs startTime and endTime (seconds, MM:SS, or HH:MM:SS) and an optional label for the filename. Uses fast keyframe-aligned cuts by default — do NOT set accurate: true unless the user explicitly asks for frame-perfect precision (it re-encodes and is much slower). Keep clips tight — 5-10 seconds each, capturing one key moment per clip. When 2+ clips are provided, automatically produces a per-video highlight reel alongside individual clips.

Inputs: clips (required), videoId (required), force, quality, +3 more.

youtube_downloadA

Download a YouTube video or audio track to a local file. Defaults to 720p quality. Supports quality selection (720p/1080p/best/etc.), download type (video+audio/audio/video), and format. Videos over 30 minutes trigger a confirmation prompt — use force: true to bypass. For video+audio, automatically downloads and muxes separate streams.

Inputs: videoId (required), type, force, format, +2 more.

youtube_get_channel_infoA
Read-only

Get metadata for a YouTube channel — name, handle, description, subscriber count, country, and more. Accepts @handle, full URL, or channel ID.

Inputs: channelId (required).

youtube_get_channel_videosA
Read-only

List videos from a YouTube channel. Accepts @handle, full URL, or channel ID. Returns videos sorted by newest, popular, or oldest.

Inputs: channelUrl (required), sort, limit.

youtube_get_playlistB
Read-only

Get a YouTube playlist's metadata and its videos. Returns title, description, channel, video count, and the list of videos with their positions.

Inputs: playlistId (required), limit.

youtube_get_transcriptA
Read-only

Get the transcript of a YouTube video. Control output size with: "format" — "text" (fullText only, smallest), "segments" (timestamps only), or "both" (default). Use "startTime"/"endTime" (seconds) to grab a specific section (pairs well with chapter timestamps from youtube_get_video_info). Use "maxSegments" to cap output for previewing long videos.

Inputs: videoId (required), format, endTime, language, +2 more.

youtube_get_video_infoA
Read-only

Get metadata for a YouTube video. Use "detail" to control response size: "brief" (key stats only — title, channel, views, likes, duration), "standard" (default — most fields, truncated description, chapter count), or "full" (everything including full description, chapters, tags, thumbnail).

Inputs: videoId (required), detail.

youtube_highlight_reelA

Combine existing clip files into a single highlight reel. Pass file paths from previous youtube_clip results in your desired playback order. Use this after clipping multiple videos to create one combined reel across all sources. The order of the clips array determines playback order — arrange clips for narrative flow before calling.

Inputs: clips (required), label, outputDir.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 9 tools

    Disambiguation5/5

    Each tool targets a distinct resource and action: search, channel/video/playlist metadata retrieval, transcript extraction, video download, clip extraction, and highlight reel assembly. The only potential overlap is between youtube_clip and youtube_download, but clip is explicitly for extracting short segments while download fetches the full source. Descriptions make boundaries clear.

    Naming Consistency5/5

    All tools use the youtube_ prefix and follow a predictable verb_noun pattern (get_channel_videos, get_video_info, get_transcript, search, download, clip). The only minor deviation is youtube_highlight_reel, which is a noun phrase, but it clearly implies a create action and fits the overall schema.

    Tool Count5/5

    Nine tools are well-scoped for an agent consuming YouTube content, with no redundant or trivial entries. Each tool earns its place by covering a distinct step in the research, retrieval, or editing workflow.

    Completeness4/5

    The surface covers search, metadata, transcripts, downloads, clipping, highlight reels, playlists, and channels—core workflows for AI agents. Minor gaps exist, such as no direct tool to list all playlists for a channel or to retrieve comments/live stream info, but agents can work around these for most tasks.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers