YouTube MCP服务器

一个零配置的YouTube MCP服务器,用于搜索视频、获取字幕、浏览频道以及跨创作者内容搜索,无需API密钥。

  • by Anarcyst
  • Python
  • 本地部署
  • 11 星标
  • 更新于
在 GitHub 查看 Anarcyst/youtube-mcp-server

使用说明

YouTube MCP服务器

A. 零配置 YouTube的MCP服务器。搜索视频、获取成绩单、浏览频道,以及 在创建者的整个内容中搜索。不需要API密钥。

快速开始

uvx yt-mcp-server

或者用pip安装:

pip install yt-mcp-server

设置

克劳德桌面版

添加到您的 claude_desktop_config.json:

{
  "mcpServers": {
    "youtube": {
      "command": "uvx",
      "args": ["--from", "yt-mcp-server", "youtube-mcp-server"]
    }
  }
}

克劳德代码

claude mcp add youtube -- uvx yt-mcp-server

光标

添加到光标MCP设置中:

{
  "mcpServers": {
    "youtube": {
      "command": "uvx",
      "args": ["--from", "yt-mcp-server", "youtube-mcp-server"]
    }
  }
}

工具

工具 说明
search_channel_transcripts 在频道的所有视频中搜索——找到任何创作者对任何主题的看法
search_transcript 在单个视频的文字记录中搜索
get_transcript 获取带有时间戳的完整成绩单
search_videos 在YouTube上搜索视频
get_video_info 获取视频详细信息——标题、描述、统计数据、章节
get_channel_info 获取频道信息——订阅者、描述、视频计数
get_channel_videos 列出某个频道的视频,按日期或受欢迎程度排序
get_comments 获取按相关性排序的视频评论

示例提示

"Find me the best videos on how to scale a B2B SaaS from 0 to $1M ARR"
→ search_videos

"Show me everything @AlexHormozi posted this month"
→ get_channel_videos

"Summarize this interview with Sam Altman: https://youtube.com/watch?v=..."
→ get_transcript

"What exactly did @AlexHormozi say about making offers? Give me the timestamps"
→ search_channel_transcripts — searches all videos, returns exact passages with links

"Compare how @ycombinator and @AlexHormozi think about product-market fit"
→ search_channel_transcripts on both channels

HTTP传输

作为独立的HTTP服务器运行:

yt-mcp-server --transport streamable-http --port 8000

需求

  • Python 3.10+
  • yt-dlp (自动安装)
  • 无需API密钥或身份验证

备注

成绩单特征(get_transcript, search_transcript, search_channel_transcripts)使用YouTube的内部API,该API可以在短时间内对多次请求进行速率限制。正常使用(每个会话几个查询)效果很好。

致谢

在以下人员的协助下建造 克劳德 通过Anthropic。

许可证

麻省理工学院