YouTube Transcripts

io.github.fbetteo由 GitHub 帳號 fbetteo 發布v1.0.0更新於 Oct 25, 2026

Transcripts from YouTube videos, whole channels and playlists for AI agents, with bulk ZIP export.

已驗證Streamable HTTP可網頁執行網頁搜尋與抓取媒體與設計

概覽

AI 產生的概覽

託管式 MCP 伺服器,可取得單一影片、頻道與播放清單的 YouTube 字幕,並支援批次 ZIP 匯出。

可以做什麼
依 URL 或 ID 取得單一 YouTube 影片的字幕,可選擇附上時間戳,並在開始工作前取得頻道中繼資料。依頻道工作使用的順序列出頻道影片與時長資訊,並預覽工作會下載多少部影片。啟動非同步工作,下載整個頻道或播放清單的字幕。輪詢工作狀態,工作完成後取得 ZIP 下載連結,並可取消工作、退還未處理的影片。
適用情境
適合助理需要把 YouTube 影片的口語內容當作文字脈絡時使用,例如摘要或檢索單一影片,或批次收集某個頻道或播放清單的字幕。
執行需求
需要透過網路連線到供應商的託管 API 遠端端點。需要供應商 API 存取頁面核發的 bearer API 金鑰,放在 Authorization 標頭中。README 也記錄了本機 npm 命令列工具與 stdio 伺服器,會從 YOUTUBE_TRANSCRIPT_API_KEY 環境變數讀取金鑰。
安裝前請注意
需要放在 Authorization 標頭中的 API 金鑰,請妥善保密。批次頻道與播放清單工作會消耗帳戶額度,取消時只退還未處理的影片。工作會寫入資料並產生 ZIP 下載,影片 URL 及頻道或播放清單識別碼會傳送給第三方供應商。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 YouTube Transcripts,將其新增到工作區。
  2. 連接 Authorization token 憑證。它們會被私密儲存,絕不會在公開頁面上展示。
  3. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.fbetteo%2Fyoutube-transcripts/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "youtube-transcripts": {
      "type": "http",
      "url": "https://api.youtubetranscripts.fbetteo.com/mcp",
      "headers": {
        "Authorization": "Bearer <YOUR_TOKEN>"
      }
    }
  }
}

README

YouTube Transcript Agent

Turn any YouTube video, playlist, or channel into agent-ready transcript context.

This package provides:

  • ytx, a CLI for transcripts, channel jobs, playlist jobs, polling, and ZIP downloads
  • a local stdio MCP server for coding agents and desktop assistants
  • docs for using the hosted /mcp endpoint and Developer API

Install

Run without installing:

bash
npx youtube-transcript-agent --help

Or install globally:

bash
npm install -g youtube-transcript-agentytx --help

Authentication

The CLI reads auth in this order:

  1. YOUTUBE_TRANSCRIPT_API_KEY
  2. local config created by ytx auth set-key

Set an API key:

bash
npx youtube-transcript-agent auth set-key <api_key>

Or use environment variables:

bash
export YOUTUBE_TRANSCRIPT_API_KEY=<api_key>

PowerShell:

powershell
$env:YOUTUBE_TRANSCRIPT_API_KEY="<api_key>"

CLI Usage

Get account credits:

bash
npx youtube-transcript-agent credits

Fetch one transcript:

bash
npx youtube-transcript-agent transcript FOp280ZAxhg --timestamps

Download channel transcripts:

bash
npx youtube-transcript-agent channel download "@mkbhd" --max 25 --wait --output channel.zip

Download playlist transcripts:

bash
npx youtube-transcript-agent playlist download <playlist_url_or_id> --max 25 --wait --output playlist.zip

Poll a job:

bash
npx youtube-transcript-agent jobs status <job_id>

Download a completed job:

bash
npx youtube-transcript-agent jobs download <job_id> --output transcripts.zip

Local MCP

Start the local stdio MCP server:

bash
npx youtube-transcript-agent mcp

This command waits for JSON-RPC messages on stdin. Agent clients should launch it with:

text
Command: npxArgs: youtube-transcript-agent mcpEnv:  YOUTUBE_TRANSCRIPT_API_KEY=<api_key>

Available MCP tools:

  • get_transcript
  • get_channel_info
  • list_channel_videos
  • start_channel_job
  • start_playlist_job
  • get_job_status
  • get_download_url

Manual smoke test:

bash
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | npx youtube-transcript-agent mcp

Hosted MCP

If your API server is deployed with hosted MCP enabled:

text
Endpoint: https://api.youtubetranscripts.fbetteo.com/mcpAuth: Authorization: Bearer <api_key>

List tools:

bash
curl -X POST "https://api.youtubetranscripts.fbetteo.com/mcp" \  -H "Content-Type: application/json" \  --data-raw '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'

Call a tool:

bash
curl -X POST "https://api.youtubetranscripts.fbetteo.com/mcp" \  -H "Authorization: Bearer <api_key>" \  -H "Content-Type: application/json" \  --data-raw '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"get_transcript","arguments":{"video_url":"FOp280ZAxhg"}}}'

Agent Skill

The repo includes an installable skill template at:

text
agent-skill/skill.md

For distribution, publish that file as the root skill.md in a separate public skill repo.

Troubleshooting

Advanced API Host Override

Most users do not need to set an API URL. The package defaults to the hosted production API.

Only set a custom base URL for local development, staging, self-hosted deployments, or debugging:

bash
export YOUTUBE_TRANSCRIPT_API_BASE_URL=http://127.0.0.1:8000

Or save it in local CLI config:

bash
npx youtube-transcript-agent auth set-key <api_key> --base-url http://127.0.0.1:8000

Troubleshooting

If fetch failed appears and the API logs show nothing, the CLI is not reaching the API host. Check:

bash
echo "$YOUTUBE_TRANSCRIPT_API_BASE_URL"echo "$API_BASE_URL"cat ~/.youtube-transcript-agent/config.json 2>/dev/null

The CLI base URL priority is:

  1. YOUTUBE_TRANSCRIPT_API_BASE_URL
  2. API_BASE_URL
  3. saved local config
  4. package default

On Windows PowerShell, quote channel handles:

powershell
node cli/dist/cli.js channel download "@mkbhd" --max 2 --wait

PowerShell aliases curl to Invoke-WebRequest; use curl.exe or Invoke-RestMethod.

來源:README.MD,提交 4be56f6

工具

8

get_transcript

Return the transcript for a single YouTube video URL or ID.

輸入參數video_url必填include_timestamps

get_channel_info

Return metadata for a YouTube channel before starting a job.

輸入參數channel必填

list_channel_videos

List a YouTube channel's videos with duration metadata, in the order channel jobs use (long-form, then Shorts, then livestreams; newest first). limit=N previews what start_channel_job with max_videos=N downloads; has_more tells if the channel has more.

輸入參數limitchannel必填

start_channel_job

Start an async job that downloads channel transcripts.

輸入參數channel必填max_videosconcatenate_allinclude_timestamps

start_playlist_job

Start an async job that downloads playlist transcripts.

輸入參數playlist必填max_videosconcatenate_allinclude_timestamps

get_job_status

Poll an async transcript job and get a download URL when ready.

輸入參數job_id必填

get_download_url

Return the ZIP download URL for a completed job.

輸入參數job_id必填

cancel_job

Cancel an async transcript job and refund unprocessed videos.

輸入參數job_id必填

版本歷史

1
  1. v1.0.0最新Oct 15, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。