YouTube视频处理服务器

一个提供YouTube视频处理工具和提示的模型上下文协议(MCP)服务器,包括转录提取、章节生成和博客文章创建。

  • by ShawhinT
  • Jupyter Notebook
  • 本地部署
  • 11 星标
  • 更新于
在 GitHub 查看 ShawhinT/yt-mcp

使用说明

YouTube MCP服务器

一种模型上下文协议(MCP)服务器,提供使用(Shaw Talebi的)YouTube视频的工具和提示,包括转录提取、章节生成和博客文章创建。

为...准备 AgentCon 2025-达拉斯 研讨会。

资源:

概述

此MCP服务器使AI助手能够:

  • 从YouTube视频中提取带时间戳的文字记录
  • 访问精心策划的人工智能和创业视频库
  • 从成绩单生成结构化视频章节
  • 将视频转录转换为引人入胜的博客文章
  • 获取截至2025年6月25日Shaw Talebi的YouTube视频表

如何运行此示例

  1. 克隆此仓库
  2. 安装uv 如果你还没有
# Mac/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

# Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
  1. 安装依赖项:
uv sync
  1. 在开发模式下测试服务器
uv run mcp dev main.py
  1. 将服务器配置添加到AI应用程序(例如Claude Desktop或Cursor)。
{
  "mcpServers": {
    "YT-MCP": {
      "command": "/Users/shawhin/.local/bin/uv", # replace with global path to your uv installation
      "args": [
        "--directory",
        "/Users/shawhin/Documents/repos/yt-mcp/", # replace with global path to repo
        "run",
        "main.py"
      ]
    }
  }
}

特性

🛠️ 工具

  • fetch_youtube_transcript:从YouTube URL中提取带有时间戳的格式化成绩单

📚 资源

  • yt-library://:访问Shaw Talebi专注于人工智能和创业主题的YouTube频道库

📝 提示

  • create_chapters_instructions:生成有意义视频章节的详细指南
  • write_blog_instructions:将成绩单转换为专业博客文章的说明

项目结构

yt-mcp/
├── main.py                    # MCP server implementation
├── prompts/
│   ├── create_chapters.md     # Chapter generation guidelines
│   └── write_blog.md         # Blog writing instructions
├── resources/
│   └── videos.csv            # Video library database
├── yt-mcp-example.ipynb      # Usage examples
├── pyproject.toml            # Project configuration
└── requirements.txt          # Dependencies