Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
6,000+ web scrapers for your AI agent, start free logo6,000+ web scrapers for your AI agent, start free

Apify gives your agent live web data: 6,000+ prebuilt scrapers and actors, MCP-ready. Sign up free with $5 in usage credits.

Try Apify free
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 48,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

Enables LLMs to interact with YouTube videos by fetching transcripts, summarizing content, and answering questions based on video context.

README.md

YouTube MCP Server

A production-quality Model Context Protocol (MCP) server that empowers LLMs to seamlessly interact with YouTube videos. This server exposes tools to fetch video transcripts, actively summarize videos, and accurately answer questions based on the video context.

🌟 Features

  • Fetch Transcripts: Extracts subtitles intelligently, translating generated transcripts to English if necessary.
  • Smart Summarization: Chunks large videos into smaller segments to bypass LLM context limit bottlenecks automatically.
  • Q&A System: Query specific details from massive YouTube videos directly.
  • Fast Performance: Transcripts are temporarily cached in memory. Async architecture scaling cleanly.
  • Resilience: Integrated exponential backoff and retry mechanism for LLM API calls using tenacity.

📁 Project Structure

youtube_mcp_server/
├── server.py        # Initializes MCP server and exposes tool endpoints
├── tools.py         # The core logic mapping transcript APIs to caching and chunking
├── utils.py         # URL extraction, text cleaning, and chunking utility functions
├── llm.py           # The LLM engine wrapper managing API requests and retries
├── requirements.txt # Project pip dependencies
└── README.md        # Documentation

🚀 Installation

  1. Clone or navigate to this folder.
  2. It's recommended to create a Python virtual environment:
   python3 -m venv venv
   source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
   pip install -r requirements.txt

🔑 Configuration

You must set up your OpenAI API key for summarize_video and ask_video to function.

export OPENAI_API_KEY="your-api-key-here"
# Optional: Set a specific model (defaults to gpt-4o-mini)
export LLM_MODEL="gpt-4o"

🎮 How to Run

Because this is an MCP server, it is meant to communicate via standard input/output (stdio) with an MCP Client (such as Claude Desktop, Cursor, or an intelligent agent).

You can run it manually to see it start to listen on stdio: ``bash python server.py ``

🤝 Connecting from an MCP Client (Example: Claude Desktop)

To use this server inside Claude Desktop, add it to your claude_desktop_config.json:

{
  "mcpServers": {
    "youtube_server": {
      "command": "/path/to/your/venv/bin/python",
      "args": ["/path/to/youtube_mcp_server/server.py"],
      "env": {
        "OPENAI_API_KEY": "your-api-key-here"
      }
    }
  }
}

📋 Example Tool Usage (Client Perspective)

Once connected, your LLM context will see three available tools:

1. get_transcript(video_url="https://youtube.com/watch?v=XXXX")

  • LLM use case: "Retrieve the script for this video so I can parse a recipe."

2. summarize_video(video_url="https://youtu.be/XXXX")

  • LLM use case: "Can you give me a summary of Marques Brownlee's latest review?"

3. ask_video(video_url="https://youtube.com/watch?v=XXXX", question="What was the score they mentioned?")

  • LLM use case: "From the meeting recording link, what were the Q3 metrics discussed?"

Example Tool Responses

Summarize Video Response: > "The video discusses the release of the new MacBook Pro M4. Key points include: > 1. Performance upgrades with the M4 chip over the previous generation. > 2. The introduction of the new Nano-texture display. > 3. Improvements in battery life averaging 20 hours. > The presenter concludes that it is a solid upgrade for M1 users, but M3 users can hold off."

Ask Video Response: > "Based on the video transcript, the presenter stated that the starting price for the base model is $1,599."

🛠 Troubleshooting

  • No module named 'mcp': Make sure you have installed the requirements pip install -r requirements.txt.
  • Transcripts Disabled: Some creators disable transcripts on their YouTube videos. The server elegantly catches this and returns a clear text Error instead of crashing the server.
  • LLM Fails to Output (API Key missing): If OPENAI_API_KEY is not provided in the environment variables where the MCP server is initialized, the server's summarise and QA tool executions will yield an error message indicating the problem.

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Browser & Scraping servers.