
vid2context
io.github.nirholas由 GitHub 帳號 nirholas 發布v0.1.1更新於 Nov 14, 2026
Turn any video into context for AI agents: transcripts, metadata, chapters, timestamps.
概覽
把影片、播放清單、播客和本機媒體檔案轉成附時間戳的逐字稿、中繼資料與章節,供助理閱讀與引用。
- 可以做什麼
- 取得單一影片的逐字稿、中繼資料、章節、片段、留言、關鍵時刻與字幕軌
- 把播放清單、頻道、訂閱來源或網頁展開成影片清單,並跨多部影片產生脈絡包、摘要與重複偵測
- 根據逐字稿回答問題、產生附引用的簡報,或依自訂結構擷取資訊
- 把影片存入收藏集,並搜尋已儲存的逐字稿
- 轉寫直播串流,並匯出到 Obsidian 或 Notion
- 列出可用的模型與供應商
- 適用情境
- 當研究素材以影片或音訊形式存在時適用,例如課程系列、研討會演講、播客、產品評測;可讓助理不必觀看就能摘要、比較或回答問題,並附上集數與時間點引用。
- 執行需求
- 以 npm 套件 vid2context-mcp 透過 stdio 在本機執行,需要 Node.js 22 或更新版本。不需要任何金鑰:字幕與免金鑰語音轉寫服務即可直接使用。選用金鑰 GEMINI_API_KEY、GROQ_API_KEY、OPENAI_API_KEY,以及供本機服務使用的 LOCAL_STT_BASE_URL 與 OLLAMA_BASE_URL。存取線上來源需要網路。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 vid2context,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
vid2context
[npm] [License: Apache-2.0] [Node 22+] [Ask DeepWiki]
Turn any video into context for AI agents. An MCP server, CLI, HTTP API and library that gives Claude, ChatGPT, Cursor, VS Code Copilot and any other agent the transcript, metadata and chapters of a video, playlist, podcast or media file, with timestamps it can cite.
Paste a video link or drop in a media file. vid2context returns the transcript, metadata and chapters in a form your agent can read and cite: plain text with [m:ss] timestamps, JSON, Markdown, SRT, VTT, or one Markdown context pack for many videos that you can upload to ChatGPT Projects, Claude Projects or a custom GPT.
It is free first. Local models run first, then hosted free tiers with your own key, then keyless hosts that need no account. Paid APIs are used last, and only when you set their key. With zero configuration it already works.
Why
Research happens on video. A playlist explaining which used car to buy, a conference talk, a course, a podcast. Agents cannot watch any of it. vid2context turns those videos into text with timestamps, so an agent can absorb a whole series and answer "which model year should I buy?" while citing the episode and the moment that said so.
Design rule: raw transcripts are always kept. Summaries, briefs and extractions are an added layer, never a replacement.
How it works
For every input, vid2context resolves the source, fetches metadata and chapters, then walks a fallback chain until it has a transcript:
- Creator-uploaded captions
- Platform auto-captions
- Download the audio and run speech-to-text
- Video model mode, where a multimodal model watches the video so on-screen text, slides and code are captured too (planned)
Each speech-to-text and LLM step runs through a rung chain. A rung is one provider, one model and one credential. Rungs are tried in tier order and the chain falls through on errors, rate limits and outages, with cooldowns so a failing rung is skipped for a while. Every attempt is recorded, so you can always see what was tried and why it succeeded or failed:
Status
First release (0.1.0), on npm as vid2context-mcp and vid2context. Everything below is built and covered by tests that replay real recorded responses.
Planned: video mode, where a multimodal model watches the whole video. The --mode video flag exists, but no provider implements it yet.
Quick start (zero keys)
Requires Node.js 22 or newer.
From source:
A local audio or video file works too. With no keys set, it is transcribed by the keyless OVH Whisper rung:
More in docs/examples: runnable examples for the library, CLI, HTTP API, MCP, LangChain and Python, each a file in examples/ whose output on the page is checked by the tests.
CLI
Common flags: -f, --format text|json|markdown|srt|vtt|pack, -t, --timestamps, --mode auto|captions|stt|video, --lang <code>, --policy free|local-only|quality, --only and --skip (rung ids or services), --json, -o, --out <file>, --verbose. Run vid2context help <command> for the rest. Full reference: docs/cli.md.
Program output goes to stdout and everything else to stderr, so vid2context URL > transcript.txt stays clean. On failure the CLI prints the error code, a hint on how to fix it, and every attempt that was made, and exits with a code per failure kind (3 unsupported input, 4 not found, 6 no transcript, 9 rate limited, 10 auth, and so on).
Use it from your agent
The MCP server is the npm package vid2context-mcp, listed in the MCP Registry as io.github.nirholas/vid2context. It needs no keys.
[Install in VS Code] [Install in VS Code Insiders] [Install in Cursor]
Claude Code
Codex, Gemini CLI
Claude Desktop, Cursor, Windsurf, Cline and other clients
To pass a key, add "env": { "GROQ_API_KEY": "..." } to the entry. Agents setting this up for you can follow llms-install.md.
From source
From the repo root:
Tools
Ask your agent something like "get the transcript of https://youtu.be/jNQXAC9IVRw and summarize it with timestamps". The server exposes 28 tools:
It also ships the prompts brief, buyer_guide and digest, and resources for saved videos, transcripts and collections (collections are subscribable). Failures come back as tool errors carrying the error code, hint and attempts, so the agent can explain the problem or retry with another mode. Details: docs/guides/mcp.md.
ChatGPT and Claude.ai
These connect only to remote MCP servers over HTTPS. Two options:
- Context pack:
vid2context pack <url>...writes one Markdown file for one or many videos, sized for upload to a ChatGPT Project, Claude Project or custom GPT. Zero setup. - Remote MCP: run the Streamable HTTP server with a bearer token or the built-in single-owner OAuth 2.1 server, behind a Cloudflare Tunnel so requests to YouTube still come from your own connection. See docs/guides/remote-mcp.md and docs/guides/cloudflare-tunnel.md.
Add free keys (optional)
Everything is optional. Each key you add unlocks more rungs, and the chain uses them before falling back to keyless hosts. Set them in your shell or a .env file.
Speech-to-text
LLM
Every model id can be overridden with <PROVIDER>_MODEL (a comma-separated list, in order) for LLMs, or <PROVIDER>_STT_MODEL for speech-to-text. To pool several free keys for one provider, put the extras in <PROVIDER>_FALLBACK_KEYS, for example GROQ_FALLBACK_KEYS=key2,key3. Each key becomes its own rung.
Chain controls
Architecture
TypeScript, ESM and npm workspaces, so the same code runs on Node, Cloudflare Workers, Vercel and in the browser.
Key decisions:
- Providers are separate packages. Each declares the runtimes it supports in its
package.json("vid2context": {"runtimes": [...]}) and default-exports a provider.npm run genbuilds one registry per runtime, so Node-only providers never end up in a Workers or browser bundle. - Plain
fetchover vendor SDKs. Most speech-to-text and LLM APIs are OpenAI-compatible HTTP, which keeps providers edge-compatible and dependencies few. - Providers never read
process.envor the globalfetch. Everything comes through thectxobject passed to each call, so the same provider works in every runtime and in tests. - Formats live in one map. Every surface lists formats from
formattersinpackages/core/src/format, so a new formatter appears in the CLI, MCP and API at once. - stdout is for output only. Logs go to stderr, which keeps CLI pipes and the MCP stdio protocol clean.
Start reading at packages/core/src/types.ts, packages/core/src/provider.ts and packages/core/src/chain.ts.
Development
Tests use real responses recorded from the live services, never invented data. Live tests run only with LIVE=1.
Adding a provider
- Create
providers/<name>/with apackage.jsonthat names the package@vid2context/provider-<name>, depends on@vid2context/core, and declares"vid2context": {"runtimes": [...]}. - Default-export a provider built with
defineProviderfromsrc/index.ts. Read config and make requests only throughctx. - Add tests under
providers/<name>/test/with a recorded fixture, plus a live test gated byLIVE=1. - Run
npm install(ornpm run gen) to pick it up in the registry. Never hand-edit the generated files.
Roadmap
Next up: video mode (a multimodal model watches the video, so on-screen action is captured as well as speech), Gemini and Deepgram or AssemblyAI speech-to-text, and podcast feeds with podcast:transcript. DRM services are out of scope. The full plan and what each work item covers is in docs/ROADMAP.md.
FAQ
How do I give Claude, ChatGPT or Cursor a YouTube video? Add the MCP server (above) and paste the link into your chat. The agent calls get_transcript and gets the transcript with [m:ss] timestamps. ChatGPT and Claude.ai need the remote MCP server or a context pack upload (see ChatGPT and Claude.ai).
Does it need an API key? No. Creator captions and auto-captions need no key, and speech-to-text falls back to keyless hosts. Keys only add faster or local options.
What if a video has no captions? vid2context downloads the audio and runs speech-to-text, preferring a local Whisper server, then free tiers such as Groq, then keyless hosts.
Can I keep AI processing on my machine? Point it at a local speech-to-text server and a local LLM and set VID2CONTEXT_POLICY=local-only. No hosted AI service is used; fetching a YouTube video still needs the network, a local file does not.
Is it a YouTube transcript API? Yes: a library, a CLI and an HTTP API with OpenAPI (vid2context serve, see docs/guides/http-api.md). It returns text, JSON and timestamps, keeps the raw transcript, and records every provider it tried.
Does it work on long videos and whole playlists? Yes. Agents read the outline first and fetch only the chapters they need (about 12k tokens per hour of speech), long audio is split and transcribed in parallel, and list_items or vid2context list expands a playlist, channel or feed into its videos.
License
來源:README.md,提交 02c729a
工具
0版本歷史
1- v0.1.1最新Nov 14, 2026
評分
已滿足適用檢查項的 90%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具必需15 分
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分