Agent interface
Expose the pipeline as a stdio MCP tool.
The MCP server lets Claude Desktop, Claude Code, and other MCP clients ask for a video context pack through one tool: watch_youtube.
Read MCP docsBuild the server
Compile the stdio server before registering it with a client.
npm install npm run build:bin
Register with a client
Point the client at dist/mcp.js and provide OPENAI_API_KEY in the server environment.
MCP clients often launch servers from arbitrary working directories, so passing the key explicitly in client config is the most reliable setup.
claude mcp add yt2ctx \ --env OPENAI_API_KEY=sk-... \ -- node /absolute/path/to/yt2ctx/dist/mcp.js
Tool arguments
watch_youtube accepts the same core controls as the web and CLI surfaces.
- url
- Required YouTube URL.
- topK
- Number of frames to select. Default: 8.
- mode
- Frame selection strategy: density or top-k.
- outputMode
- watch, style, prompt, shot-specs, or all.
- outputDir
- Optional artifact output directory.