mcptube

作者 0xchamin已验证

Transform YouTube videos into a compounding knowledge base with transcripts, vision analysis, and agentic search. Works as an MCP server for Claude, Copilot & more.

151
Stars
12
Forks
Python
语言
2026/8/23
添加时间

⚠️ 第三方软件声明

本 Skill 为第三方开源软件,独立托管于 GitHub。SkillTip 仅为信息目录,不控制或维护底层仓库。所显示的安全检查为自动化且范围有限,安装前请自行审查源码。

阅读服务条款

安装

添加到你的 Claude Code skills 目录:

# Add to your Claude Code skills
git clone https://github.com/0xchamin/mcptube

快速入门

使用 mcptube 等 Skills 的指南。

安全报告

已验证

上次扫描:—

{
  "status": "PASSED",
  "issues": []
}

README.md

🎬 mcptube

Convert any YouTube video into an AI-queryable MCP server.

PyPI Python License: MIT

mcptube extracts metadata, transcripts, and frames from YouTube videos, indexes them for semantic search, and exposes everything as both a CLI tool and an MCP (Model Context Protocol) server. Ask questions, generate reports, discover new videos, and synthesize themes — all from your terminal or AI assistant.


✨ Features

FeatureCLIMCP Server
Add/remove YouTube videos
List library with tags
Full video details + transcript
Semantic search (single/cross-video)
Frame extraction by timestamp
Frame extraction by query
Ask questions about videos✅ (BYOK)✅ (passthrough)
LLM classification/tagging✅ (BYOK)✅ (passthrough)
Illustrated reports (single video)✅ (BYOK)✅ (passthrough)
Cross-video reports✅ (BYOK)✅ (passthrough)
YouTube discovery + clustering✅ (BYOK)
Cross-video synthesis✅ (BYOK)✅ (passthrough)
Smart video resolver (ID/index/text)

BYOK = Bring Your Own Key (Anthropic, OpenAI, or Google) Passthrough = The MCP client's own LLM does the analysis — zero API key required on the server


📦 Installation

Prerequisites

  • Python 3.12 or 3.13 (ChromaDB is not yet compatible with Python 3.14)
  • ffmpeg — required for frame extraction (install guide)

Recommended: pipx (CLI + MCP server)

pipx install mcptube --python python3.12

This installs mcptube globally and makes it available to all MCP clients without activating a virtual environment.

Alternative: pip (virtual environment)

python3.12 -m venv venv
source venv/bin/activate
pip install mcptube

⚠️ macOS/Homebrew users: Global pip install will fail with "externally-managed-environment". Use pipx or a virtual environment instead.

Verify installation

mcptube --help

🚀 Quick Start

# 1. Add a YouTube video
mcptube add "https://www.youtube.com/watch?v=dQw4w9WgXcQ"

# 2. List your library
mcptube list

# 3. Search the transcript
mcptube search "main topic"

# 4. Extract a frame at 30 seconds
mcptube frame 1 30

# 5. Ask a question about it
mcptube ask "What is this video about?" -v 1

💡 Always wrap multi-word arguments in double quotes — e.g. mcptube search "neural networks", not mcptube search neural networks.


📖 CLI Reference

Library Management

CommandDescriptionExample
mcptube add "<url>"Ingest a YouTube videomcptube add "https://youtu.be/dQw4w9WgXcQ"
mcptube listList all videos with tagsmcptube list
mcptube info <query>Show full video detailsmcptube info 1 or mcptube info "dQw4w9WgXcQ"
mcptube remove <query>Remove a videomcptube remove 1

Search & Frames

CommandDescriptionExample
mcptube search "<query>"Semantic search across all videosmcptube search "machine learning"
mcptube search "<query>" --video <id>Search within a specific videomcptube search "intro" --video 1
mcptube frame <video> <timestamp>Extract frame at timestampmcptube frame 1 30
mcptube frame-query <video> "<query>"Extract frame by transcript matchmcptube frame-query 1 "key moment"

Ask Questions (BYOK)

CommandDescriptionExample
mcptube ask "<question>" -v <video>Ask about a single videomcptube ask "What are the main points?" -v 1
mcptube ask "<question>" -v <id1> -v <id2>Ask across multiple videosmcptube ask "What do they agree on?" -v 1 -v 2

Analysis & Reports (BYOK)

CommandDescriptionExample
mcptube classify <video>LLM classification/taggingmcptube classify 1
mcptube report <video> [--focus] [--format] [-o]Single-video illustrated reportmcptube report 1 --format html -o report.html
mcptube report-query "<topic>" [--tag] [--format] [-o]Cross-video reportmcptube report-query "AI trends" --format html -o report.html
mcptube discover "<topic>"YouTube search + LLM clusteringmcptube discover "prompt engineering"
mcptube synthesize-cmd "<topic>" -v <id1> -v <id2>Cross-video synthesismcptube synthesize-cmd "AI" -v abc123 -v xyz789 --format html -o synthesis.html

Server

CommandDescriptionExample
mcptube serveStart MCP server (Streamable HTTP)mcptube serve
mcptube serve --stdioStart MCP server (stdio transport)mcptube serve --stdio
mcptube serve --host 0.0.0.0 --port 8080Custom host/portmcptube serve --host 0.0.0.0 --port 8080

Smart Video Resolver

All commands that accept a <video> or <query> argument support the smart resolver:

InputResolution
dQw4w9WgXcQExact YouTube video ID
1Index number from mcptube list (1-based)
"prompting"Case-insensitive substring match on title or channel

🔌 MCP Server

mcptube exposes 17 MCP tools that any MCP-compatible AI assistant can use.

Transport Modes

ModeCommandUse Case
Streamable HTTPmcptube serveClaude Code, remote clients
stdiomcptube serve --stdioVS Code Copilot, Claude Desktop, Cursor

MCP Tools

ToolDescriptionAPI Key Required
add_video(url)Ingest a YouTube videoNo
remove_video(video_id)Remove from libraryNo
list_videos()List all videosNo
get_info(video_id)Full details + transcriptNo
search(query, video_id?, limit)Semantic search (single video)No
search_library(query, tags?, limit)Semantic search (all videos)No
get_frame(video_id, timestamp)Extract frame (returns image)No
get_frame_by_query(video_id, query)Search + extract frameNo
get_frame_data(video_id, timestamp)Frame as base64No
ask_video(video_id, question)Ask about a video (passthrough)No
ask_videos(video_ids, question)Ask across videos (passthrough)No
classify_video(video_id)Get metadata for classificationNo
save_tags(video_id, tags)Save classification tagsNo
generate_report(video_id, query?)Report data (passthrough)No
generate_report_from_query(query, tags?)Cross-video report dataNo
discover_videos(topic)YouTube search resultsNo
synthesize(video_ids, topic)Cross-video synthesis dataNo

Passthrough tools return raw data (transcripts, metadata) for the connected AI to analyze. This means zero API key cost on the server — the client's own LLM does the work.


🖥️ MCP Client Setup

Claude Code (Streamable HTTP)

  1. Start the mcptube server:
mcptube serve
  1. In a separate terminal, add the MCP server to Claude Code:
claude mcp add --transport http mcptube http://127.0.0.1:9093/mcp
  1. Start using it:
> Use mcptube to add this video: https://www.youtube.com/watch?v=dQw4w9WgXcQ
> Search mcptube for "main topic"
> Generate a report for the first video

💡 Claude Code has terminal access, so it can also run CLI commands directly for better report quality.

VS Code Copilot (stdio)

  1. Open MCP configuration (Cmd+Shift+P → "MCP: Open User Configuration") or create .vscode/mcp.json in your workspace:
{
  "servers": {
    "mcptube": {
      "command": "mcptube",
      "args": ["serve", "--stdio"]
    }
  }
}
  1. Click the Start button next to the server entry.

  2. Open Copilot Chat in Agent Mode and start using mcptube tools.

⚠️ If you installed mcptube in a virtual environment (not via pipx), you'll need the full path to the executable. Find it with which mcptube.

Claude Desktop (stdio)

  1. Open the config file:
open ~/Library/Application\ Support/Claude/claude_desktop_config.json
  1. Add the mcptube server:
{
  "mcpServers": {
    "mcptube": {
      "command": "/Users/<your-username>/.local/bin/mcptube",
      "args": ["serve", "--stdio"]
    }
  }
}

💡 Use the full path to mcptube (find it with which mcptube). If you used pipx, it's typically at ~/.local/bin/mcptube.

  1. Restart Claude Desktop. You should see a tools icon (🔨) in the chat input.

Cursor (stdio)

  1. Open Cursor Settings → MCP Servers, or edit .cursor/mcp.json:
{
  "mcpServers": {
    "mcptube": {
      "command": "mcptube",
      "args": ["serve", "--stdio"]
    }
  }
}
  1. Restart Cursor and use mcptube tools in Agent mode.

🔑 API Keys (BYOK)

Some CLI features require an LLM API key. Set one of:

export ANTHROPIC_API_KEY=sk-ant-...
# or
export OPENAI_API_KEY=sk-...
# or
export GOOGLE_API_KEY=AI...

What requires a key?

FeatureCLIMCP
Add videoNo (auto-classifies if key set)No
Search / FramesNoNo
Ask questions✅ Key requiredNo (passthrough)
Classify✅ Key requiredNo (passthrough)
Reports✅ Key requiredNo (passthrough)
Discover✅ Key requiredNo (via yt-dlp)
Synthesize✅ Key requiredNo (passthrough)

MCP passthrough = The connected AI assistant (Claude, Copilot, etc.) analyzes the data using its own model. No API key needed on the mcptube server.


⚖️ CLI (BYOK) vs MCP: When to Use Which

CLI with BYOKMCP Passthrough
SpeedFaster — direct API callSlower — client processes raw data
AccuracyMore deterministic — fine-tuned prompts per taskDepends on client LLM interpretation
Frame selectionGuided by specialized promptsClient may hallucinate timestamps
Context limitsNo limit (streams to LLM API)May exceed client context window on long videos
CostUses your API keyZero cost — uses client's own model
OutputMarkdown or HTML filesInline in chat

Recommendation: Use CLI commands for reports, synthesis, and discovery. Use MCP tools for quick queries, search, and frame extraction.


🔄 Workflows

Discovery → Add → Synthesize

# 1. Scout YouTube for relevant videos
mcptube discover "transformer architecture"

# 2. Add interesting videos to your library
mcptube add "https://www.youtube.com/watch?v=..."
mcptube add "https://www.youtube.com/watch?v=..."

# 3. Synthesize themes across them
mcptube synthesize-cmd "attention mechanisms" -v <id1> -v <id2> --format html -o synthesis.html

📌 discover results are NOT in your library. You must add them before you can search, ask, or synthesize.

Ask → Deep Dive → Report

# 1. Ask a quick question
mcptube ask "What are the main arguments?" -v 1

# 2. Search for specific moments
mcptube search "key conclusion" --video 1

# 3. Extract a frame at that moment
mcptube frame 1 245

# 4. Generate a full illustrated report
mcptube report 1 --format html -o report.html

⚙️ Environment Variables

VariableDefaultDescription
MCPTUBE_DATA_DIR~/.mcptubeRoot directory for all data (DB, frames, ChromaDB)
MCPTUBE_FRAMES_DIR<data_dir>/framesDirectory for cached extracted frames
MCPTUBE_HOST127.0.0.1Server bind host
MCPTUBE_PORT9093Server bind port
ANTHROPIC_API_KEYAnthropic API key (for CLI BYOK features)
OPENAI_API_KEYOpenAI API key (for CLI BYOK features)
GOOGLE_API_KEYGoogle API key (for CLI BYOK features)

🏗️ Architecture

CLI (Typer)  ←──────┐
                     ├── Service Layer (McpTubeService)
MCP Server (FastMCP) ←─┘        │
                           ┌────┴────┐
                     Repository    VectorStore
                     (SQLite)      (ChromaDB)
                           │
                     Ingestion Layer
                     ├── YouTubeExtractor (yt-dlp)
                     ├── FrameExtractor (yt-dlp + ffmpeg)
                     ├── LLMClient (LiteLLM — CLI only)
                     ├── ReportBuilder (CLI only)
                     └── VideoDiscovery (CLI only)

⚠️ Known Issues & Limitations

  • Frame storage: Frames are cached in ~/.mcptube/frames (hidden directory). Override with MCPTUBE_FRAMES_DIR.
  • Python 3.14: ChromaDB is not yet compatible with Python 3.14. Use Python 3.12 or 3.13.
  • Long transcripts: Very long videos may exceed MCP client context limits in passthrough mode. CLI BYOK is recommended for long-form content.
  • Multi-video frame accuracy: Cross-video reports may occasionally select frames from the wrong video. CLI reports use stricter prompts for better accuracy.
  • Claude Desktop: Report generation may fail on context-heavy operations. Use shorter videos or CLI for reports.
  • get_frame_data: Returns base64-encoded frames that can exceed client token limits (50K+ characters). Prefer get_frame for inline display.
  • Concurrent access: Running CLI and MCP server simultaneously may cause SQLite conflicts.

🧪 Development

git clone https://github.com/0xchamin/mcptube.git
cd mcptube
pip install -e ".[dev]"
pytest -v

📄 License

MIT License — see LICENSE for details.


Built with FastMCP · yt-dlp · ChromaDB · LiteLLM

常见问题

What is mcptube?

mcptube is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by 0xchamin. Transform YouTube videos into a compounding knowledge base with transcripts, vision analysis, and agentic search. Works as an MCP server for Claude, Copilot & more. It has 151 GitHub stars.

Is mcptube safe to use?

Yes. mcptube passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install mcptube?

Clone the repository with "git clone https://github.com/0xchamin/mcptube" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is mcptube written in?

mcptube is primarily written in Python. It is open-source under 0xchamin on GitHub, so you can review or fork the full source.

Are there alternatives to mcptube?

Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh mcptube against similar tools.

评论 (0)

暂无评论,成为第一个分享想法的人!

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情

claude-code

by anthropics

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

120,03119,897Shell
AI 智能体
查看详情

开发者还喜欢

基于喜欢此 Skill 的开发者投票和收藏

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情