返回市场
双子座-MCP

双子座-MCP

作者:boxabirds6 星标更新:2025-08-05

项目介绍

YouTube Transcript MCP Server

一个基于模型上下文协议(MCP)的服务器,使AI编码助手(如Claude、Cursor、Windsurf等)能够分析YouTube视频的文字记录。该服务器使用Gemini API处理YouTube视频并提取其文字记录以回答问题,从而使视频内容可供您的AI助手进行分析、总结和学习。

功能

🤖 多客户端支持:适用于Claude Code、Cursor、Windsurf和其他兼容MCP的客户端

  • 🌍 跨平台:提供Windows、macOS和Linux的安装程序
  • 🚀 简易安装:通用安装程序自动检测并配置您的AI客户端

预备条件

安装程序会自动检查所有依赖项,并在缺少任何组件时提供特定于平台的安装说明。

安装

方案1:无需Git的快速安装(推荐)

这些安装程序直接下载服务器,无需git:

macOS/Linux/WSL

curl

curl -sSL https://raw.githubusercontent.com/boxabirds/yt-gemini-mcp/main/install-mcp-universal-no-git.sh | bash

wget

wget -qO- https://raw.githubusercontent.com/boxabirds/yt-gemini-mcp/main/install-mcp-universal-no-git.sh | bash

Windows (PowerShell)

# 快速安装
iwr -useb https://raw.githubusercontent.com/boxabirds/yt-gemini-mcp/main/install-mcp-universal-no-git.ps1 | iex

Windows (命令提示符)

为了最简单的体验,请下载两个文件:

# 下载PowerShell安装程序及其包装器
curl -O https://raw.githubusercontent.com/boxabirds/yt-gemini-mcp/main/install-mcp-universal-no-git.ps1
curl -O https://raw.githubusercontent.com/boxabirds//yt-gemini-mcp/main/install-mcp-universal-no-git.cmd

# 运行安装程序
install-mcp-universal-no-git.cmd

或者直接使用上述的PowerShell。

方案2:GitHub Gist安装

您也可以将这些脚本作为GitHub Gists分享:

# Unix/Linux/macOS
curl -sSL https://gist.github.com/YOUR_USERNAME/GIST_ID/raw/install-mcp-universal-no-git.sh | bash

# Windows
iwr -useb https://gist.github.com/YOUR_USERNAME/GIST_ID/raw/install-mcp-universal-no-git.ps1 | iex

方案3:使用Git的手动安装

如果您更喜欢克隆仓库:

macOS/Linux

# 克隆并运行安装程序
git clone https://github.com/your-username/yt-gemini-mcp.git
cd yt-gemini-mcp
chmod +x install-mcp-universal.sh
./install-mcp-universal.sh

Windows

# 克隆并运行安装程序
git clone https://github.com/your-username/yt-gemini-mcp.git
cd yt-gemini-mcp
install-mcp-universal.cmd

安装程序做了什么

  1. 检查依赖项:验证Python、jq(Unix/Linux/macOS)及其他要求
  2. 下载MCP服务器:获取YouTube文字记录服务器(如果使用无git安装程序)
  3. 检测AI助手:自动查找已安装的客户端(Claude、Cursor、Windsurf、Gemini CLI)
  4. 配置每个客户端:为每个检测到的助手设置服务器
  5. 管理API密钥:一次请求Gemini API密钥并安全存储以便重复使用
  6. 安装Python包:设置所需依赖项(mcp、fastmcp、google-genai)

使用方法

安装后,服务器将在您的AI助手中的ask-youtube可用。

在Claude Code中

你能分析一下这个关于Python异步编程的YouTube视频吗?
https://www.youtube.com/watch?v=example123

Claude将自动使用ask-youtube服务器来获取并分析视频内容。

测试安装

安装后,您可以测试服务器:

macOS

~/Library/Application\ Support/YouTube-Transcript-MCP/test-server.sh

Linux

~/.mcp-installer/test-server.sh

Windows

%LOCALAPPDATA%\.mcp-installer\test-server.cmd

文件位置

安装程序在以下位置创建文件:

  • 服务器文件
    • macOS: ~/Library/Application Support/YouTube-Transcript-MCP/servers/
    • Linux: ~/.mcp-installer/servers/
    • Windows: %LOCALAPPDATA%\.mcp-installer\servers\
  • 虚拟环境
    • macOS: ~/Library/Application Support/YouTube-Transcript-MCP/venv/
    • Linux: ~/.mcp-installer/venv/
    • Windows: %LOCALAPPDATA%\.mcp-installer\venv\
  • 客户端配置
    • Claude Code: 由claude mcp add命令管理
    • Cursor: ~/.cursor/mcp.json%USERPROFILE%\.cursor\mcp.json
    • Windsurf: 平台特定位置
    • Gemini CLI: ~/.gemini/settings.json%USERPROFILE%\.gemini\settings.json

安装程序功能

  • 无需Git:无git安装程序通过HTTPS直接下载文件
  • 独立:单个脚本,没有外部依赖
  • 多客户端支持:自动配置所有检测到的AI助手
  • 备用URL:如果主要下载失败,尝试多个CDN源
  • 安全:API密钥存储具有受限文件权限
  • 跨平台:适用于Windows、macOS和Linux

故障排除

“未检测到支持的AI助手”

确保至少安装了一个支持的客户端,并且它位于系统PATH中(对于像Claude Code这样的命令行工具)。

“缺少必需的依赖项”

根据错误消息安装缺失的依赖项。安装程序提供了特定于平台的安装命令。

jq未找到(Unix/Linux/macOS):

# macOS
brew install jq

# Ubuntu/Debian
sudo apt-get install jq

# RHEL/CentOS
sudo yum install jq

Python未找到:

“API密钥不能为空”

您必须提供有效的Gemini API密钥。从Google AI Studio获取。

下载失败

安装程序尝试多个来源:

  1. GitHub原始内容
  2. jsDelivr CDN
  3. GitCDN

如果全部失败,您可能需要:

  • 检查您的互联网连接
  • 核实防火墙设置
  • 尝试手动下载

服务器未出现在AI助手中

  1. 重新启动您的AI助手应用程序
  2. 检查安装是否成功完成
  3. 验证配置文件存在于上述列出的位置

客户端未被检测到

确保AI助手安装在默认位置:

  • Gemini CLI~/.gemini/
  • Claude Codeclaude命令在PATH中可用
  • Windsurf:标准安装目录
  • Cursor~/.cursor/%USERPROFILE%\.cursor\

安全注意事项

  • API密钥存储在keys.json中,具有受限文件权限(仅限所有者)
  • 切勿共享或提交包含API密钥的keys.json文件或测试脚本
  • 测试脚本包含明文API密钥——不要共享它们
  • 考虑在生产环境中使用环境变量以增加安全性

更新

要更新服务器,只需再次运行安装程序。它将:

  • 下载最新服务器版本
  • 保留您的API密钥
  • 更新所有客户端配置

贡献

欢迎贡献!请随时提交Pull Request。

许可证

此项目是开源的,可在MIT许可证下获得。