
Video Frames
io.github.Azzy-H由 GitHub 帳號 Azzy-H 發布v0.1.1更新於 Oct 24, 2026
MCP server that lets image-only models look at video: timecoded frames, measurable properties.
概覽
本機 MCP 伺服器,讓支援影像輸入的模型「看」影片:回傳帶時間碼的畫面影格與可量測的影片屬性。
- 可以做什麼
- 依時間區間取樣影片並回傳影像影格,每個影格前附上時間碼,可控制間隔、影格數、長邊尺寸、格式與品質
- 將起訖時間設為同一值即可檢視單一時間點
- 讀取容器中繼資料,例如長度、影格率、解析度、編碼、色彩資訊、音軌、字幕軌與章節
- 對整個檔案掃描場景切換、靜音段落與 EBU R128 響度,結果可快取重複使用
- 透過命令列管理影格快取,包括統計與清理
- 適用情境
- 當所用模型支援影像輸入,且需要讓它理解本機影片中隨時間發生的內容,或在不開啟剪輯軟體的情況下檢視影片的技術屬性時適用。
- 執行需求
- 以本機程序執行,可從 PyPI 安裝(pip 或 uvx),或複製儲存庫並使用其自帶的虛擬環境。需要 Python 3.10 或更新版本、位於 PATH 或解譯器旁的 ffmpeg,可選用 ffprobe 以取得更完整的中繼資料。用戶端模型必須支援影像輸入。不需帳號或 API 金鑰。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Video Frames,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
mcp-video-frames — Video MCP Server
An MCP server that lets image-only models look at video: frames with timecodes, plus measurable video properties.
Available Tools
The server provides these tools:
view_frames- Sample a time range and return frames as images, each preceded by its timecodevideo_info- Container metadata, optionally with a whole-file scene/silence/loudness scan
The model you are talking to must accept image input. Without it, the returned frames are dropped or degraded to text.
This is a local server: it is not hosted anywhere, and a client has to be pointed at it. See Self-Hosted below.
Install from PyPI
That installs one console script, and the console script is the server. Point a client at it:
With no subcommand and piped stdio it speaks MCP; on a terminal it prints help instead of hanging. mcp-video-frames doctor checks the environment it will run in.
This path expects ffmpeg and ffprobe on PATH. If you would rather have them installed into a private virtual environment, along with a ready-made client config, use Self-Hosted below instead.
Self-Hosted
Installs nothing into your system Python: dependencies go into the project's own .venv/, and the client config points at that interpreter directly.
- Clone the repository
- Generate the virtual environment and the client config
setup_mcp.py only does three things:
- creates
.venv/in this directory (run it with any Python 3.10+ interpreter); - installs the two runtime dependencies from
requirements.txtinto that.venv/; - writes
mcp-config.json, with the paths already filled in.
Options:
If ffmpeg is missing the script offers to download a prebuilt build into .venv/ (Windows), to point at one you installed, or to skip. Nothing is ever installed system-wide.
- Check the environment before wiring it up
This reports the ffmpeg/ffprobe paths and versions, whether the required filters are present, and whether the cache directory is writable — naming whatever is missing rather than leaving you to guess. It finds a venv-local ffmpeg on its own, so nothing has to be exported first.
test_server.py goes further and speaks real MCP to the server over stdio, so the whole path can be verified before any client is configured:
It checks the handshake, the tool list, the 2n + 1 content-block ordering, whether a single-frame request comes back as PNG, and that an over-limit request is refused — and that stdout stays clean for the JSON-RPC stream.
- Add this MCP server
Merge the generated mcp-config.json into your client's config. If an mcpServers section already exists, just add the video-frames entry to it. run_server.py puts src/ on sys.path itself, so no PYTHONPATH is needed and nothing has to be pip installed anywhere.
Replace /path/to/mcp-video-frames with the actual path to this repository on your system. On Windows the interpreter is .venv\Scripts\python.exe.
Uninstall: delete .venv/ and remove that config entry. Nothing else was written.
Requirements
- Python 3.10 or newer
ffmpegandffprobe.setup_mcp.pyinstalls (or downloads) them into the project's own.venv/, and the server looks for them beside its own interpreter first, then onPATH— so a venv-local install needs noFFMPEG_PATHto be exported.ffmpegis required; withoutffprobe, metadata falls back to parsing ffmpeg's own header output (fewer fields), anddoctorsays so explicitly- A client model that accepts image input
Tools
view_frames
Samples a time range and returns an interleaved timecode + image sequence. Set start and end to the same value to look at a single moment.
The result is 2n + 1 content blocks:
The block order is load-bearing: an image without its timecode cannot be reasoned about in time. clamped reports whether the range was trimmed to the video's length, cached how many frames came from disk, and limits repeats the budget in force so the numbers do not have to be discovered by being rejected.
A range defaults to jpeg because at equal edge length it is about an order of magnitude smaller, which fits many more frames inside a client's byte budget. Ask for a single frame as png when detail matters.
Over a limit the call fails: nothing is truncated and the interval is never widened. Silently coarsening the sampling grid would invalidate the caller's assumption about time precision, so the whole call fails instead. If any single frame fails validation, no frames are returned.
video_info
Returns video metadata. detail="basic" reads container headers only and returns immediately; detail="full" adds an exhaustive whole-file scan for scene cuts, silences and EBU R128 loudness.
With detail="basic" the scene_cuts / silences / loudness / scan fields are absent rather than empty — "no value" and "not scanned" mean different things. The first full call scans the whole file; later calls reuse the cache. force=true recomputes.
Configuration
Environment variables take precedence over defaults.
MCP_VIDEO_MAX_IMAGES caps how many frames one call may return. Set it to match your client: limits differ between clients, and while too low is merely conservative, too high makes the entire batch unusable. max_frames defaults to 12 and may be raised only up to this limit.
The effective limits are also stated in the tool descriptions and repeated in every view_frames result, so a caller can see them without being rejected first.
CLI
The same package ships a CLI for troubleshooting and batch work:
Without installing the project (Self-Hosted above), use the launcher for the same subcommands:
Running it with no arguments prints help; as an MCP server it takes no arguments. When stdin is a pipe (as an MCP client provides) a bare invocation starts the server, which is how nothing has to be configured for the stdio case.
doctor prints its JSON report and then a one-line human verdict ("Self-check passed" / "Self-check failed"), so it is the one subcommand whose stdout is not pure JSON. The CLI and the MCP tools call the same core functions, so behaviour cannot drift between what works in a terminal and what works for a model.
Cache
Location: depends on how the server was started.
The setup script configures the project-local .cache/ deliberately, together with cwd. A relative path resolves against the client's working directory, so without cwd the cache would land wherever the client happened to start — less predictable than the temp default, not more. It is already in .gitignore.
MCP_VIDEO_CACHE_DIR overrides either default, and the resolved path is printed to stderr at startup.
Everything in the cache is reproducible — deleting the directory is always safe, and only costs a re-probe.
Entries are keyed by content hash (size + mtime + the first and last 1 MB), and frames are stored individually by absolute timestamp, so overlapping views reuse work: look at 0–20 s, then 10–30 s, and 10–20 s is already on disk.
If you left the cache in the system temp directory, do not rely on the operating system to clean it up — the platforms differ too much:
So the server cleans up after itself, evicting whole video entries by LRU once MCP_VIDEO_CACHE_MAX_BYTES (default 5 GB) is exceeded, plus a 14-day frame age limit (MCP_VIDEO_FRAME_MAX_AGE_DAYS).
The tiers follow recomputation cost: frames are cheap and go first, while whole-file scan results (video_info(detail="full")) are expensive to rebuild and are kept preferentially.
Eviction runs asynchronously after a tool call returns — it never blocks a response, and there is no full scan at startup.
Multiple clients share one cache. Reads and writes are guarded by a file lock, writes go through a temp file plus os.replace, and a frame that has been evicted between listing and reading is regenerated rather than reported as an error.
License
MIT — see LICENSE.
來源:README.md,提交 84623d5
工具
0版本歷史
1- v0.1.1最新Sep 28, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分