YouTube MCP Server

by icraft2170
Verified

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.

Integrations

  • Requires setup of a YouTube Data API v3 key through Google Cloud Console to authenticate and access YouTube data.

  • Provides tools for retrieving video details, searching videos, getting transcripts, analyzing channels, calculating engagement metrics, and accessing trending content from the YouTube Data API.

YouTube MCP 服务器

利用 YouTube 数据 API 实现的模型上下文协议 (MCP) 服务器。它允许 AI 语言模型通过标准化接口与 YouTube 内容进行交互。

主要特点

视频信息

  • 检索详细的视频信息(标题、描述、时长、统计数据)
  • 按关键字搜索视频
  • 根据特定视频获取相关视频
  • 计算并分析视频参与率

成绩单/字幕管理

  • 检索支持多语言的视频字幕
  • 指定成绩单的语言偏好
  • 访问带有时间戳的字幕以获得精确的内容参考

渠道分析

  • 查看详细的频道统计数据(订阅者、观看次数、视频数量)
  • 从频道中获取表现最佳的视频
  • 分析渠道增长和参与度指标

趋势分析

  • 按地区和类别查看热门视频
  • 比较多个视频的性能指标
  • 发现特定类别的热门内容

可用工具

该服务器提供以下 MCP 工具:

工具名称描述必需参数
getVideoDetails获取有关多个 YouTube 视频的详细信息,包括元数据、统计信息和内容详情videoIds (数组)
searchVideos根据查询字符串搜索视频querymaxResults (可选)
getTranscripts检索多个视频的文字记录videoIds (数组)、 lang (可选)
getRelatedVideos根据YouTube的推荐算法获取与特定视频相关的视频videoIdmaxResults (可选)
getChannelStatistics检索多个频道的详细指标,包括订阅者数量、观看次数和视频数量channelIds (数组)
getChannelTopVideos获取特定频道观看次数最多的视频channelIdmaxResults (可选)
getVideoEngagementRatio计算多个视频的参与度指标(观看次数、点赞次数、评论次数和参与度)videoIds (数组)
getTrendingVideos按地区和类别获取当前热门视频regionCode (可选)、 categoryId (可选)、 maxResults (可选)
compareVideos比较多个视频的统计数据videoIds (数组)

安装

通过 Smithery 自动安装

通过Smithery自动为 Claude Desktop 安装 YouTube MCP 服务器:

npx -y @smithery/cli install @icraft2170/youtube-data-mcp-server --client claude

手动安装

# Install from npm npm install youtube-data-mcp-server # Or clone repository git clone https://github.com/icraft2170/youtube-data-mcp-server.git cd youtube-data-mcp-server npm install

环境配置

设置以下环境变量:

  • YOUTUBE_API_KEY :YouTube 数据 API 密钥(必需)
  • YOUTUBE_TRANSCRIPT_LANG :默认字幕语言(可选,默认值:'ko')

MCP 客户端配置

将以下内容添加到您的 Claude Desktop 配置文件中:

{ "mcpServers": { "youtube": { "command": "npx", "args": ["-y", "youtube-data-mcp-server"], "env": { "YOUTUBE_API_KEY": "YOUR_API_KEY_HERE", "YOUTUBE_TRANSCRIPT_LANG": "ko" } } } }

YouTube API 设置

  1. 访问 Google Cloud Console
  2. 创建新项目或选择现有项目
  3. 启用 YouTube 数据 API v3
  4. 创建 API 凭证(API 密钥)
  5. 在您的环境配置中使用生成的 API 密钥

发展

# Install dependencies npm install # Run in development mode npm run dev # Build npm run build

网络配置

服务器公开以下端口用于通信:

  • HTTP:3000
  • gRPC:3001

系统要求

  • Node.js 18.0.0 或更高版本

安全注意事项

  • 始终保证 API 密钥的安全,切勿将其提交到版本控制系统
  • 通过环境变量或配置文件管理您的 API 密钥
  • 设置 API 密钥的使用限制,以防止未经授权的使用

执照

本项目遵循 MIT 许可证。详情请参阅 LICENSE 文件。

-
security - not tested
F
license - not found
-
quality - not tested

使AI语言模型能够通过标准化界面与YouTube内容进行交互,提供检索视频信息、成绩单、频道分析和趋势分析的工具。

  1. Key Features
    1. Video Information
    2. Transcript/Caption Management
    3. Channel Analysis
    4. Trend Analysis
  2. Available Tools
    1. Installation
      1. Automatic Installation via Smithery
      2. Manual Installation
    2. Environment Configuration
      1. MCP Client Configuration
        1. YouTube API Setup
          1. Development
            1. Network Configuration
              1. System Requirements
                1. Security Considerations
                  1. License
                    ID: alxyqqw9qw