PolarHub
  • Agents
  • MCP Servers
  • Skills
  • PolarBear
PolarHub © 2026
MCP ServerssearchMCP YouTube 字幕服务器
返回「search」

MCP YouTube 字幕服务器

modelscope·@sinco-lab/mcp-youtube-transcript

search0下载HostedModelScope

简介

一个模型上下文协议服务器,可实现从YouTube视频中检索字幕。该服务器通过简单界面提供对视频字幕和 subtitle 的直接访问,使其非常适合内容分析和处理。

MCP Server 详情

来自 ModelScope 索引

MCP YouTube 字幕服务器

smithery 徽章

这是一个 Model Context Protocol 服务器,能够从 YouTube 视频中检索字幕。该服务器通过一个简单的接口直接访问视频字幕,非常适合内容分析和处理。

<a href="https://glama.ai/mcp/servers/@sinco-lab/mcp-youtube-transcript"> <img width="380" height="200" src="https://glama.ai/mcp/servers/@sinco-lab/mcp-youtube-transcript/badge" alt="mcp-youtube-transcript" /> </a>

目录

  • 功能
  • 开始使用
    • 前提条件
    • 安装
  • 使用方法
    • 基本配置
    • 测试
    • 故障排除与维护
  • API 参考
  • 开发
  • 贡献
  • 许可

功能

✨ 主要功能:

  • 从 YouTube 视频中提取字幕
  • 支持多种语言
  • 以连续或段落模式格式化文本
  • 检索视频标题和元数据
  • 自动段落分割
  • 文本规范化和 HTML 实体解码
  • 强大的错误处理
  • 时间戳和重叠检测

开始使用

前提条件

  • Node.js 18 或更高版本

安装

我们提供了两种安装方法:

方法 1:手动配置(推荐用于生产环境)

  1. 创建或编辑 Claude Desktop 配置文件:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  2. 添加以下配置:

{
  "mcpServers": {
    "youtube-transcript": {
      "command": "npx",
      "args": [
        "-y",
        "@sinco-lab/mcp-youtube-transcript"
      ]
    }
  }
}

适用于 macOS 的快速设置脚本:

# Create directory if it doesn't exist
mkdir -p ~/Library/Application\ Support/Claude

# Create or update config file
cat > ~/Library/Application\ Support/Claude/claude_desktop_config.json << 'EOL'
{
  "mcpServers": {
    "youtube-transcript": {
      "command": "npx",
      "args": [
        "-y",
        "@sinco-lab/mcp-youtube-transcript"
      ]
    }
  }
}
EOL

方法 2:通过 Smithery(仅限开发)

npx -y @smithery/cli install @sinco-lab/mcp-youtube-transcript --client claude

⚠️ 注意:此方法不推荐用于生产环境,因为它依赖于 Smithery 的代理服务。

使用方法

基本配置

要与 Claude Desktop / Cursor / cline 一起使用,请确保您的配置匹配:

{
  "mcpServers": {
    "youtube-transcript": {
      "command": "npx",
      "args": ["-y", "@sinco-lab/mcp-youtube-transcript"]
    }
  }
}

测试

与 Claude 应用程序

  1. 安装后重启 Claude 应用程序
  2. 使用简单命令进行测试:
    https://www.youtube.com/watch?v=AJpK3YTTKZ4 总结这个视频
    

示例输出: 演示

与 MCP Inspector

# Clone and setup
git clone https://github.com/sinco-lab/mcp-youtube-transcript.git
cd mcp-youtube-transcript
npm install
npm run build

# Launch inspector
npx @modelcontextprotocol/inspector node "dist/index.js"

# Access http://localhost:5173 and try these commands:
# 1. List Tools: clink `List Tools`
# 2. Test get_transcripts with:
#    url: "https://www.youtube.com/watch?v=AJpK3YTTKZ4"
#    lang: "en" (optional)
#    enableParagraphs: false (optional)

故障排除与维护

检查 Claude 日志

要监控 Claude 的日志,可以使用以下命令:

tail -n 20 -f ~/Library/Logs/Claude/mcp*.log

这将显示日志文件的最后 20 行,并继续显示新增加的条目。

注意:Claude 应用会自动为 MCP 服务器日志文件添加 mcp-server- 前缀。例如,我们的服务器的日志将写入到 mcp-server-youtube-transcript.log 文件中。

清理 npx 缓存

如果您遇到与 npx 缓存相关的问题,可以手动清理缓存:

rm -rf ~/.npm/_npx

这将移除缓存的包并允许你重新开始。

API 参考

get_transcripts

从 YouTube 视频中获取字幕。

参数:

  • url (字符串, 必填): YouTube 视频 URL 或 ID
  • lang (字符串, 可选): 语言代码 (默认: "en")
  • enableParagraphs (布尔值, 可选): 启用段落模式 (默认: false)

响应格式:

{
  "content": [{
    "type": "text",
    "text": "Video title and transcript content",
    "metadata": {
      "videoId": "video_id",
      "title": "video_title",
      "language": "transcript_language",
      "timestamp": "processing_time",
      "charCount": "character_count",
      "transcriptCount": "number_of_transcripts",
      "totalDuration": "total_duration",
      "paragraphsEnabled": "paragraph_mode_status"
    }
  }]
}

开发

项目结构

├── src/
│ ├── index.ts            # Server entry point
│ ├── youtube.ts          # YouTube transcript fetching logic
├── dist/                 # Compiled output
└── package.json

关键组件

  • YouTubeTranscriptFetcher: 核心字幕获取功能
  • YouTubeUtils: 文本处理和工具函数

功能与能力

  • 错误处理:

    • 无效的 URL/ID
    • 不可用的字幕
    • 语言可用性
    • 网络错误
    • 请求频率限制
  • 文本处理:

    • HTML 实体解码
    • 标点符号规范化
    • 空格规范化
    • 智能段落检测

贡献

我们欢迎贡献!请随时提交问题和拉取请求。

许可证

此项目根据 MIT 许可证发布 - 查看 LICENSE 文件以获取详细信息。

相关项目

  • mcp-servers
  • MCP Inspector

相关 MCP Servers(来自「search」)

【稳定版】12306MCP火车票服务

一个为大型语言模型(LLM)设计的、高可用的12306余票查询工具服务,现已搭载智能会话管理引擎。 12306-MCP-Server 将复杂的12306余票查询接口封装为符合 Model Context Protocol (MCP) 规范的工具集,允许AI Agent通过自然语言无缝查询实时火车票、中转换乘和经停站信息。 从 v1.0.0 版本开始,项目引入了全新的智能会话管理系统,通过会话池、动态User-Agent轮换和自动错误恢复机制,将服务的稳定性与反屏蔽能力提升至全新高度。

Alphar/Railway-Real-Time-MCP-Server

代码上下文MCP

一个MCP服务器,它在本地git仓库上提供语义搜索功能,使用户能够克隆仓库、处理分支并通过矢量化代码块搜索代码。

@fkesheh/code-context-mcp

代码索引MCP

一种模型上下文协议(MCP)服务器,可以帮助大型语言模型以最少的设置来索引、搜索和分析代码库。

@johnhuang316/code-index-mcp

代码知识记忆库工具

通过向量嵌入技术,为项目提供记忆库和RAG上下文支持,以增强代码理解和管理,并与RooCode和Cline集成。

@davidvc/code-knowledge-mcptool

飞常准-Aviation

VariFlight航班信息服务的模型上下文协议(MCP)服务器实现方案。该服务器提供了多种工具,支持查询航班信息、天气数据及航班舒适度指标。

@variflight-ai/variflight-mcp

火车时刻查询服务

基于GTFS数据的Caltrain火车时刻查询服务,提供实时火车时刻表、站点查询和时间特定查询功能。

myalone/caltrain

自动安装

点击按钮会唤起 PolarBear 客户端,并把当前 MCP Server 的 Markdown 详情文档地址传给客户端。

/api/mcps/sinco-lab-mcp-youtube-transcript/markdown
打开 PolarBear 安装查看 Markdown 文档

手动安装

在 PolarBear 或其他支持 MCP 的客户端中,新建 MCP Server,并参考下方来源或安装提示配置。

适用于 macOS 的快速设置脚本: ```bash # Create directory if it doesn't exist mkdir -p ~/Library/Application\ Support/Claude # Create or update config file cat > ~/Library/Application\ Support/Claude/claude_desktop_config.json << 'EOL' { "mcpServers": { "youtube-transcript": { "command": "npx", "args": [ "-y", "@sinco-lab/mcp-youtube-transcript" ] } } } EOL

基本信息

分类
search / image-and-video-processing
运行方式
Yes
许可证
MIT License
详情文件
sinco-lab-mcp-youtube-transcript.md