YouTube Toolbox

Integrations

  • Leverages Google Cloud Platform services, specifically requiring YouTube Data API v3 credentials for authentication and access to YouTube data.

  • Provides tools for interacting with YouTube, including video searching, transcript extraction, comment retrieval, related video discovery, trending video lists, channel information retrieval, and transcript analysis with filtering and summarization capabilities.

py-mcp-youtube-工具箱

MCP 服务器为 AI 助手提供与 YouTube 交互的强大工具,包括视频搜索、文字记录提取、评论检索等。

概述

py-mcp-youtube-toolbox 提供以下与 YouTube 相关的功能:

  • 使用高级过滤选项搜索 YouTube 视频
  • 获取有关视频和频道的详细信息
  • 使用排序选项检索视频评论
  • 提取多种语言的视频记录和字幕
  • 查找给定视频的相关视频
  • 按地区获取热门视频
  • 根据文字记录生成视频内容摘要
  • 具有过滤、搜索和多视频功能的高级转录分析

目录

先决条件

  1. Python :安装 Python 3.12 或更高版本
  2. YouTube API 密钥
    • 前往Google Cloud Console
    • 创建新项目或选择现有项目
    • 启用 YouTube 数据 API v3:
      1. 前往“API 和服务”>“库”
      2. 搜索并启用“YouTube 数据 API v3”
    • 创建凭证:
      1. 前往“API 和服务”>“凭证”
      2. 点击“创建凭证”>“API 密钥”
      3. 记下您的 API 密钥

安装

Git 克隆
git clone https://github.com/jikime/py-mcp-youtube-toolbox.git cd py-mcp-youtube-toolbox
配置
  1. 安装 UV 包管理器:
curl -LsSf https://astral.sh/uv/install.sh | sh
  1. 创建并激活虚拟环境:
uv venv -p 3.12 source .venv/bin/activate # On MacOS/Linux # or .venv\Scripts\activate # On Windows
  1. 安装依赖项:
uv pip install -r requirements.txt
  1. 环境变量:
cp env.example .env vi .env # Update with your YouTube API key YOUTUBE_API_KEY=your_youtube_api_key
使用 Docker
  1. 构建 Docker 镜像:
docker build -t py-mcp-youtube-toolbox .
  1. 运行容器:
docker run -e YOUTUBE_API_KEY=your_youtube_api_key py-mcp-youtube-toolbox
使用本地
  1. 运行服务器:
mcp run server.py
  1. 运行 MCP 检查器:
mcp dev server.py

配置 MCP 设置

将服务器配置添加到您的 MCP 设置文件:

克劳德桌面应用程序
  1. 要通过Smithery自动安装:
npx -y @smithery/cli install @jikime/py-mcp-youtube-toolbox --client claude
  1. 要手动安装,请打开~/Library/Application Support/Claude/claude_desktop_config.json

将其添加到mcpServers对象:

{ "mcpServers": { "YouTube Toolbox": { "command": "/path/to/bin/uv", "args": [ "--directory", "/path/to/py-mcp-youtube-toolbox", "run", "server.py" ], "env": { "YOUTUBE_API_KEY": "your_youtube_api_key" } } } }
游标 IDE

打开~/.cursor/mcp.json

将其添加到mcpServers对象:

{ "mcpServers": { "YouTube Toolbox": { "command": "/path/to/bin/uv", "args": [ "--directory", "/path/to/py-mcp-youtube-toolbox", "run", "server.py" ], "env": { "YOUTUBE_API_KEY": "your_youtube_api_key" } } } }
对于 Docker
{ "mcpServers": { "YouTube Toolbox": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "YOUTUBE_API_KEY=your_youtube_api_key", "py-mcp-youtube-toolbox" ] } } }

工具文档

视频工具

  • search_videos :使用高级过滤选项(频道、时长、地区等)搜索 YouTube 视频
  • get_video_details :获取有关特定 YouTube 视频的详细信息(标题、频道、观看次数、喜欢次数等)
  • get_video_comments :从 YouTube 视频中检索带有排序选项的评论
  • get_related_videos :查找与特定 YouTube 视频相关的视频
  • get_trending_videos :按地区获取 YouTube 上的热门视频

渠道工具

  • get_channel_details :获取有关 YouTube 频道的详细信息(名称、订阅者、观看次数等)

成绩单工具

  • get_video_transcript :从指定语言的 YouTube 视频中提取文字记录/字幕
  • get_video_enhanced_transcript :具有过滤、搜索和多视频功能的高级转录提取

提示工具

  • transcript_summary :根据可自定义选项的成绩单生成 YouTube 视频内容摘要

资源工具

  • youtube://available-youtube-tools :获取所有可用的 YouTube 工具列表
  • youtube://video/{video_id} :获取特定视频的详细信息
  • youtube://channel/{channel_id} :获取有关特定频道的信息
  • youtube://transcript/{video_id}?language={language} :获取特定视频的成绩单

发展

对于本地测试,您可以使用附带的客户端脚本:

# Example: Search videos uv run client.py search_videos query="MCP" max_results=5 # Example: Get video details uv run client.py get_video_details video_id=zRgAEIoZEVQ # Example: Get channel details uv run client.py get_channel_details channel_id=UCRpOIr-NJpK9S483ge20Pgw # Example: Get video comments uv run client.py get_video_comments video_id=zRgAEIoZEVQ max_results=10 order=time # Example: Get video transcript uv run client.py get_video_transcript video_id=zRgAEIoZEVQ language=ko # Example: Get related videos uv run client.py get_related_videos video_id=zRgAEIoZEVQ max_results=5 # Example: Get trending videos uv run client.py get_trending_videos region_code=ko max_results=10 # Example: Advanced transcript extraction uv run client.py get_video_enhanced_transcript video_ids=zRgAEIoZEVQ language=ko format=timestamped include_metadata=true start_time=100 end_time=200 query=에이전트 case_sensitive=true segment_method=equal segment_count=2 # Example:

执照

MIT 许可证

You must be authenticated.

A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

MCP 服务器为 AI 助手提供与 YouTube 交互的强大工具,包括视频搜索、文字记录提取、评论检索等。

  1. 概述
    1. 目录
      1. 先决条件
        1. 安装
          1. Git 克隆
          2. 配置
          3. 使用 Docker
          4. 使用本地
        2. 配置 MCP 设置
          1. 克劳德桌面应用程序
          2. 游标 IDE
          3. 对于 Docker
        3. 工具文档
          1. 视频工具
          2. 渠道工具
          3. 成绩单工具
          4. 提示工具
          5. 资源工具
        4. 发展
          1. 执照

            Related MCP Servers

            • -
              security
              F
              license
              -
              quality
              This server allows AI language models to interact with YouTube content through a standardized interface, providing features such as video and channel information retrieval, transcript management, and playlist operations.
              Last updated -
              59
              135
              TypeScript
              • Linux
              • Apple
            • -
              security
              F
              license
              -
              quality
              The MCP Server integrates APIs from the Youtube-Summarizer as tools within the MCP protocol, allowing for local AI application interaction and tool utilization through natural language queries.
              Last updated -
              Python
            • -
              security
              A
              license
              -
              quality
              An MCP server that allows Claude and other AI assistants to interact with the YouTube API, providing tools to search videos/channels and retrieve detailed information about them.
              Last updated -
              1
              JavaScript
              MIT License
              • Apple
            • -
              security
              F
              license
              -
              quality
              A Model Context Protocol server that enables AI assistants to extract transcripts from YouTube videos, allowing AI to analyze and work with video content directly.
              Last updated -
              6
              1
              TypeScript

            View all related MCP servers

            ID: r5s240ekuw