YouTube Transcript Server

内容与创意

by sinco-lab

Retrieve transcripts and subtitles from YouTube videos effortlessly. Analyze content with support for multiple languages and detailed metadata, enhancing your video processing workflows.

什么是 YouTube Transcript Server

Retrieve transcripts and subtitles from YouTube videos effortlessly. Analyze content with support for multiple languages and detailed metadata, enhancing your video processing workflows.

核心功能 (1 个工具)

get_transcripts

Extract and process transcripts from a YouTube video. **Parameters:** - `url` (string, required): YouTube video URL or ID. - `lang` (string, optional, default 'en'): Language code for transcripts (e.g. 'en', 'uk', 'ja', 'ru', 'zh'). - `enableParagraphs` (boolean, optional, default false): Enable automatic paragraph breaks. **IMPORTANT:** If the user does *not* specify a language *code*, **DO NOT** include the `lang` parameter in the tool call. Do not guess the language or use parts of the user query as the language code.

README

MCP YouTube Transcript Server

A TypeScript Model Context Protocol server that retrieves YouTube transcripts for Claude Desktop, Cursor, Cline, Codex, and other MCP-compatible clients. It is designed for local npx usage so transcript requests are made from your own machine instead of a remote proxy.

npm version npm downloads GitHub stars License: MIT

<a href="https://glama.ai/mcp/servers/@sinco-lab/mcp-youtube-transcript"> <img width="380" height="200" src="https://glama.ai/mcp/servers/@sinco-lab/mcp-youtube-transcript/badge" alt="mcp-youtube-transcript" /> </a>

Table of Contents

Features

Key capabilities:

  • Extract transcripts from YouTube videos
  • Support for multiple languages
  • Android InnerTube fallback for current YouTube caption responses
  • Compatible tool names: get_transcripts and get_transcript
  • Timestamped transcript output with get_timed_transcript
  • Video metadata and available transcript languages
  • Format text with continuous or paragraph mode
  • Retrieve video titles and metadata
  • Automatic paragraph segmentation
  • Text normalization and HTML entity decoding
  • Robust error handling
  • Timestamp and overlap detection

Getting Started

Prerequisites

  • Node.js 18 or higher

Installation

Use a local npx configuration so transcript requests are sent from your own machine instead of a remote MCP proxy.

  1. Create or edit the Claude Desktop configuration file:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  2. Add the following configuration:

json
{
  "mcpServers": {
    "youtube-transcript": {
      "command": "npx",
      "args": [
        "-y",
        "@sinco-lab/mcp-youtube-transcript"
      ]
    }
  }
}

Quick setup script for macOS:

bash
# Create directory if it doesn't exist
mkdir -p ~/Library/Application\ Support/Claude

# Create or update config file
cat > ~/Library/Application\ Support/Claude/claude_desktop_config.json << 'EOL'
{
  "mcpServers": {
    "youtube-transcript": {
      "command": "npx",
      "args": [
        "-y",
        "@sinco-lab/mcp-youtube-transcript"
      ]
    }
  }
}
EOL

Usage

Basic Configuration

To use with Claude Desktop / Cursor / cline, ensure your configuration matches:

json
{
  "mcpServers": {
    "youtube-transcript": {
      "command": "npx",
      "args": ["-y", "@sinco-lab/mcp-youtube-transcript"]
    }
  }
}

Docker

The repository includes a production Dockerfile for local container usage:

bash
docker build -t mcp-youtube-transcript .

MCP client configuration:

json
{
  "mcpServers": {
    "youtube-transcript": {
      "command": "docker",
      "args": ["run", "--rm", "-i", "mcp-youtube-transcript"]
    }
  }
}

Testing

With Claude App

  1. Restart the Claude app after installation
  2. Test with a simple command:
    plaintext
    https://www.youtube.com/watch?v=AJpK3YTTKZ4 Summarize this video
    

Example output: Demo

With MCP Inspector

bash
# Clone and setup
git clone https://github.com/sinco-lab/mcp-youtube-transcript.git
cd mcp-youtube-transcript
npm install
npm run build

# Launch inspector
npx @modelcontextprotocol/inspector node "dist/index.js"

# Access http://localhost:6274 and try these commands:
# 1. List Tools: clink `List Tools`
# 2. Test get_transcripts with:
#    url: "https://www.youtube.com/watch?v=AJpK3YTTKZ4"
#    lang: "en" (optional; omit to use the best available caption track)
#    enableParagraphs: false (optional)

Troubleshooting and Maintenance

Checking Claude Logs

To monitor Claude's logs, you can use the following command:

bash
tail -n 20 -f ~/Library/Logs/Claude/mcp*.log

This will display the last 20 lines of the log file and continue to show new entries as they are added.

Note: Claude app automatically prefixes MCP server log files with mcp-server-. For example, our server's logs will be written to mcp-server-youtube-transcript.log.

Cleaning the npx Cache

If you encounter issues related to the npx cache, you can manually clean it using:

bash
rm -rf ~/.npm/_npx

This will remove the cached packages and allow you to start fresh.

Tools

get_transcripts

Fetches transcript text from a YouTube video.

Parameters:

  • url (string, required): YouTube video URL or ID
  • lang (string, optional): Language code. If omitted, the best available caption track is used.
  • enableParagraphs (boolean, optional): Enable paragraph mode. Default: false.

get_transcript

Alias of get_transcripts for compatibility with other YouTube transcript MCP servers.

get_timed_transcript

Fetches transcript text with one timestamped line per caption segment.

Parameters:

  • url (string, required): YouTube video URL or ID
  • lang (string, optional): Language code. If omitted, the best available caption track is used.

Example output:

text
[00:00:01.250] Hello and welcome
[00:00:03.500] Today we are going to...

get_video_info

Fetches basic video metadata and available transcript languages without returning the full transcript.

Parameters:

  • url (string, required): YouTube video URL or ID

get_available_languages

Lists available transcript languages for a YouTube video. Use this before retrying with a specific lang value.

Parameters:

  • url (string, required): YouTube video URL or ID

Development

Project Structure

code
├── src/
│ ├── index.ts            # Server entry point
│ ├── youtube.ts          # YouTube transcript fetching logic
├── tests/                # Node test runner coverage
├── docs/                 # Maintenance notes
├── Dockerfile            # Local container build
├── dist/                 # Compiled output
└── package.json

Key Components

  • YouTubeTranscriptFetcher: Core transcript fetching functionality
  • YouTubeUtils: Text processing and utilities

Features and Capabilities

  • Error Handling:

    • Invalid URLs/IDs
    • Unavailable transcripts
    • Language availability
    • Network errors
    • Rate limiting
    • Empty caption responses caused by YouTube client enforcement
  • Text Processing:

    • HTML entity decoding
    • Punctuation normalization
    • Space normalization
    • srv3, classic XML, json3, and VTT caption parsing
    • Smart paragraph detection

YouTube Access Notes

YouTube does not provide an official public API for downloading captions from arbitrary videos. This server uses YouTube's internal caption data exposed to web and Android clients. YouTube may still reject requests from some networks, hosted environments, or remote MCP providers. When that happens, the server now returns a more specific diagnostic instead of a generic No transcripts found error.

Contributing

We welcome contributions! Please feel free to submit issues and pull requests.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Related Projects

常见问题

YouTube Transcript Server 是什么?

Retrieve transcripts and subtitles from YouTube videos effortlessly. Analyze content with support for multiple languages and detailed metadata, enhancing your video processing workflows.

YouTube Transcript Server 提供哪些工具?

提供 1 个工具,包括 get_transcripts

相关 Skills

文档共著

by anthropics

Universal
热门

围绕文档、提案、技术规格、决策记录等写作任务,按上下文收集、结构迭代、读者测试三步协作共创,减少信息遗漏,写出更清晰、经得起他人阅读的内容。

写文档、方案或技术规格时容易思路散、信息漏,它用结构化共著流程帮你高效传递上下文、反复打磨内容,还能从读者视角做验证。

内容与创意
未扫描149.6k

内部沟通

by anthropics

Universal
热门

按公司常用模板和语气快速起草内部沟通内容,覆盖 3P 更新、状态报告、领导汇报、项目进展、事故复盘、FAQ 与 newsletter,适合需要统一格式的团队沟通场景。

按公司偏好的模板快速产出状态汇报、领导更新和 FAQ,既省去反复改稿,也让内部沟通更统一、更专业。

内容与创意
未扫描149.6k

平面设计

by anthropics

Universal
热门

先生成视觉哲学,再落地成原创海报、艺术画面或其他静态设计,输出 .png/.pdf,强调构图、色彩与空间表达,适合需要高完成度视觉成品的场景。

做海报、插画或静态视觉稿时,用它能快速产出兼顾美感与版式的PNG/PDF成品,原创设计更省心,也更适合规避版权风险。

内容与创意
未扫描149.6k

相关 MCP Server

免费的加密新闻聚合 MCP,汇集 Bitcoin、Ethereum、DeFi、Solana 与 altcoins 资讯源。

内容与创意
236

by ProfessionalWiki

让 Large Language Model 客户端无缝连接任意 MediaWiki 站点,可创建、更新、搜索页面,并通过 OAuth 2.0 安全管理内容。

内容与创意16 个工具
97

用于Adobe Photoshop自动化的MCP server,让AI assistants直接控制Photoshop。

内容与创意
97

评论