Skip to content

A minimal MCP server to fetch YouTube video transcripts and stream them directly to your LLM client for seamless integration and prompt engineering workflows.

Notifications You must be signed in to change notification settings

yug-space/youtube_video_mcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YouTube Transcript MCP Server

This is a Model Control Protocol (MCP) server that provides a tool to fetch transcripts from YouTube videos.

Features

  • Extracts video ID from any valid YouTube URL
  • Returns plain-text transcripts (without timestamps)
  • Uses the youtube-transcript-api library

Installation

# Install dependencies
pip install youtube-transcript-api "mcp[fastmcp]"

Usage

Run the server:

python main.py

The server exposes a single tool:

  • get_transcript: Takes a YouTube URL and returns the video ID and transcript

Example

Using the MCP client:

from mcp.client import Client

client = Client(transport="stdio")
response = client.call("get_transcript", {"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"})
print(f"Video ID: {response['video_id']}")
print(f"Transcript: {response['transcript'][:100]}...")  # First 100 chars

Error Handling

The server handles these error cases:

  • Invalid YouTube URLs
  • Videos without available transcripts

About

A minimal MCP server to fetch YouTube video transcripts and stream them directly to your LLM client for seamless integration and prompt engineering workflows.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages