vid2context

v0.2.1
io.github.nirholas/vid2context Checked 4 days ago Published 16 days ago

Turn any video into context for AI agents: transcripts, metadata, chapters, timestamps.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

get_transcript Get video transcript

The full transcript of one video or local media file, with a header (title, channel, URL, duration, how the transcript was made, chapters). With timestamps (the default) every line starts with [m:ss] so you can cite moments. Uses creator captions, then platform auto-captions, then speech-to-text. Cost: speech is about 12k tokens per hour of video. For videos longer than about 20 minutes, call get_outline first and read only the sections you need with get_section, or set maxTokens to receive the transcript in pages (each page ends with a cursor for the next one). Formats: text (Plain transcript…

ParameterTypeDescription
url *stringVideo URL (YouTube and more), a YouTube video id, or a local media file path
cursorstringContinuation cursor from a previous partial result (like "seg:412"). Use the same other arguments
formatstringOutput format (see list_formats). Default: text
languagestringPreferred transcript language (BCP-47, e.g. en, de). Default: the spoken language
maxTokensintegerLargest result to return, in estimated tokens. Longer transcripts come back in pages with a continuation cursor
modestringTranscript strategy: auto (captions, then speech-to-text), captions only, stt (always transcribe), video (multimodal model). Default: auto
timestampsbooleanPrefix lines with [m:ss] timestamps. Default: true

get_metadata Get video metadata

Title, channel, description, duration, publish date, chapters, tags and language for a video URL or local file, without fetching the transcript. Cheap: a few hundred tokens, mostly the description.

ParameterTypeDescription
url *stringVideo URL (YouTube and more), a YouTube video id, or a local media file path

list_formats List output formats

The output formats get_transcript and get_section accept (text, json, markdown, srt, vtt, pack, ...), with what each is for. combinesVideos marks formats that can merge several videos into one document (export_context_pack). Cheap: under 500 tokens.

get_outline Get video outline

Start here for any video longer than about 20 minutes. Returns the metadata and the video's chapters (or sections of about five minutes when it has none), each with its start time, a timestamp link and its estimated token count, plus the total. Then read only what you need with get_section (by chapter index or title, or by time). Fetches the transcript once (saved for later calls); the outline itself costs about 300 to 1,500 tokens.

ParameterTypeDescription
url *stringVideo URL (YouTube and more), a YouTube video id, or a local media file path
languagestringPreferred transcript language (BCP-47, e.g. en, de). Default: the spoken language
modestringTranscript strategy: auto (captions, then speech-to-text), captions only, stt (always transcribe), video (multimodal model). Default: auto

get_section Get a transcript section

One chapter or time range of a video's transcript, with the same header as get_transcript. Pass chapter (an index or title from get_outline) or from/to (seconds, m:ss or h:mm:ss); from alone reads to the end, to alone reads from the start. Cost: the section's token count from get_outline (about 1k tokens per 5 minutes of speech).

ParameterTypeDescription
url *stringVideo URL (YouTube and more), a YouTube video id, or a local media file path
chapterA chapter index from get_outline, or a chapter title (exact, prefix, then substring match, case-insensitive)
formatstringOutput format. Default: text
fromStart time: seconds (754), m:ss (12:34) or h:mm:ss (1:02:03). Default: the start
languagestringPreferred transcript language (BCP-47, e.g. en, de). Default: the spoken language
modestringTranscript strategy: auto (captions, then speech-to-text), captions only, stt (always transcribe), video (multimodal model). Default: auto
timestampsbooleanPrefix lines with [m:ss] timestamps. Default: true
toEnd time (exclusive), same forms as from. Default: the end

get_comments Get video comments

Top comments of a video, with creator replies and pinned comments flagged. Useful for corrections, follow-up questions and audience consensus that the video itself lacks. Cost: about 50 tokens per comment; limit defaults to 50. Only sources whose provider can read comments support this.

ParameterTypeDescription
url *stringVideo URL (YouTube and more), a YouTube video id, or a local media file path
limitintegerMost comments to return. Default: 50

list_items List the videos in a playlist, channel or feed

Expand a playlist, channel, podcast feed or page into its videos (a single video URL returns itself). A video URL that also names a playlist (watch?v=...&list=...) returns the video plus `list`, the playlist; pass playlist: true to expand the playlist instead. Use it to see what a list contains before reading, or pass the list straight to add_to_collection. Cost: about 40 tokens per item; limit defaults to 50.

ParameterTypeDescription
url *stringPlaylist, channel, feed or page URL
limitintegerMost items to return. Default: 50
playlistbooleanWhen url is a video link that also names a playlist (list=), list the playlist instead of the one video

export_context_pack Export a context pack

One Markdown document for many videos (the pack format): a header per video with title, channel, URL and chapters, then each transcript in timestamped paragraphs. Set maxTokens to fit a budget: the pack trims transcripts to fit and says what it left out. Cost: about 12k tokens per hour of video unless maxTokens caps it. Prefer get_outline, get_section and search_transcript when you only need parts.

ParameterTypeDescription
collectionstringExport this saved collection (id or name)
limitintegerMost videos taken from each playlist, channel or feed. Default: 50
maxTokensintegerToken budget for the whole pack
urlsarrayVideo, playlist, channel or feed URLs (lists are expanded into their videos)

list_models List models

The models (rungs) this server can use for speech-to-text, LLM, embedding, video and visual work, in free-first order: tier (local, free, keyless, paid), quality 1 to 5, capabilities (json, tools, vision, stream, ...), context window, whether it is enabled, and the names of the env vars that would enable it. Never shows key values. Cost: about 80 tokens per model; filter with kind.

ParameterTypeDescription
kindstringOnly this kind of model. Default: all kinds

search_transcript Search transcripts

Find where something is said across saved video transcripts, instead of reading whole transcripts (about 12k tokens per hour). Hybrid search: keyword matching for exact names and model numbers, plus meaning-based matching for paraphrases (when an embedding model is available). Returns the best time ranges with title, [m:ss], highlighted text and a timestamp link. Syntax: "exact phrase" must appear, -word excludes. Scope with collection (a collection id) or urls (videos are fetched and saved first if needed).

ParameterTypeDescription
query *stringWhat to look for. "quoted phrases" are required, -word excludes a word
collectionstringOnly search this collection (its id)
limitintegerHits to return. Default 10
rerankbooleanRerank the top results with a free LLM. Slower; default false
urlsarrayOnly search these videos

build_brief Build a cited brief

Build a cited brief across videos on the server with a free LLM (map-reduce for large collections). Every claim cites a video, timestamp and quote that were checked against the transcript; points are marked consensus (two or more videos agree), disputed (both sides cited) or single-source, and claims that failed the check are listed separately, uncited. If you can read the transcripts yourself, the `brief` prompt is cheaper and usually better; use this for collections too large for your context.

ParameterTypeDescription
collectionstringA saved collection id
formatstringmarkdown (default): the brief as Markdown; json: the full Brief object
questionstringWhat the brief should answer, e.g. "Which G-Wagon year should I buy?"
templatestringbrief (default) or buyer-guide, tutorial-steps, comparison, summary
urlsarrayUp to 25 video URLs or ids

extract Extract structured data

Extract structured JSON from videos with a template (buyer-guide, tutorial-steps, comparison, summary, brief) or your own JSON Schema. The answer is validated against the schema (one repair attempt), and every citation ({videoId, startSec, quote}) is checked against the transcript: verified ones gain a title and timestamp url, failed ones are removed and listed in "unverified".

ParameterTypeDescription
collectionstringA saved collection id
questionstringFocus for the extraction
schemaobjectA JSON Schema (type, properties, required, items, enum, min/max limits). The result is {data, citations}.
templatestringTemplate id; default summary when no schema is given
urlsarrayUp to 25 video URLs or ids

list_collections List collections

List research collections with how many videos and sources each has. A collection groups videos on one topic and can follow playlists, channels and podcast feeds.

create_collection Create collection

Create a research collection. sources are playlists, channels or podcast feeds the collection follows: add_to_collection or a refresh ingests their videos, and watch lists pick up new uploads. Returns the collection with its id.

ParameterTypeDescription
name *stringCollection name, for example "G-Wagon"
descriptionstringWhat the collection is about
sourcesarrayPlaylist, channel or feed URLs to follow

add_to_collection Add to collection

Ingest videos into a collection now: each URL is a video or a list (playlist, channel, feed), and lists are expanded. Transcripts come from captions first, speech-to-text only when needed. Videos already in the collection are skipped and per-video failures are reported without stopping. Returns the updated collection and a summary (added, skipped, failed with hints).

ParameterTypeDescription
collection *stringCollection id
urls *arrayVideo, playlist, channel or feed URLs

get_collection Get collection

A collection with a summary of each video (id, title, channel, duration, URL, transcript origin), the sources it follows, inputs waiting for the next refresh and its watch list. Read transcripts with get_transcript, get_outline or search_transcript.

ParameterTypeDescription
collection *stringCollection id

ask Ask videos

Answer a question from the transcripts of one or more videos, or a saved collection, with server-side retrieval and the free-first LLM chain. Every factual sentence cites a numbered source; each source is a timestamp link to the moment that supports it. Says so plainly when the videos do not cover the question. Use it when you want a cited answer without reading whole transcripts.

ParameterTypeDescription
question *stringThe question
collectionstringA collection id
urlsarrayVideo URLs or ids like youtube:abc

research_videos Research videos

Search 1 to 10 videos (or a playlist, capped at 10) for a question and get only the relevant excerpts: ranked by BM25, each with the surrounding context, [m:ss] and a timestamp link, under a token cap. Use it instead of reading whole transcripts (about 12k tokens per hour of speech). Put exact phrases in double quotes to boost them. Lexical: if nothing matches, it lists words the videos do use so you can retry with a synonym.

ParameterTypeDescription
query *stringWords to look for; "quoted phrases" are boosted
urls *arrayVideo URLs, or one playlist URL
contextSecnumberSeconds of context before and after each match. Default 20
formatstringtext (compact Markdown, default) or json
maxExcerptsintegerExcerpts per video. Default 3
maxTokensintegerCap on the whole result. Default 2000

list_caption_languages List caption languages

List the caption tracks a video has (language, name, creator or auto-generated) and, for YouTube, the languages YouTube can machine-translate them into. Call it before get_transcript to pick a language.

ParameterTypeDescription
url *stringVideo URL

get_key_moments Get key moments

The moments of a video worth jumping to, picked by the free-first LLM chain from the timestamped transcript. Every timestamp is checked against the real transcript (snapped within 5 seconds, dropped otherwise); the result says how many were dropped and which rung answered.

ParameterTypeDescription
url *stringVideo URL
countintegerHow many moments. Default 8

get_skip_segments Get sponsor and skip segments

Community-marked SponsorBlock segments of a YouTube video: sponsor reads, self-promotion, subscribe reminders, intros, outros, previews and filler, each with its [m:ss] range, a timestamp URL and how much of the transcript it covers (lines, word share and the first words). Use it to leave ad copy out of summaries and briefs: never cite text inside these segments as a claim about the topic. Default categories: sponsor, selfpromo, interaction, intro, outro, preview, filler. All: sponsor, selfpromo, interaction, intro, outro, preview, hook, filler, music_offtopic, poi_highlight, exclusive_access,…

ParameterTypeDescription
url *stringYouTube video URL or id
categoriesarrayCategories to look up. Default: the env default or the seven above

translate_transcript Translate transcript

A video's transcript in another language, with every segment and timestamp kept. Free first: the transcript as is when it is already in that language, then the platform's own track or machine translation (YouTube translated captions), then LLM translation on the free-first rung chain. The source transcript is saved unchanged; the translation is an added layer. Text output starts with a header naming the video and how it was translated; other formats come with a second content block reporting the path used and the attempts. Costs about as many tokens as the transcript itself (about 12k per hour…

ParameterTypeDescription
language *stringTarget language, BCP-47 (en, de, pt-BR)
url *stringVideo URL (YouTube and more), a YouTube video id, or a local media file path
formatstringOutput format: text, json, markdown, srt, vtt, pack, ass, ttml, sbv, lrc, csv. Default text. json returns the full result, source transcript included
llmbooleanAllow LLM translation when the platform has no track in the language. Default true; false uses only the platform's tracks
modestringHow to get the source transcript: auto (captions, then speech-to-text), captions, stt or video. Default auto
timestampsbooleanPrefix lines with [m:ss] where the format allows. Default false

export_obsidian Export to an Obsidian vault

Write one Markdown note per video into a folder of an Obsidian vault on this machine: frontmatter properties, chapters as headings, paragraphs prefixed with [m:ss] timestamp links, plus an index note with [[wikilinks]] when a collection is exported. Notes vid2context wrote before are updated; other existing notes are never replaced unless overwrite is true.

ParameterTypeDescription
vaultPath *stringAbsolute path of the vault (or any folder) to write into
collectionstringA saved collection id to export
folderstringFolder inside the vault. Default: the collection name, or "vid2context"
overwritebooleanReplace existing notes not written by vid2context for the same video. Default false
urlsarrayVideo, playlist, channel or feed URLs to export

export_notion Export to Notion

Create one Notion page per video under a parent page (chapters as headings, paragraphs with timestamp links, a bookmark to the video). Re-exporting updates the same pages instead of duplicating them. Needs NOTION_TOKEN; the parent page comes from parentPageId or NOTION_PARENT_PAGE_ID.

ParameterTypeDescription
collectionstringA saved collection id to export
parentPageIdstringNotion page id or URL to create the pages under. Default: NOTION_PARENT_PAGE_ID
urlsarrayVideo, playlist, channel or feed URLs to export

find_duplicates Find reuploads and clips

Compare the transcripts of several videos and group reuploads (the same video uploaded again) and clips (an excerpt of a longer video, with the [m:ss] where it starts in the original and the range it covers). Use it before writing a brief across many videos: count each group once (representativeOf maps every video to its original), or a clip agreeing with its own source looks like consensus. Related pairs share passages without being copies. Works on transcripts only; re-dubbed or translated reuploads are not detected.

ParameterTypeDescription
collectionstringA saved collection id
urlsarrayVideo URLs or ids; playlists and channels are expanded

watch_live Watch a live stream

Transcribe a live stream (a live YouTube video or an HLS .m3u8 URL) while it runs. New lines arrive about every 30 seconds as progress notifications; the result is the full transcript with [stream time | UTC] stamps when the stream ends or maxMinutes pass. Default 10 minutes, at most 60. For recordings use get_transcript.

ParameterTypeDescription
url *stringLive YouTube URL or HLS (.m3u8) URL
maxMinutesnumberMinutes to follow the stream. Default 10, capped at 60

open_transcript_viewer Open transcript viewer

Show a video transcript in an interactive viewer (chapters, search, clickable [m:ss] timestamps, one-click citations, send selected lines to the chat) in clients that support MCP Apps, such as ChatGPT and Claude. The text result starts with a header (title, channel, URL, chapters); clients without MCP Apps get the full timestamped transcript as text.

ParameterTypeDescription
url *stringVideo URL (YouTube and more) or a local file path
languagestringPreferred transcript language (BCP-47, e.g. en, de)

get_caption_options List caption tracks for download

Every caption track of one video (YouTube, any site yt-dlp reads, or a local file with sidecar or embedded subtitles): language, name, creator or automatic, which provider lists it, the languages the platform can machine-translate into, and whether speech-to-text can make a transcript when there are none. Nothing is downloaded. Call it before download_captions.

ParameterTypeDescription
url *stringVideo URL, YouTube id or local file path

download_captions Download captions or subtitles

Save the captions of a video as srt, vtt, ass, ttml, sbv, lrc, csv, txt, json, markdown or the original file the site serves, to a folder on this machine; returns the path. offsetSec retimes the cues, maxLineChars and maxLines reflow them, and secondary adds a second language under each caption. Works for every source vid2context reads, through its transcript pipeline (no yt-dlp needed), with yt-dlp as a second path; for a video without captions, mode auto (default) transcribes the audio with speech-to-text. languages: one or several codes, or ["all"] for every track; several files come as one…

ParameterTypeDescription
url *stringVideo URL, YouTube id or local file path
allowAutobooleanAccept the platform's automatic captions. Default true
allowTranslatedbooleanAccept the platform's machine translation. Default true
dirstringFolder to save to: absolute, ~/..., or relative to the default folder
formatstringsrt, vtt, ass, ttml, sbv, lrc, csv, txt, json, markdown, original (default srt; original keeps the site's file)
languagesarrayLanguage codes, e.g. ["en","de"], or ["all"]. Default: the spoken language
maxLineCharsintegerLongest caption line in characters (cue formats, default 42)
maxLinesintegerMost lines per cue (default 2)
modestringauto (captions, else speech-to-text; default), captions (never transcribe), stt (always transcribe)
offsetSecnumberShift every cue by this many seconds (negative: earlier); timed formats only
secondarystringA second language shown under each caption, e.g. "de" (bilingual formats)
timestampsbooleantxt only: one "[m:ss] line" per caption
viastringauto (default), pipeline or ytdlp
zipbooleanReturn a .zip even for one file

grab_frames Grab still frames from a video

Save still images (png default, or jpg) of a video at given times to a folder on this machine. One time gives one image, several a .zip. Web videos are downloaded first (only the needed part when the times are close together). Files go to dir, else VID2CONTEXT_DOWNLOAD_DIR, else ~/Downloads/vid2context. Download only media you have the rights to: your own uploads, public-domain or Creative Commons works, or videos the site lets you download.

ParameterTypeDescription
times *arrayTimes: seconds, m:ss or h:mm:ss
url *stringVideo URL, YouTube id or local file path
dirstringFolder to save to: absolute, ~/..., or relative to the default folder
formatstringpng (default) or jpg
qualitystringDownload size for web videos (smaller side), default 1080
widthintegerWidth in pixels; default the source size
zipbooleanReturn a .zip even for one frame

export_clip Export an animated GIF or WebP

Save a short part of a video as an animated GIF (default) or WebP to a folder on this machine. from and to are seconds or m:ss (default 5 s from from); fps default 10 and width default 480, both capped by the server limits (VID2CONTEXT_MAX_CLIP_*). For a video clip with sound use download_media with from and to. Download only media you have the rights to: your own uploads, public-domain or Creative Commons works, or videos the site lets you download.

ParameterTypeDescription
url *stringVideo URL, YouTube id or local file path
dirstringFolder to save to: absolute, ~/..., or relative to the default folder
formatstringgif (default) or webp
fpsintegerFrames per second, default 10
fromstring | numberStart: seconds, m:ss or h:mm:ss. Default 0
loopbooleanRepeat forever (default true)
tostring | numberEnd. Default from + 5 s
widthintegerWidth in pixels, default 480

download_batch Download many videos, audio or captions

Save several videos at once: a list of URLs, playlists or channels (expanded up to limit), each as video, audio or captions only. Failed items are reported and do not stop the rest. zip: true returns one .zip with every file. Video formats: mp4, webm, mkv; audio: mp3, m4a, opus, flac, wav; captions: srt, vtt, ass, ttml, sbv, lrc, csv, txt, json, markdown, original. Download only media you have the rights to: your own uploads, public-domain or Creative Commons works, or videos the site lets you download.

ParameterTypeDescription
urls *arrayVideo, playlist or channel URLs, YouTube ids or file paths
dirstringFolder to save to: absolute, ~/..., or relative to the default folder
formatstringFormat for that kind, e.g. mp4, mp3 or srt
kindstringWhat each video becomes. Default video
languagesarraycaptions: language codes or ["all"]
limitintegerMost videos in total. Default and cap: VID2CONTEXT_MAX_PLAYLIST_ITEMS
modestringcaptions: auto, captions or stt
playlistbooleanExpand video links that also name a playlist (watch?v=...&list=...)
qualitystringVideo: 1080, 720, ...; mp3: kbps
zipbooleanReturn one .zip with every saved file

get_media_options Get video and audio download options

Qualities, formats and estimated file sizes for downloading one video (YouTube or any site yt-dlp supports, or a local file): video sizes per quality for mp4, webm and mkv, audio sizes for mp3 (by bitrate), m4a, opus, flac and wav, plus chapters and subtitle languages. Nothing is downloaded. Call it before download_media to pick a quality that fits.

ParameterTypeDescription
url *stringVideo URL, YouTube id or local file path

download_media Download a video or its audio

Save a video as mp4, webm or mkv, or its audio as mp3, m4a, opus, flac or wav, to a folder on this machine; returns the file paths. Works for YouTube and the other sites yt-dlp supports, and converts local files. Defaults: video mp4 up to 1080p (H.264 + stereo AAC, plays everywhere), audio mp3 at the best VBR quality, with title, cover art and chapters embedded. Keep a part with from/to (seconds or m:ss) or chapter (index or title); cut sponsor reads with removeSegments (YouTube). A playlist or channel URL downloads its first `limit` videos. Files go to dir, else VID2CONTEXT_DOWNLOAD_DIR, else…

ParameterTypeDescription
url *stringVideo, playlist or channel URL, YouTube id, or local file path
burnSubtitlesstringBurn one language's subtitles into the picture, e.g. "en" (video only; re-encodes, so slower)
chapterstringKeep one chapter: 0-based index or title (see get_media_options)
dirstringFolder to save to: absolute, ~/..., or relative to the default folder
embedChaptersbooleanChapter markers. Default true
embedMetadatabooleanTitle, channel and date tags. Default true
embedThumbnailbooleanCover art. Default true
exactCutsbooleanRe-encode at the cut points so a trimmed video starts exactly at from (slower)
formatstringmp4 (default for video), webm, mkv, mp3 (default for audio), m4a, opus, flac, wav
fromstringStart of the part to keep: seconds, m:ss or h:mm:ss
kindstringvideo or audio. Default: from format, else video
limitintegerPlaylists and channels: how many videos to download. Default 10
qualitystringVideo: best, 2160, 1440, 1080, 720, 480, 360, 240, 144 (smaller side in pixels; default 1080). Audio: best, 320, 256, 192, 160, 128, 96, 64 (mp3 kbps; default best)
removeSegmentsarraySponsorBlock categories to cut out (YouTube)
splitChaptersbooleanAlso save one file per chapter, in a folder next to the full file. Not with from/to/chapter
subtitlesarraySubtitle languages to embed in a video, e.g. ["en"]
tostringEnd of the part to keep

download_thumbnail Save a video thumbnail

Save a video's thumbnail (cover image) as jpg, png or webp to a folder on this machine; returns the path. For YouTube and other sites it takes the largest image the site lists; for a local file, its cover art, else a frame from the first tenth of the video. Files go to dir, else VID2CONTEXT_DOWNLOAD_DIR, else ~/Downloads/vid2context.

ParameterTypeDescription
url *stringVideo URL, YouTube id or local file path
dirstringFolder to save to: absolute, ~/..., or relative to the default folder
formatstringjpg (default), png or webp

digest_videos Digest videos with your own model

Build one cited digest of several videos (a playlist, a collection, or a list of URLs) using MCP sampling: the server asks the client's model to take notes on each part of each transcript, then combine them. Every claim cites [Title @ m:ss](link), and every timestamp is checked against the real transcript. No server key is needed. If this client cannot sample, the result is a chunk plan with the exact instructions, so you can do the same work yourself.

ParameterTypeDescription
collectionstringA collection id or name; its saved videos are digested
maxTokensPerVideointegerMost transcript tokens sent in one sampling call; longer videos are split by chapter or time. Default 6000
questionstringA question the digest should answer
urlsarrayVideo URLs, playlists or channels (expanded into their videos), saved video ids or titles

choose_caption_track Choose a caption track

List a video's caption tracks (languages, creator or auto-generated) and ask the user to pick one, then return that transcript with [m:ss] timestamps. Without a picker in this client, or when the user declines, returns the track list so you can call get_transcript with a language.

ParameterTypeDescription
url *stringVideo URL