首页
学习
活动
专区
圈层
工具
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
首页
学习
活动
专区
圈层
工具
MCP广场
MCP广场 >详情页
youtube-data-mcp-server云托管模式2025-06-160分享
github
YouTube MCP 服务器是一个基于 YouTube 数据 API 的模型上下文协议服务器,旨在为 AI 语言模型提供标准化的接口以与 YouTube 内容进行交互。其主要功能包括获取视频详细信息、搜索视频、检索多语言字幕、分析频道统计数据、查看热门视频趋势等。服务器提供了多种工具,如 `getVideoDetails`、`searchVideos`、`getTranscripts` 等,方便用户进行视频和频道数据的深入分析。安装方式支持通过 Smithery 自动安装或手动安装,并需要配置 YouTube API 密钥。该服务器适用于 Node.js 环境,并遵循 MIT 许可证发布。
By icraft2170
2025-06-160
github
详情内容

YouTube MCP 服务器

smithery 徽章

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

主要功能

视频信息

  • 获取详细的视频信息(标题、描述、时长、统计)
  • 根据关键词搜索视频
  • 基于特定视频获取相关视频
  • 计算并分析视频互动比率

字幕/字幕管理

  • 支持多语言的视频字幕检索
  • 指定字幕的语言偏好
  • 访问带时间戳的字幕以便精确内容引用

频道分析

  • 查看详细频道统计数据(订阅者数、观看次数、视频数量)
  • 获取频道内表现最佳的视频
  • 分析频道的增长和互动指标

趋势分析

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

可用工具

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

工具名称 描述 必需参数
getVideoDetails 获取关于多个 YouTube 视频的详细信息,包括元数据、统计和内容详情 videoIds (数组)
searchVideos 根据查询字符串搜索视频 query, maxResults (可选)
getTranscripts 为多个视频检索字幕 videoIds (数组), lang (可选)
getRelatedVideos 基于 YouTube 的推荐算法获取与特定视频相关的视频 videoId, maxResults (可选)
getChannelStatistics 获取多个频道的详细指标,包括订阅者数量、观看次数和视频数量 channelIds (数组)
getChannelTopVideos 获取特定频道中观看次数最多的视频 channelId, maxResults (可选)
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 控制台
  2. 创建一个新项目或选择一个现有项目
  3. 启用 YouTube Data 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 文件。

通过SSE URL连接服务
Server已在腾讯云托管,可在连接后免费调用和在线进行工具测试~
工具测试
已支持Server下的9个工具,可选择工具进行在线测试
compareVideos
Compares multiple videos based on their statistics. Returns a comparison of view counts, like counts, comment counts, and other metrics for the specified videos. Use this when you want to analyze the performance of multiple videos side by side.
getChannelStatistics
Retrieves statistics for multiple channels. Returns detailed metrics including subscriber count, view count, and video count for each channel. Use this when you need to analyze the performance and reach of multiple YouTube channels.
getChannelTopVideos
Retrieves the top videos from a specific channel. Returns a list of the most viewed or popular videos from the channel, based on view count. Use this when you want to identify the most successful content from a channel.
getRelatedVideos
Retrieves related videos for a specific video. Returns a list of videos that are similar or related to the specified video, based on YouTube's recommendation algorithm. Use this when you want to discover content similar to a particular video.
getTranscripts
Retrieves transcripts for multiple videos. Returns the text content of videos' captions, useful for accessibility and content analysis. Use this when you need the spoken content of multiple videos.
getTrendingVideos
Retrieves trending videos based on region and category. Returns a list of videos that are currently popular in the specified region and category. Use this when you want to discover what's trending in specific areas or categories. Available category IDs: 1 (Film & Animation), 2 (Autos & Vehicles), 10 (Music), 15 (Pets & Animals), 17 (Sports), 18 (Short Movies), 19 (Travel & Events), 20 (Gaming), 21 (Videoblogging), 22 (People & Blogs), 23 (Comedy), 24 (Entertainment), 25 (News & Politics), 26 (Howto & Style), 27 (Education), 28 (Science & Technology), 29 (Nonprofits & Activism), 30 (Movies), 31 (Anime/Animation), 32 (Action/Adventure), 33 (Classics), 34 (Comedy), 35 (Documentary), 36 (Drama), 37 (Family), 38 (Foreign), 39 (Horror), 40 (Sci-Fi/Fantasy), 41 (Thriller), 42 (Shorts), 43 (Shows), 44 (Trailers).
getVideoDetails
Get detailed information about multiple YouTube videos. Returns comprehensive data including video metadata, statistics, and content details. Use this when you need complete information about specific videos.
getVideoEngagementRatio
Calculates the engagement ratio for multiple videos. Returns metrics such as view count, like count, comment count, and the calculated engagement ratio for each video. Use this when you want to measure the audience interaction with videos.
searchVideos
Searches for videos based on a query string. Returns a list of videos matching the search criteria, including titles, descriptions, and metadata. Use this when you need to find videos related to specific topics or keywords.
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档