youtube-mcp
Enables YouTube search, video details, channels, playlists, and comments scraping via MCP, no API key required.
README
<p align="center"> <img src="https://capsule-render.vercel.app/api?type=waving&color=0:ff0000,100:cc0000&height=120§ion=header&text=youtube-mcp&fontSize=42&fontColor=ffffff&animation=fadeIn" alt="youtube-mcp" /> </p>
<p align="center"> <b>YouTube video search · channels · playlists · comments</b><br/> <sub>Scrape YouTube in your MCP clients — no official API key required</sub> </p>
<p align="center"> <a href="https://github.com/iamkw0n/youtube-mcp/stargazers"><img src="https://img.shields.io/github/stars/iamkw0n/youtube-mcp?style=for-the-badge&logo=github&color=cc0000" alt="Stars"/></a> <a href="https://github.com/iamkw0n/youtube-mcp/network/members"><img src="https://img.shields.io/github/forks/iamkw0n/youtube-mcp?style=for-the-badge&logo=github&color=cc0000" alt="Forks"/></a> <a href="https://github.com/iamkw0n/youtube-mcp/issues"><img src="https://img.shields.io/github/issues/iamkw0n/youtube-mcp?style=for-the-badge&logo=github&color=cc0000" alt="Issues"/></a> <a href="./LICENSE"><img src="https://img.shields.io/badge/license-MIT-cc0000?style=for-the-badge" alt="License"/></a> </p>
<p align="center"> <a href="https://modelcontextprotocol.io"><img src="https://img.shields.io/badge/MCP-stdio-cc0000?style=flat-square&logo=anthropic" alt="MCP"/></a> <a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%3E%3D20-339933?style=flat-square&logo=node.js&logoColor=white" alt="Node"/></a> <a href="https://www.typescriptlang.org"><img src="https://img.shields.io/badge/TypeScript-3178C6?style=flat-square&logo=typescript&logoColor=white" alt="TypeScript"/></a> <a href="https://www.youtube.com"><img src="https://img.shields.io/badge/source-www.youtube.com-ff0000?style=flat-square&logo=youtube&logoColor=white" alt="YouTube"/></a> </p>
<p align="center"> <a href="#-quick-start">Quick Start</a> · <a href="#-tools">Tools</a> · <a href="#-client-setup">Client Setup</a> · <a href="#-examples">Examples</a> · <a href="#-faq">FAQ</a> · <a href="https://github.com/iamkw0n/youtube-mcp/issues/new">Report Bug</a> </p>
<details> <summary><b>📑 Table of contents (Click to show)</b></summary>
- Important Notices
- Features
- Quick Start
- Tools
- One-Click Install Prompt
- Client Setup
- Examples
- How It Works
- FAQ
- License
</details>
⚠️ Important Notices
[!IMPORTANT] This project does not use the official YouTube Data API v3. It parses public web pages (
ytInitialData). If YouTube changes its page structure, some features may break. Personal, non-commercial use is recommended.
[!WARNING] Excessive requests may get blocked by YouTube. If that happens often, enable the Zyte proxy with the
ZYTE_API_KEYenvironment variable.
✨ Features
| 🔍 Video search | Keyword search with sort, date, and duration filters |
| 📺 Video details | Views, likes, duration, and more by ID or URL |
| 📡 Channels | Look up channels by ID, @handle, or URL |
| 📋 Playlists | Playlist metadata and video lists |
| 💬 Comments | Top and recent comments on a video |
| 🔌 stdio MCP | Works with Cursor, Claude, Codex, and other local clients |
| 🔑 No API key | No Google Cloud API key required |
🚀 Quick Start
git clone https://github.com/iamkw0n/youtube-mcp.git
cd youtube-mcp
npm install
npm run build
npm start
Or run directly with tsx:
npx tsx src/index.ts
🛠 Tools
| Tool | Description |
|---|---|
search_videos |
Search videos by keyword |
get_video |
Get video details by ID or URL |
get_videos |
Batch-fetch multiple videos |
search_channels |
Search channels by keyword |
get_channel |
Get channel info by ID, @handle, or URL |
get_channel_videos |
List recent videos from a channel |
get_playlist |
Get playlist metadata |
get_playlist_items |
List videos in a playlist |
get_video_comments |
Fetch video comments |
api_status |
Check scraping and proxy status |
💬 One-Click Install Prompt
Paste this into Cursor, Claude Code, or Codex to ask the agent to install the MCP server:
Clone iamkw0n/youtube-mcp from GitHub and set up the MCP server for me.
🔧 Client Setup
| Client | Config file | stdio |
|---|---|---|
| Cursor | .cursor/mcp.json |
✅ |
| Claude Code | .mcp.json |
✅ |
| Claude Desktop | claude_desktop_config.json |
✅ |
| Codex | .codex/config.toml |
✅ |
| ChatGPT | Connector URL | ❌ |
Cursor
Add to .cursor/mcp.json in your project root:
{
"mcpServers": {
"youtube-mcp": {
"command": "node",
"args": ["/absolute/path/to/youtube-mcp/dist/index.js"],
"cwd": "/absolute/path/to/youtube-mcp"
}
}
}
With Zyte proxy (optional):
{
"mcpServers": {
"youtube-mcp": {
"command": "node",
"args": ["/absolute/path/to/youtube-mcp/dist/index.js"],
"cwd": "/absolute/path/to/youtube-mcp",
"env": {
"ZYTE_API_KEY": "${env:ZYTE_API_KEY}"
}
}
}
}
Claude Code
Add to .mcp.json in your project root:
{
"mcpServers": {
"youtube-mcp": {
"type": "stdio",
"command": "node",
"args": ["/absolute/path/to/youtube-mcp/dist/index.js"]
}
}
}
CLI:
claude mcp add youtube-mcp -s project -- node /absolute/path/to/youtube-mcp/dist/index.js
Claude Desktop
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"youtube-mcp": {
"command": "node",
"args": ["/absolute/path/to/youtube-mcp/dist/index.js"],
"cwd": "/absolute/path/to/youtube-mcp"
}
}
}
[!WARNING] Claude Desktop does not support
${workspaceFolder}. Use absolute paths.
OpenAI Codex
In .codex/config.toml or ~/.codex/config.toml:
[mcp_servers.youtube-mcp]
command = "node"
args = ["/absolute/path/to/youtube-mcp/dist/index.js"]
cwd = "/absolute/path/to/youtube-mcp"
enabled = true
CLI:
codex mcp add youtube-mcp -- node /absolute/path/to/youtube-mcp/dist/index.js
Verify in a Codex session with /mcp.
ChatGPT
[!IMPORTANT] ChatGPT connectors only support HTTPS MCP endpoints. This repo is a local stdio server and cannot be connected to ChatGPT directly.
💡 Examples
Search YouTube for TypeScript tutorial videos
Get details for this video: https://www.youtube.com/watch?v=dQw4w9WgXcQ
Show me the 5 most recent videos from @GoogleDevelopers
What videos are in this playlist? https://www.youtube.com/playlist?list=PL...
⚙️ How It Works
flowchart LR
A[MCP Client] -->|stdio| B[youtube-mcp]
B -->|fetch HTML| C[www.youtube.com]
B -->|parse| D[ytInitialData]
B -->|pagination| E[InnerTube continuation]
| Step | Description |
|---|---|
| Page fetch | Download public YouTube HTML pages |
| Data extraction | Parse ytInitialData and ytInitialPlayerResponse JSON |
| Pagination | Load more results via InnerTube continuation tokens |
📄 License
MIT © iamkw0n
<p align="center"> <sub>Built with ❤️ by <a href="https://github.com/iamkw0n">iamkw0n</a> · Unofficial project, not affiliated with YouTube or Google</sub> </p>
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。