yt-mcp
Manages YouTube channels, videos, uploads, comments, playlists, and analytics through the YouTube Data API and YouTube Analytics API. Enables operations like retrieving channel info, listing/managing videos, uploading videos, moderating comments, managing playlists, and fetching analytics reports.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
yt-mcp — YouTube MCP Server
MCP server quản lý kênh YouTube (Data API v3 + Analytics), kiến trúc stateless
theo tinh thần Facebook MCP: server không lưu token người dùng. Client giữ
refresh token, server đổi ra access token và cache RAM theo sha256(refresh_token).
Xem thiết kế chi tiết + lý do từng quyết định: docs/thiet-ke.md.
Kiến trúc
server.py → khai báo tool @mcp.tool() (passthrough mỏng)
manager.py → điều phối, ráp tham số
youtube_api.py → gọi Data API v3 + Analytics (google-api-python-client)
auth.py → refresh→access + cache theo hash(refresh token)
jobs.py → upload async in-memory (job)
web.py → route /auth, /auth/callback, /upload
config.py → scope + hằng số
run_http.py → streamable-http (stateless) + gắn route webRelated MCP server: YouTube MCP Server
Chuẩn bị Google Cloud (1 lần)
Tạo project ở Google Cloud Console (tài khoản
hoangtuanbka93@gmail.com).Bật YouTube Data API v3 và YouTube Analytics API.
OAuth consent screen: External → Publish app → In production (chấp nhận "unverified"; nếu Testing thì refresh token chết sau 7 ngày).
Tạo OAuth client ID kiểu Web application. Thêm Authorized redirect URI:
https://<host>.<tailnet>.ts.net/auth/callback.Lấy
client_id+client_secret.
Cấu hình & chạy
Tạo file .env cạnh compose.yaml:
GOOGLE_CLIENT_ID=xxx.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=xxx
PUBLIC_BASE_URL=https://my-host.tailnet-name.ts.netdocker compose up -d --buildEndpoint MCP:
https://<host>.<tailnet>.ts.net/mcpTrang lấy token:
https://<host>.<tailnet>.ts.net/authTrang đẩy file:
https://<host>.<tailnet>.ts.net/upload
Lấy refresh token (1 lần)
Mở https://<host>.<tailnet>.ts.net/auth bằng browser → đồng ý (bấm qua cảnh báo
"unverified app" 1 lần) → trang hiện refresh token → copy.
Khai báo ở MCP client
"yt-mcp": {
"url": "https://<host>.<tailnet>.ts.net/mcp",
"headers": { "x-youtube-refresh-token": "1//dán_refresh_token_ở_đây" }
}Quản nhiều kênh = khai báo nhiều kết nối, mỗi cái một refresh token khác.
Upload video
source của youtube_video_upload nhận 3 dạng:
Nguồn |
| Cách đưa file lên |
File trên laptop | id | mở |
File có URL |
| server tự tải |
File trên máy chủ |
| bỏ vào thư mục |
Upload chạy nền → trả job_id → poll bằng youtube_upload_status(job_id).
Danh sách tool (~30)
Channel:
youtube_channel_get(bỏ trống = whoami),youtube_channel_updateVideo:
youtube_video_get,youtube_video_list_mine,youtube_video_update,youtube_video_delete,youtube_video_rate,youtube_video_set_privacyUpload:
youtube_video_upload,youtube_upload_statusSearch:
youtube_searchComment:
youtube_comment_list,youtube_comment_thread_get,youtube_comment_reply,youtube_comment_moderate,youtube_comment_deletePlaylist:
youtube_playlist_create/list/get/update/delete,youtube_playlist_items,youtube_playlist_item_add/removeAnalytics:
youtube_analytics_video/channel/top_videos
Ràng buộc đã biết
Quota dùng chung: 1 OAuth app = 10.000 unit/ngày cho mọi client (upload=1.600/lần). Chạm trần thì xin Google nâng quota.
Upload file client-local luôn 2 bước (đẩy file → gọi tool).
Job upload lưu in-memory → mất khi restart container.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Hosted MCP for YouTube Studio: uploads, metadata, playlists, comments, analytics, captions.
YouTube MCP — wraps the YouTube Data API v3 (BYO API key)
Real-time YouTube transcripts, comments, channels & video search MCP. Local npx or hosted OAuth.
An MCP server that gives any LLM or agent clean YouTube transcripts on demand: a single video, a whole channel, or a playlist, plus AI cleanup of auto-generated captions. API-key auth, credit-based, same backend as the public v1 API. Get a free API key with 25 free credits at youtubetranscriptdownload.com/account.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceA fully functional MCP server and CLI for YouTube to automate YouTube operation.723Apache 2.0
- AlicenseAqualityBmaintenanceA comprehensive MCP server integrating YouTube Data, Analytics, and Reporting APIs, providing 40 tools for channel management, analytics, video publishing, transcripts, SEO, and comments.4031MIT
- FlicenseBqualityDmaintenanceMCP server for YouTube Data API v3 enabling video search, channel lookup, trending content, comments, and playlist management.11-
- AlicenseAqualityDmaintenanceA local-first MCP server for inspecting and managing a creator-owned YouTube channel, using Google's official YouTube Data API v3 and Analytics API.1011 npmMIT