YouTube字幕提取器

MCP服务器,用于从给定的YouTube链接中提取字幕。

  • by aliencube
  • Bicep
  • 混合部署
  • 3 星标
  • 更新于
在 GitHub 查看 aliencube/mcp-youtube-subtitles-extractor

使用说明

MCP服务器:Youtube字幕提取器

👉👉👉 移动到https://github.com/microsoft/mcp-dotnet-samples 👈👈👈

这是一个MCP服务器,从给定的YouTube链接中提取字幕。

先决条件

入门指南

在本地运行Azure Functions MCP服务器

  1. 获取存储库根目录

    # bash/zsh
    REPOSITORY_ROOT=$(git rev-parse --show-toplevel)
    
    # PowerShell
    $REPOSITORY_ROOT = git rev-parse --show-toplevel
    
  2. 运行功能应用程序

    cd $REPOSITORY_ROOT/src/McpYouTubeSubtitlesExtractor.FunctionApp
    func start
    

远程运行Azure Functions MCP服务器

  1. 登录Azure

    # Login with Azure CLI
    az login
    
    # Login with Azure Developer CLI
    azd auth login
    
  2. 将Function应用程序部署到Azure

    azd up
    

    在配置和部署时,系统会要求您提供订阅ID、位置、环境名称和vNet

  3. 部署完成后,通过运行以下命令获取信息:

    • 功能应用程序名称:

      azd env get-value AZURE_FUNCTION_NAME
      
    • MCP服务器访问密钥:

      # bash/zsh
      az functionapp keys list \
          -g rg-$(azd env get-value AZURE_ENV_NAME) \
          -n $(azd env get-value AZURE_FUNCTION_NAME) \
          --query "systemKeys.mcp_extension" -o tsv
      
      # PowerShell
      az functionapp keys list `
          -g rg-$(azd env get-value AZURE_ENV_NAME) `
          -n $(azd env get-value AZURE_FUNCTION_NAME) `
          --query "systemKeys.mcp_extension" -o tsv
      

将MCP服务器连接到MCP主机/客户端

VS代码+代理模式+本地MCP服务器

  1. 通过键入打开命令面板 F1 或 Ctrl+Shift+P 在Windows或 Cmd+Shift+P 在Mac OS上,搜索 MCP: List Servers.

  2. 选择 mcp-youtube-subtitles-extractor-function-local 然后单击 Start Server.

  3. 输入如下提示:

    Summarise this YouTube video link in 5 bullet points: https://youtu.be/XwnEtZxaokg?si=V39ta45iMni_Uc_m
    
  4. 它会要求你逃跑 get_available_languages 随后 get_subtitle。您可能会被要求为字幕选择语言。

  5. 确认视频摘要。

MCP检查器+本地MCP服务器

  1. 运行MCP检查器

    npx @modelcontextprotocol/inspector node build/index.js
    
  2. 打开web浏览器,从应用程序显示的URL导航到MCP Inspector web应用程序(例如。http://0.0.0.0:5173)

  3. 将运输类型设置为 SSE

  4. 将URL设置为正在运行的Function应用程序的SSE端点,然后 连接:

    http://0.0.0.0:7071/runtime/webhooks/mcp/sse
    
  5. 点击 列出工具.

  6. 点击工具 运行工具 带有YouTube链接和语言代码,如 en 或 ko.

VS代码+代理模式+远程MCP服务器

  1. 通过键入打开命令面板 F1 或 Ctrl+Shift+P 在Windows或 Cmd+Shift+P 在Mac OS上,搜索 MCP: List Servers.

  2. 选择 mcp-youtube-subtitles-extractor-function-remote 然后单击 Start Server.

  3. 输入功能应用程序名称。

  4. 输入MCP服务器访问密钥。

  5. 输入如下提示:

    Summarise this YouTube video link in 5 bullet points: https://youtu.be/XwnEtZxaokg?si=V39ta45iMni_Uc_m
    
  6. 它会要求你逃跑 get_available_languages 随后 get_subtitle。您可能会被要求为字幕选择语言。

  7. 确认视频摘要。

MCP检查器+远程MCP服务器

  1. 运行MCP检查器

    npx @modelcontextprotocol/inspector node build/index.js
    
  2. 打开web浏览器,从应用程序显示的URL导航到MCP Inspector web应用程序(例如。http://0.0.0.0:5173)

  3. 将运输类型设置为 SSE

  4. 将URL设置为正在运行的Function应用程序的SSE端点,然后 连接:

    https://<functionapp-name>.azurewebsites.net/runtime/webhooks/mcp/sse?code=<functions-mcp-extension-system-key>
    
  5. 点击 列出工具.

  6. 点击工具 运行工具 带有YouTube链接和语言代码,如 en 或 ko.