Skip to main content
Glama

Youtube MCP 服务器

关于

该服务器是 Youtube API 和 AI 助手之间的桥梁,基于模型上下文协议。

Related MCP server: YouTube Tools MCP Server

什么是 MCP?

模型上下文协议 (MCP) 是一个允许 AI 应用(例如 Claude Desktop)连接到外部工具和数据源的系统。它为 AI 助手提供了一种清晰、安全的方式,使其能够使用本地服务和 API,同时保持用户的控制权。

这个服务器是做什么的?

  • [x] 下载指定视频的隐藏字幕

实际用例

  • [x] 创建视频摘要

先决条件

安装

uv tool install git+https://github.com/sparfenyuk/mcp-youtube

[!NOTE] 如果您已经安装了服务器,则可以使用uv tool upgrade --reinstall命令进行更新。

[!NOTE] 如果要删除服务器,请使用uv tool uninstall mcp-youtube命令。

配置

Claude桌面配置

配置 Claude Desktop 以识别 Youtube MCP 服务器。

  1. 打开Claude桌面配置文件:

    • 在 MacOS 中,配置文件位于~/Library/Application Support/Claude/claude_desktop_config.json

    • 在 Windows 中,配置文件位于%APPDATA%\Claude\claude_desktop_config.json

    **注意:**您还可以在 Claude Desktop 应用程序的设置中找到 claude_desktop_config.json

  2. 添加服务器配置

    {
      "mcpServers": {
        "mcp-youtube": {
            "command": "mcp-youtube",
          }
        }
      }
    }

发展

入门

  1. 克隆存储库

  2. 安装依赖项

    uv sync
  3. 运行服务器

    uv run mcp-youtube --help

可以将工具添加到src/mcp_youtube/tools.py文件中。

如何添加新工具:

  1. 创建一个继承自 ToolArgs 的新类

    class NewTool(ToolArgs):
        """Description of the new tool."""
        pass

    该类的属性将用作该工具的参数。类的文档字符串将用作工具的描述。

  2. 为新类实现 tool_runner 函数

    @tool_runner.register
    async def new_tool(args: NewTool) -> t.Sequence[TextContent | ImageContent | EmbeddedResource]:
        pass

    该函数应返回 TextContent、ImageContent 或 EmbeddedResource 的序列。该函数应为异步函数,并接受新类的单个参数。

  3. 完成!重启客户端,新工具就可以使用了。

验证可以通过 Claude Desktop 或直接运行工具来完成。

在检查器中调试服务器

MCP 检查器是一款使用精美 UI 帮助调试服务器的工具。要运行它,请使用以下命令:

npx @modelcontextprotocol/inspector uv run mcp-youtube

故障排除

消息“无法连接到 MCP 服务器 mcp-youtube”

如果您在 Claude Desktop 中看到消息“无法连接到 MCP 服务器 mcp-youtube”,则表示服务器配置不正确。

请尝试以下操作:

  • 在配置文件中使用mcp-youtube二进制文件的完整路径

Available Tools

1 tool
DownloadClosedCaptionsC

Download closed captions from YouTube video.

Inputs: video_url (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.9/5.0

    Scored across 1 tool

    Disambiguation5/5

    With only one tool, there is no possibility of confusion or overlap between tools. The tool has a single, clear purpose that is distinct by default.

    Naming Consistency5/5

    The single tool name follows a clear verb_noun pattern (DownloadClosedCaptions), and with no other tools, consistency is inherently perfect. There are no deviations or mixed conventions to evaluate.

    Tool Count2/5

    A single tool for a YouTube server is too few for the apparent scope, as YouTube involves many operations like searching videos, getting metadata, or managing playlists. This feels thin and incomplete for the domain.

    Completeness1/5

    The tool surface is severely incomplete for a YouTube server. It only covers downloading closed captions, with no support for core YouTube functionalities such as video search, retrieval, or interaction, leading to significant gaps and agent failures.

    Related MCP Connectors

    Related MCP Servers