Skip to main content
Glama

YouTube MCP Server

by Nocodeboy

YouTube MCP 服务器

这是一个 MCP(模型上下文协议)服务器,允许 Claude 和其他 AI 助手与 YouTube API 交互。该服务器提供搜索视频、获取特定视频详情、搜索频道以及获取频道详细信息的工具。

什么是 MCP?

模型上下文协议 (MCP) 是由 Claude 的创建者 Anthropic 开发的一项开放标准,用于将 AI 助手与外部数据源和工具连接起来。它允许像 Claude 这样的模型以标准化的方式访问最新信息并在外部系统中执行操作。

MCP 作为 AI 的“通用桥梁”,为模型访问各种内容存储库、业务服务或应用程序提供了标准化的方式。

要求

  • Node.js v16 或更高版本
  • YouTube API 密钥(从 Google 开发者控制台获取)

安装

  1. 克隆此存储库:
git clone https://github.com/Nocodeboy/youtube-mcp-server.git cd youtube-mcp-server
  1. 安装依赖项:
npm install
  1. 在项目根目录中创建一个.env文件并添加您的 YouTube API 密钥:
YOUTUBE_API_KEY=your_api_key_here

执行

要启动服务器,请运行:

npm start

与 Claude Desktop 集成

要将此 MCP 服务器与 Claude Desktop 一起使用,请将以下配置添加到您的claude_desktop_config.json文件中(通常位于 Windows 上的%APPDATA%\Claude\或 macOS 上的~/Library/Application Support/Claude/ ):

{ "mcpServers": { "youtube": { "command": "node", "args": ["path/to/youtube-mcp-server/index.js"], "env": { "YOUTUBE_API_KEY": "your_api_key_here" } } } }

"path/to/youtube-mcp-server/index.js"替换为index.js文件的绝对路径,将"your_api_key_here"替换为您的 YouTube API 密钥。

可用工具

1. 搜索视频

根据查询在 YouTube 上搜索视频。

search_videos

参数:

  • query (字符串,必需):搜索词
  • maxResults (数字,可选):最大结果数(1 到 50 之间)
  • pageToken (字符串,可选):获取下一页结果的令牌

2. 获取视频详细信息

获取有关特定视频的详细信息。

get_video_details

参数:

  • videoId (字符串,必需):YouTube 视频 ID

3. 获取频道详情

获取有关特定频道的详细信息。

get_channel_details

参数:

  • channelId (字符串,必需):YouTube 频道 ID

4. 搜索渠道

根据查询在 YouTube 上搜索频道。

search_channels

参数:

  • query (字符串,必需):搜索词
  • maxResults (数字,可选):最大结果数(1 到 50 之间)
  • pageToken (字符串,可选):获取下一页结果的令牌

可用资源

  • youtube://popular/videos :YouTube 上当前热门视频列表

使用示例

使用 Claude Desktop,您可以提出以下问题:

  • “搜索 Python 编程视频”
  • “显示 ID 为 dQw4w9WgXcQ 的视频详情”
  • “搜索烹饪相关频道”
  • “向我提供有关 GoogleDevelopers 频道的信息”
  • “现在最热门的视频是什么?”

获取 YouTube API 密钥

要获取 YouTube API 密钥:

  1. 前往Google 开发者控制台
  2. 创建新项目(或选择现有项目)
  3. 在侧栏中,选择“API 库”
  4. 搜索“YouTube Data API v3”并启用它
  5. 在侧栏中,选择“凭据”
  6. 点击“创建凭证”并选择“API 密钥”
  7. 复制生成的密钥并在.env文件或 Claude Desktop 配置中使用它

故障排除

如果遇到错误,请检查:

  1. 你已经使用npm install安装了所有依赖项
  2. 您的 YouTube API 密钥有效
  3. 您的 Google 项目中已启用 YouTube 数据 API v3
  4. 您正在使用 Node.js 版本 16 或更高版本
  5. 如果您使用 Claude Desktop,请检查%APPDATA%\Claude\logs\ (Windows) 或~/Library/Logs/Claude/ (macOS) 中的日志

贡献

欢迎贡献。您可以通过多种方式进行合作:

  1. 报告错误或问题
  2. 建议新功能
  3. 发送包含改进或修复的拉取请求
  4. 改进文档

连接与支持

  • 在 X (Twitter) 上关注我: @Nocodeboy
  • 如果您发现该项目有用并希望表示支持:

执照

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

-
security - not tested
A
license - permissive license
-
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.

MCP 服务器允许 Claude 和其他 AI 助手与 YouTube API 进行交互,提供搜索视频/频道和检索有关它们的详细信息的工具。

  1. 什么是 MCP?
    1. 要求
      1. 安装
        1. 执行
          1. 与 Claude Desktop 集成
            1. 可用工具
              1. 搜索视频
              2. 获取视频详细信息
              3. 获取频道详情
              4. 搜索渠道
            2. 可用资源
              1. 使用示例
                1. 获取 YouTube API 密钥
                  1. 故障排除
                    1. 贡献
                      1. 连接与支持
                        1. 执照

                          Related MCP Servers

                          • A
                            security
                            F
                            license
                            A
                            quality
                            This server allows AI language models to interact with YouTube content through a standardized interface, providing features such as video and channel information retrieval, transcript management, and playlist operations.
                            Last updated -
                            7
                            182
                            205
                            TypeScript
                            • Linux
                            • Apple
                          • -
                            security
                            F
                            license
                            -
                            quality
                            The MCP Server integrates APIs from the Youtube-Summarizer as tools within the MCP protocol, allowing for local AI application interaction and tool utilization through natural language queries.
                            Last updated -
                            Python
                          • -
                            security
                            A
                            license
                            -
                            quality
                            An MCP server that allows AI models to control YouTube Music playback through Google Chrome by searching and playing songs using song and artist names.
                            Last updated -
                            2
                            JavaScript
                            MIT License
                            • Apple
                          • A
                            security
                            A
                            license
                            A
                            quality
                            An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
                            Last updated -
                            1
                            93
                            Python
                            MIT License
                            • Apple
                            • Linux

                          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/Nocodeboy/youtube-mcp-server'

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