
YouTube Transcripts, Search & Summaries
io.github.gunnargray-dev由 GitHub 帳號 gunnargray-dev 發布v1.0.1更新於 Nov 2, 2026
YouTube transcripts, video search, chapters and extractive summaries. No YouTube API key, no LLM.
概覽
託管型 MCP 伺服器,讓助理取得 YouTube 字幕、搜尋影片、取得章節並產生抽取式摘要,不需 YouTube API 金鑰或 LLM。
- 可以做什麼
- 取得影片字幕與中繼資料,可輸出純文字、帶時間戳的段落或 SRT,支援語言優先順序清單與機器翻譯
- 依上傳日期、長度、排序方式與字幕等條件搜尋 YouTube,並為結果抓取字幕
- 取得創作者章節,或由字幕推導出的主題分段,含起訖時間與深層連結
- 不需 LLM 產生抽取式摘要:TL;DR、重點、關鍵詞、分章重點與引文,每項都附時間戳連結
- 適用情境
- 適合需要閱讀、引用或摘要公開 YouTube 影片、依主題尋找影片,或依章節瀏覽長篇演講與播客的情境。可用於研究、附時間戳引用的問答,以及把字幕整理成節目筆記或字幕檔。
- 執行需求
- 需要 Apify 上的遠端 Streamable HTTP 端點,以 Apify API 權杖透過 Authorization bearer 標頭驗證(無法自訂標頭的用戶端可用 token 查詢參數)。需要 Apify 帳號並依事件計費;僅支援 stdio 的用戶端需搭配 mcp-remote 等橋接工具與 Node.js。開源程式碼也可自行在本地部署。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 YouTube Transcripts, Search & Summaries,將其新增到工作區。
- 連接 Authorization token 憑證。它們會被私密儲存,絕不會在公開頁面上展示。
- 為需要使用其工具的對話啟用該服務。
Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。
交給代理程式安裝
把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。
閱讀 https://sourceweft.com/mcp/io.github.gunnargray-dev%2Fyoutube-transcripts-mcp/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。其他 MCP 客戶端
把它新增到你客戶端的 mcpServers 設定中。
{
"mcpServers": {
"youtube-transcripts-search-summaries": {
"type": "http",
"url": "https://parallelstudio--youtube-transcripts-mcp.apify.actor/mcp",
"headers": {
"Authorization": "Bearer <YOUR_TOKEN>"
}
}
}
}README
[YouTube Transcripts MCP logo]
YouTube Transcripts MCP Server
Hosted version (no setup): apify.com/parallelstudio/youtube-transcripts-mcp. Connect any MCP client to
https://parallelstudio--youtube-transcripts-mcp.apify.actor/mcpwith your Apify token, pay per call. This repo is the open-source code; you can also run it locally withnpm install && npm run build && node dist/index.js(stdio).
Give your AI agent YouTube transcripts, search, chapters and summaries. This MCP server fetches the captions of any public YouTube video (as plain text, timestamped segments or SRT) together with its metadata. It also searches YouTube, returns chapters, and builds structured extractive summaries where every point links to the moment it comes from.
Worked examples: four end-to-end workflows with prompts, tool calls, costs and real output are in docs/workflows.md.
It works with Claude Desktop, Claude Code, Cursor, VS Code, Windsurf and any other client that supports MCP over Streamable HTTP. You don't need a YouTube API key or a Google account. No LLM runs on the server, so you don't pay for anyone else's tokens.
What you can do with it
- Research faster. "Summarize this 2-hour podcast and give me the 10 key points with timestamps."
- Answer questions about a video. Load the transcript and let your agent quote and cite exact moments.
- Navigate long videos. Get the creator's chapters. If the video has none, get topic segments derived from the transcript.
- Find sources. Search YouTube with filters for upload date, length, sort order and "has subtitles", then pull transcripts for the best hits.
- Repurpose content. Export SRT subtitles, build show notes, or draft a blog post from a talk, using any caption language or YouTube's machine translation.
Tools
video accepts an 11-character id (dQw4w9WgXcQ) or any YouTube URL: watch?v=, youtu.be/, /shorts/, /embed/, /live/, m. and music. hosts, and youtube-nocookie.com.
All tools are read-only.
Error codes
Failures come back as MCP tool errors (isError: true). The text starts with Error (<CODE>): … and structuredContent.error holds { code, message, retryable, details }, so your agent can react to the code instead of parsing the message:
Pricing
This Actor uses pay-per-event pricing. Tool events are charged only for successful tool calls. Failed calls are not charged as tool events, whether they fail on validation, because the video is private or has no captions, or because YouTube blocks the request. Apify also charges its standard Actor start event ($0.00005 per GB of memory, minimum one event) each time a server instance starts. At the default 512 MB standby memory that's $0.00005 per start, and one running instance serves many calls before it idles out. The Pricing tab on this Actor is the authoritative list of current prices.
A search that returns zero results is still a successful call and is charged as one search event.
Connect your MCP client
Endpoint (Streamable HTTP):
Authenticate with your Apify API token by sending it as Authorization: Bearer <APIFY_TOKEN>.
Cursor (~/.cursor/mcp.json or .cursor/mcp.json)
Windsurf (~/.codeium/windsurf/mcp_config.json)
Claude Desktop (claude_desktop_config.json)
Claude Desktop's config file only launches local (stdio) servers, so bridge to the hosted endpoint with mcp-remote (needs Node.js). The same block works in any other client that only supports stdio:
Clients that can't send headers
Apify also accepts the token as a token query parameter, so a client that only takes a URL can use:
Prefer the Authorization header when your client supports it: a token in a URL can end up in logs. A scoped Apify token limits the damage if it leaks.
Claude Code
VS Code (.vscode/mcp.json)
Example prompts
- "Get the transcript of https://youtu.be/aircAruvnKk and explain the part about gradient descent, citing timestamps."
- "Search for talks about Rust async from the last year, longer than 20 minutes and with subtitles, then summarize the top 3."
- "Give me the chapters of this 3-hour livestream. If it has none, split it by topic."
- "Export German subtitles for this video as SRT. Translate them if there's no German track."
Four of these, with the exact tool calls, per-call costs and real output from live YouTube videos, are in docs/workflows.md:
Example outputs
The excerpts below come from the bundled fixture videos used in the test suite (see demo/transcript.md for every call and response).
get_transcript { "video": "kM3pLz8QwT0", "format": "segments", "include_timestamps": true } (trimmed):
get_video_chapters on a video with no creator chapters (auto-captions only). The chapters are derived from the transcript:
summarize_transcript { "video": "kM3pLz8QwT0", "max_points": 6 } (excerpt):
- Key points: [2:32] When a photon with enough energy hits the silicon, it knocks an electron loose and leaves a hole behind. · [5:09] Solar panels produce direct current, but your home and the electrical grid run on alternating current. · [6:52] A home battery stores surplus solar energy during the day so you can use it in the evening…
- Keywords: panels, cells, inverter, photons, solar, energy, battery, current, solar panel, electrons
- Chapter bullets use the creator's 7 chapters ("Inside a silicon solar cell", "Inverters and the grid"…), with 2 bullets each.
- Quotes: "The inverter converts direct current into alternating current that matches the grid's voltage and frequency exactly." [5:18]
How it works
Transcripts
The server fetches transcripts the same way the popular Python library youtube-transcript-api does:
- Load the watch page. If YouTube shows the EU cookie-consent page, accept it. A reCAPTCHA page is reported as
REQUEST_BLOCKED. The page also yields the InnerTube API key, the publish date, the category and any chapter markers. - Call the InnerTube player API with the ANDROID client context. This returns the video details and the
captionTracks. The playability status is mapped to the error codes above: private, age-restricted, unavailable, unplayable, or "confirm you're not a bot". - Pick a track. For each preferred language in order, manual captions beat auto-generated ones, and an exact code match beats a base-language match (
en-GB→en). Then download the timedtext file. The server parses srv1 XML, srv3 XML and json3.
All three requests for a video go through one proxy session, because YouTube signs caption URLs for the IP that requested them.
Getting past YouTube's IP blocks
YouTube blocks most cloud IPs. In a feasibility probe from Apify, direct requests fetched 1 of 5 test videos. With Apify's datacenter proxy, 4 of 5 worked, and the fifth video simply has no transcript. On the Apify platform this server therefore routes every YouTube request through Apify Proxy (datacenter by default), using sticky sessions and an undici ProxyAgent. When YouTube blocks a session (429, captcha, bot check, empty caption file, network error), the server discards that session and retries with a new IP, up to 5 sessions per call. A healthy session is reused for later calls.
Chapters derived from the transcript
When a video has no creator chapters, the server segments the transcript in a TextTiling style:
- Split the transcript into 20–60 s time blocks and build a TF-IDF vector for each block.
- At each gap between blocks, compare the vocabulary of the two blocks before it with the two blocks after it (cosine similarity). A sharp dip means the topic changed.
- Keep the deepest dips, subject to a minimum chapter length. Then split any chapter that is still much longer than average (time-window fallback).
- Snap each boundary to the nearest sentence start. Title each chapter with the keywords that set it apart from the other chapters, and attach its most central sentence.
Summaries without an LLM
- Build sentences. Punctuated captions are split on punctuation. Auto-captions have no punctuation, so they are re-timed word by word and cut into short chunks at discourse markers ("so", "now", "next"…) and pauses.
[Music]-style tags are removed. - Rank sentences with TextRank: PageRank over a graph weighted by TF-IDF cosine similarity. Very short fragments are down-weighted.
- Choose key points, chapter bullets and quotes with MMR (Maximal Marginal Relevance), so near-duplicates don't repeat. Then put them back in chronological order.
- Score keywords by frequency, weighted by an IDF over 1-minute windows. Unigrams already covered by a selected bigram are dropped.
The method is deterministic and transparent, and it is fast: milliseconds after the transcript is fetched. Because it quotes the speaker's own words, it can't hallucinate.
Limitations
- Public captions only. Private, members-only and age-restricted videos fail with clear error codes. The server never signs in.
- Quality depends on the captions. Auto-generated captions have no punctuation and some recognition errors. Summaries and derived chapters handle this, but creator captions give better sentences.
- Extractive, not abstractive. Summaries quote sentences from the transcript; they don't paraphrase. The stopword list and stemming are tuned for English. Other languages still work, with somewhat noisier keywords.
- Search returns videos only. Channels, playlists and Shorts shelves are excluded, and so are "People also watched" recommendations. Relative dates ("3 weeks ago") are passed through exactly as YouTube shows them.
- Unofficial endpoints. InnerTube and timedtext are the APIs YouTube's own apps use, but they are undocumented and can change. The server retries with backoff and rotates proxies. Responses are cached in memory for 10 minutes.
- Live streams. Ongoing live streams usually have no transcript until they end.
FAQ
Do I need a YouTube Data API key or a Google account? No. You only need an Apify account and token to call this hosted server.
Which languages are supported?
Any language YouTube has captions for. Pass a priority list such as ["de", "en"]. If none of them exist, the best available track is returned along with a note, unless you set fallback_to_any_language: false. With translate_to, YouTube machine-translates the track.
How long can videos be?
There's no fixed limit. A transcript costs one transcript event however long it is. For very long videos, use max_chars or summarize_transcript to keep your agent's context small.
Why did I get REQUEST_BLOCKED?
YouTube rejected every proxy IP the server tried for that call. This is usually temporary, so retry after a short pause. Blocked calls are not charged.
Is any data stored? No. The server is stateless and keeps only a short in-memory cache. It writes nothing to datasets or key-value stores.
Can I self-host it?
Yes. See below. Residential IPs can usually reach YouTube directly. On cloud servers, set YT_PROXY_URL.
Self-hosting and development
On Apify (Standby mode). When APIFY_IS_AT_HOME is set, the server calls Actor.init(), forces HTTP mode, and listens on 0.0.0.0:$ACTOR_WEB_SERVER_PORT. GET / answers the Standby readiness probe and MCP is served at /mcp. YouTube traffic goes through Apify Proxy. The HTTP server has no authentication of its own: on Apify, the platform authenticates requests with your API token. If you self-host it beyond localhost, put it behind an auth proxy.
Tests
- Unit tests (
test/unit/*.test.mjs,node --test) run against hand-made fixtures that mirror real YouTube responses: ANDROID player JSON, srv1/json3 timedtext, WEB search pages with continuations and shelves, watch pages including a reCAPTCHA page, and every error status. They cover parsing, track selection, description and derived chapters, TextRank and summaries, the searchparamsencoding, error mapping, and proxy session rotation. - MCP smoke test (
test/smoke.mjs) spawns the server over stdio withYT_FIXTURES, lists the tools, calls each tool (including error paths), checks that billing charges only successful calls, checks HTTP mode and the readiness probe, and writesdemo/transcript.{json,md}. - Live remote test (
test/live-remote.mjs, not part ofnpm test) runs against a deployed Standby URL:MCP_URL=… APIFY_TOKEN=… node test/live-remote.mjs. npm run fixturesregeneratestest/fixtures/fromscripts/make-fixtures.mjs.
Related
- App Store & Google Play Review Intelligence MCP: the same pay-per-call setup for app reviews. Your agent gets top complaints, rating by app version, regressions after a release, and side-by-side competitor comparisons for any iOS or Android app. Source: GitHub.
License
MIT
來源:README.md,提交 b2c945c
工具
0版本歷史
2- v1.0.1最新Oct 26, 2026
- v1.0.0Oct 13, 2026
評分
已滿足適用檢查項的 85%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通必需25 分
- 已宣告認證方式必需10 分
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分