
MCP服务器和CLI工具,使AI代理能够访问YouTube。
概览
YouTube知识丰富,但被困在那里。AI代理无法原生访问。这个仓库附带了两个包来解决这个问题:一个是AI代理的MCP服务器,另一个是终端的CLI。 - 获取文字记录(纯文本或带时间戳)- 下载.md格式的文字记录 - 获取视频元数据 - 在字幕内搜索 - 下载视频或音频 - MCP:@umbertotancorre/youtube-mcp - CLI:@umbertotancorre/youtube-cli download_video和download_audio完全自成体系。YT-DLP和FFMPEG在NPM安装时自动下载。 把这个添加到你的MCP客户端配置中(例如claude_desktop_config.json): 所有工具都会自动显示。不需要安装,npx第一次运行时就能处理。 下载总是会进入平台原生的 Downloads 文件夹: 这是一个包含三个包的 npm workspaces 单仓库:
概述(AI 翻译)
零设置 ·无API密钥 ·无账户 ·开源
YouTube知识丰富,但被困在那里。AI代理无法原生访问。这个仓库附带了两个包来解决这个问题:一个是AI代理的MCP服务器,另一个是终端的CLI。
- 获取转录(纯文本或带时间戳)
- 下载文字记录为
.md - 获取视频元数据
- 字幕内搜索
- 下载视频或音频
可用格式:
- MCP:
@umbertotancorre/youtube-mcp - CLI:
@umbertotancorre/youtube-cli
全部本地。不需要API密钥。
目录
- MCP服务器
- 工具
- 安装
- CLI
- 命令
- 安装
- 发展
- 免责声明
- 许可证
MCP服务器
工具
| 工具 | 描述 |
|---|---|
get_transcript |
获取完整逐字稿,作为明文 |
get_transcript_timed |
每段时间戳的文字记录 |
download_transcript |
将文字记录保存为.md文件 |
download_transcript_timed |
将文字记录保存为带有时间戳的.md文件 |
get_metadata |
返回标题、频道、发布日期、观看次数、时长、点赞和描述 |
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
YouTube MCP server and CLI
Zero Setup · No API Key · No Account · Open Source
YouTube is full of knowledge, but it is trapped there. AI agents cannot access it natively. This repo ships two packages that fix that: an MCP server for AI agents and a CLI for the terminal.
- Fetch transcript (plain text or with timestamps)
- Download transcript as
.md - Get video metadata
- Search within captions
- Download video or audio
Available as:
All locally. No API keys required.
Table of Contents
MCP Server
Tools
| Tool | Description |
|---|---|
get_transcript |
Fetches the full transcript as plain text |
get_transcript_timed |
Transcript with [MM:SS] timestamps per segment |
download_transcript |
Saves transcript as a .md file |
download_transcript_timed |
Saves transcript as a .md file with timestamps |
get_metadata |
Returns title, channel, publish date, view count, duration, likes, and description |
search_transcript |
Searches for a keyword or phrase and returns matching segments with timestamps |
download_video |
Downloads video+audio as .mp4 |
download_audio |
Downloads audio as .mp3 (or m4a, flac, opus, …) |
download_video and download_audio are fully self-contained. yt-dlp and ffmpeg are downloaded automatically on npm install.
Installation
Method A: let your AI do it
Tell your AI agent:
Add youtube-mcp as an MCP server. Run it with: npx @umbertotancorre/youtube-mcp
Method B: manual config
Add this to your MCP client config (e.g. claude_desktop_config.json):
{
"mcpServers": {
"youtube": {
"command": "npx",
"args": ["-y", "@umbertotancorre/youtube-mcp"]
}
}
}
All tools appear automatically. No install needed, npx handles it on first run.
CLI
Commands
youtube-cli transcript Print transcript as plain text
youtube-cli transcript --timestamps Include [MM:SS] timestamps
youtube-cli transcript --save Save as .md to Downloads
安装
npx -y @umbertotancorre/youtube-mcp配置
{
"mcpServers": {
"youtube": {
"command": "npx",
"args": ["-y", "@umbertotancorre/youtube-mcp"]
}
}
}