Skip to main content
Glama

YouTube MCP Server

YouTube MCP 服务器

YouTube 的模型上下文协议 (MCP) 服务器实现,使 AI 语言模型能够通过标准化界面与 YouTube 内容进行交互。

特征

视频信息

  • 获取视频详细信息(标题、描述、时长等)
  • 列出频道视频
  • 获取视频统计数据(观看次数、点赞次数、评论次数)
  • 在 YouTube 上搜索视频

成绩单管理

  • 检索视频记录
  • 支持多种语言
  • 获取带时间戳的字幕
  • 在成绩单内搜索

渠道管理

  • 获取频道详情
  • 列出频道播放列表
  • 获取频道统计信息
  • 在频道内容内搜索

播放列表管理

  • 列出播放列表项目
  • 获取播放列表详细信息
  • 在播放列表中搜索
  • 获取播放列表视频脚本

安装

通过 Smithery 安装

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

npx -y @smithery/cli install @ZubeidHendricks/youtube --client claude

手动安装

npm install zubeid-youtube-mcp-server

配置

设置以下环境变量:

  • YOUTUBE_API_KEY :您的 YouTube 数据 API 密钥
  • YOUTUBE_TRANSCRIPT_LANG :转录的默认语言(可选,默认为“en”)

与 MCP 客户端一起使用

将其添加到您的 MCP 客户端配置(例如 Claude Desktop):

{ "mcpServers": { "youtube": { "command": "npx", "args": ["-y", "zubeid-youtube-mcp-server"], "env": { "YOUTUBE_API_KEY": "<YOUR_API_KEY>" } } } }

与 VS Code 一起使用

对于一键安装,请单击以下安装按钮之一:

手动安装

如果您希望手动安装,请先勾选本节顶部的安装按钮。否则,请按照以下步骤操作:

将以下 JSON 块添加到 VS Code 中的“用户设置 (JSON)”文件中。您可以按下Ctrl + Shift + P并输入Preferences: Open User Settings (JSON)来执行此操作。

{ "mcp": { "inputs": [ { "type": "promptString", "id": "apiKey", "description": "YouTube API Key", "password": true } ], "servers": { "youtube": { "command": "npx", "args": ["-y", "zubeid-youtube-mcp-server"], "env": { "YOUTUBE_API_KEY": "${input:apiKey}" } } } } }

或者,您可以将其添加到工作区中名为.vscode/mcp.json的文件中:

{ "inputs": [ { "type": "promptString", "id": "apiKey", "description": "YouTube API Key", "password": true } ], "servers": { "youtube": { "command": "npx", "args": ["-y", "zubeid-youtube-mcp-server"], "env": { "YOUTUBE_API_KEY": "${input:apiKey}" } } } }

YouTube API 设置

  1. 前往 Google Cloud Console
  2. 创建新项目或选择现有项目
  3. 启用 YouTube 数据 API v3
  4. 创建 API 凭证(API 密钥)
  5. 复制 API 密钥进行配置

示例

管理视频

// Get video details const video = await youtube.videos.getVideo({ videoId: "video-id" }); // Get video transcript const transcript = await youtube.transcripts.getTranscript({ videoId: "video-id", language: "en" }); // Search videos const searchResults = await youtube.videos.searchVideos({ query: "search term", maxResults: 10 });

管理频道

// Get channel details const channel = await youtube.channels.getChannel({ channelId: "channel-id" }); // List channel videos const videos = await youtube.channels.listVideos({ channelId: "channel-id", maxResults: 50 });

管理播放列表

// Get playlist items const playlistItems = await youtube.playlists.getPlaylistItems({ playlistId: "playlist-id", maxResults: 50 }); // Get playlist details const playlist = await youtube.playlists.getPlaylist({ playlistId: "playlist-id" });

发展

# Install dependencies npm install # Run tests npm test # Build npm run build # Lint npm run lint

贡献

有关对此存储库做出贡献的信息,请参阅 CONTRIBUTING.md。

执照

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅 LICENSE 文件。

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

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.

该服务器允许AI语言模型通过标准化界面与YouTube内容进行交互,提供视频和频道信息检索、成绩单管理、播放列表操作等功能。

  1. 特征
    1. 视频信息
    2. 成绩单管理
    3. 渠道管理
    4. 播放列表管理
  2. 安装
    1. 通过 Smithery 安装
    2. 手动安装
  3. 配置
    1. 与 MCP 客户端一起使用
      1. 与 VS Code 一起使用
      2. 手动安装
    2. YouTube API 设置
      1. 示例
        1. 管理视频
        2. 管理频道
        3. 管理播放列表
      2. 发展
        1. 贡献
          1. 执照

            Related MCP Servers

            • A
              security
              A
              license
              A
              quality
              A Model Context Protocol server that enables retrieval of transcripts from YouTube videos. This server provides direct access to video captions and subtitles through a simple interface.
              Last updated -
              1
              526
              189
              JavaScript
              MIT License
            • -
              security
              F
              license
              -
              quality
              Enables AI language models to interact with YouTube content through a standardized interface, providing tools for retrieving video information, transcripts, channel analytics, and trend analysis.
              Last updated -
              852
              1
              JavaScript
            • -
              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

            MCP directory API

            We provide all the information about MCP servers via our MCP API.

            curl -X GET 'https://glama.ai/api/mcp/v1/servers/ZubeidHendricks/youtube-mcp-server'

            If you have feedback or need assistance with the MCP directory API, please join our Discord server