Skip to content

Jaswir/Youtube_MCP_Tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Youtube Transcript MCP Tutorial

This MCP server uses FastMCP and the public youtube-transcript-api package to fetch YouTube video captions and return the full transcript as either plain text or SRT subtitles.

It supports:

  • Input: Full YouTube URL (e.g. https://www.youtube.com/watch?v=VIDEO_ID or https://youtu.be/VIDEO_ID)
  • Output: Full transcript as a single plain-text string
  • Behavior: Works only for videos with existing captions (manual or auto-generated)

1. Prerequisites

  • Python 3.11+
  • uv installed on your system

2. Install dependencies with uv

From the project root (/Users/jaswirraghoe/Documents/youtube_mcp):

cd /Users/jaswirraghoe/Documents/youtube_mcp
uv sync

This will install:

  • fastmcp — MCP server framework
  • youtube-transcript-api — public YouTube transcript API wrapper

3. Run the server

You can run the MCP server using uv:

cd /Users/jaswirraghoe/Documents/youtube_mcp
uv run youtube_mcp_server.py

This starts the MCP server defined in youtube_mcp_server.py.

4. Key Tools

YouTube Transcript Description
get_transcript_text Return the full transcript as plain text (captions concatenated in order)
get_transcript_srt Return the full transcript in SRT subtitle format

If the video has no captions, captions are disabled, or the video is unavailable,
the tools return a clear error message.

5. Example MCP client configuration (Claude Desktop)

In your claude_desktop_config.json (or equivalent), you can register this server as:

{
  "mcpServers": {
    "youtube-transcript": {
      "command": "/Users/jaswirraghoe/.local/bin/uv",
      "args": [
        "--directory",
        "/Users/jaswirraghoe/Documents/youtube_mcp",
        "run",
        "youtube_mcp_server.py"
      ]
    }
  }
}

After saving the config, restart your MCP client. You should then see a youtube-transcript server with get_transcript_text and get_transcript_srt tools that accept YouTube URLs and return the transcript as plain text or SRT.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages