[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-116270":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":14,"stars7d":15,"stars30d":15,"stars90d":14,"forks30d":14,"starsTrendScore":14,"compositeScore":16,"rankGlobal":9,"rankLanguage":9,"license":17,"archived":18,"fork":18,"defaultBranch":19,"hasWiki":20,"hasPages":18,"topics":21,"createdAt":9,"pushedAt":30,"updatedAt":31,"readmeContent":32,"aiSummary":33,"trendingCount":14,"starSnapshotCount":14,"syncStatus":15,"lastSyncTime":34,"discoverSource":35},116270,"broll-mcp","edigeh\u002Fbroll-mcp","edigeh","MCP server to find, preview and cut public-domain b-roll from the Internet Archive, with a provenance record for every clip",null,"Python",55,4,53,0,2,43.3,"MIT License",false,"main",true,[22,23,24,25,26,27,28,29],"b-roll","ffmpeg","internet-archive","mcp","model-context-protocol","public-domain","python","stock-footage","2026-10-23 13:58:34","2026-11-18 19:00:40","\u003Cdiv align=\"center\">\n\n# 🎞️ broll-mcp\n\n**Find, preview and cut public-domain b-roll from the Internet Archive, from inside any MCP agent.**\n\nEvery clip lands on disk with a provenance record next to it: source, license, exact segment and attribution text.\n\n[![CI](https:\u002F\u002Fgithub.com\u002Fedigeh\u002Fbroll-mcp\u002Factions\u002Fworkflows\u002Fci.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fedigeh\u002Fbroll-mcp\u002Factions\u002Fworkflows\u002Fci.yml)\n[![License: MIT](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-blue.svg)](LICENSE)\n![Python 3.12+](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fpython-3.12%2B-3776AB?logo=python&logoColor=white)\n![MCP](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FMCP-stdio-8A2BE2)\n![No API key](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FAPI%20key-not%20needed-success)\n\n\u003C\u002Fdiv>\n\n---\n\n```text\nYou:    \"I need 8 seconds of children eating bananas, ideally black and white.\"\n\nAgent → search_footage(\"children eating bananas\")       5 ranked items, license + tier on each\nAgent → inspect_item(\"AboutBan1935\")                    scenes with a keyframe image per scene\nAgent → extract_clip(\"AboutBan1935\", start_s=300, 8s)   verified H.264 MP4 + provenance JSON\nAgent → get_provenance(clip_id)                         \"About Bananas\" (1935), Prelinger Archives\n                                                        via Internet Archive · Public Domain\n```\n\nThe agent sees the footage before it cuts: `inspect_item` returns real keyframe images, so a vision model can pick the shot instead of guessing from titles.\n\n## Why\n\narchive.org holds decades of public-domain film (Prelinger, NASA, newsreels, stock footage), but using it from an agent is awkward:\n\n- Raw item metadata can exceed **1 MB** for one item. That's a huge token cost before you've seen a single frame.\n- Licenses differ **per item**, even inside one collection.\n- Clips cut with `-c copy` snap to keyframes. An 8 s request came back as **11.35 s**.\n\nbroll-mcp handles all of this behind four small tools. Responses are compact and cached, and the server applies polite rate limits. Each cut is re-encoded and checked against the requested length.\n\n## Features\n\n| | |\n|---|---|\n| 🔎 **Brief-driven search** | Plain-language briefs become archive.org queries. A two-stage search first requires every term, then matches any term. Local ranking adds collection trust tiers and a black-and-white preference. Results come back 5 per page. |\n| 🖼️ **Visual inspection** | Scene detection runs over HTTPS (PySceneDetect, with ffmpeg as fallback) and returns one keyframe per scene as an MCP image. Items that hold hundreds of clips return a paged clip list with thumbnails. |\n| ✂️ **Frame-accurate cuts** | Cuts are re-encoded to H.264 MP4 with faststart. ffprobe confirms the duration is within ±0.1 s and the decode shows zero errors, and you get 3 check frames back. The same request twice returns the same clip. |\n| 📜 **Provenance by design** | A JSON record sits next to every clip. It holds the source file MD5, the license copied verbatim, `commercial_use`, the data node, a timestamp and ready-to-paste attribution. Provenance is written before the clip, so a clip never exists without its record. |\n| 🤝 **Polite to archive.org** | Follows [archive.org's bot guidance](https:\u002F\u002Farchive.org\u002Fdevelopers\u002Fbots.html): a descriptive User-Agent, a 1 req\u002Fs token bucket, at most 4 media connections, `Retry-After` support and exponential backoff. |\n| 💾 **Cache-first** | Uses a SQLite WAL cache. Repeating a search, inspection or cut sends **0** upstream requests, and every tool result reports `upstream_requests`. |\n\n## Quick start\n\n**Requirements:** Python 3.12+, [uv](https:\u002F\u002Fdocs.astral.sh\u002Fuv\u002F), and `ffmpeg` \u002F `ffprobe` built with HTTPS support (`brew install ffmpeg`, `apt install ffmpeg`).\n\n### Claude Code\n\n```bash\nclaude mcp add broll -- uvx --from git+https:\u002F\u002Fgithub.com\u002Fedigeh\u002Fbroll-mcp broll-mcp\n```\n\n### Claude Desktop, Cursor and other MCP hosts\n\n```json\n{\n  \"mcpServers\": {\n    \"broll\": {\n      \"command\": \"uvx\",\n      \"args\": [\"--from\", \"git+https:\u002F\u002Fgithub.com\u002Fedigeh\u002Fbroll-mcp\", \"broll-mcp\"],\n      \"env\": { \"BROLL_AGENT_MODEL\": \"claude-opus-5-5\" }\n    }\n  }\n}\n```\n\n### From a clone\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fedigeh\u002Fbroll-mcp && cd broll-mcp\nuv sync\nuv run broll-mcp          # stdio server; point your host at this command\n```\n\nTry it without an agent using the [MCP Inspector](https:\u002F\u002Fgithub.com\u002Fmodelcontextprotocol\u002Finspector):\n\n```bash\nnpx @modelcontextprotocol\u002Finspector --cli uv run broll-mcp \\\n  --method tools\u002Fcall --tool-name search_footage --tool-arg 'brief=aerial highway 1950s'\n```\n\n## Tools\n\n| Tool | What it does | Upstream cost |\n|---|---|---|\n| `search_footage(brief, filters?, cursor?)` | Ranked items with title, year, trust tier, license, runtime, tile image URL and a short *why it matched*. Filters: `max_tier`, `license` (`stated` · `commercial_ok` · `any`), `collections`, `year_from\u002Fto`, `color`. | ≤ 4 requests at the default `max_tier` (2 at tier 1, 6 at tier 3), 0 when cached |\n| `inspect_item(identifier, file?, window?, page_size?, cursor?)` | **Scene mode:** scenes with timings plus a keyframe image each, a shotlist excerpt and license. **Clip-list mode:** for items with many separate clips, a paged list with thumbnails. | a few requests, 0 when cached |\n| `extract_clip(identifier, file, start_s, duration_s, label?, audio?, brief?)` | Cuts 1–60 s into `BROLL_HOME\u002Fclips\u002F`, verifies it and writes the provenance JSON. Returns 3 check frames. | ~3 requests, 0 on repeat |\n| `get_provenance(clip_id \\| identifier, cursor?)` | Reads the record for a clip, or for an item and the clips already cut from it. Local only. | always 0 |\n\n**Resource:** `broll:\u002F\u002Fstats` reports request counts by endpoint, cache contents, the active scene detector and the ffmpeg version.\n\nEvery tool declares an `outputSchema` and returns `structuredContent`. Errors come back as tool results with a stable code, such as `NO_RESULTS`, `ITEM_NOT_FOUND`, `FILE_NOT_IN_ITEM`, `RANGE_OUT_OF_BOUNDS`, `THROTTLED` or `CUT_VERIFY_FAILED`. Each message tells the agent how to recover.\n\n## Provenance record\n\n```jsonc\n\u002F\u002F clips\u002FAboutBan1935__0300.00-0308.00__bananas__4ee00c.provenance.json\n{\n  \"schema\": \"broll-mcp\u002Fprovenance\u002F1\",\n  \"clip_id\": \"clp_20261023_4ee00c\",\n  \"clip_sha256\": \"78e33da7…\",\n  \"source\": {\n    \"identifier\": \"AboutBan1935\",\n    \"title\": \"About Bananas\",\n    \"file\": \"AboutBan1935.mp4\",\n    \"file_md5\": \"de484b1b573d28be4860f00a593f4416\",\n    \"derived_from\": \"AboutBan1935.mpeg\",\n    \"collections\": [\"prelinger\"],\n    \"tier\": 1,\n    \"date\": \"1935\",\n    \"creator\": \"Castle Films\"\n  },\n  \"license\": {\n    \"licenseurl\": \"http:\u002F\u002Fcreativecommons.org\u002Flicenses\u002Fpublicdomain\u002F\",\n    \"license_label\": \"Public Domain (CC PD dedication)\",\n    \"commercial_use\": \"allowed\",\n    \"attribution_required\": \"no\",\n    \"determined_from\": \"licenseurl\"\n  },\n  \"segment\": { \"start_s\": 300.0, \"duration_s\": 8.0, \"verified_duration_s\": 7.975 },\n  \"retrieval\": { \"retrieved_at\": \"2026-10-23T12:28:30Z\", \"data_node\": \"dn600301.us.archive.org\", \"user_agent\": \"broll-mcp\u002F0.1.0 (…)\" },\n  \"processing\": { \"ffmpeg\": \"8.1.1\", \"audio\": false, \"reencoded\": true },\n  \"attribution_text\": \"\\\"About Bananas\\\" (1935), Prelinger Archives via Internet Archive, https:\u002F\u002Farchive.org\u002Fdetails\u002FAboutBan1935. License: Public Domain (CC PD dedication).\"\n}\n```\n\nLicense labels come only from an exact URL table covering PD, CC0, the PD Mark, and CC BY \u002F BY-SA \u002F BY-ND \u002F BY-NC variants for versions 2.0–4.0. A URL outside the table is copied verbatim with the label `unrecognized` and `commercial_use: \"unknown\"`; nothing is guessed.\n\n## Configuration\n\n| Variable | Default | Purpose |\n|---|---|---|\n| `BROLL_HOME` | platform data dir (`~\u002FLibrary\u002FApplication Support\u002Fbroll-mcp`, `~\u002F.local\u002Fshare\u002Fbroll-mcp`) | Cache, keyframes, clips. The server writes nowhere else. |\n| `BROLL_AGENT_MODEL` | `unspecified` | Model name sent in the User-Agent, as archive.org asks of AI agents. |\n| `BROLL_CACHE_MAX_MB` | `2048` | Keyframe cache budget; older keyframes are evicted first. |\n\nCollection trust tiers live in `BROLL_HOME\u002Ftiers.toml`. Tier 1 is `prelinger` and `nasa`, tier 2 is `stock_footage` and `feature_films`, and everything else is tier 3. Edit the file to tune ranking and the `max_tier` filter.\n\n## How it works\n\n```text\n MCP host ──stdio──► server.py ── jsonschema validation, result shaping, images\n                        │\n        ┌───────────────┼──────────────────┬────────────────────┐\n   SearchService   SceneService        ClipService          SQLite cache (WAL)\n   two-stage query  PySceneDetect \u002F     cut → ffprobe verify  searches · items · scenes\n   + local ranking  ffmpeg, keyframes   → provenance → clip   clips · provenance · request_log\n        └───────────────┴─────── ArchiveClient ────────────────┘\n                     UA · 1 req\u002Fs bucket · 4 media slots · backoff\n                                    │\n                     archive.org (advancedsearch · metadata · download)\n```\n\nThe design rests on live archive.org responses captured in [`research\u002F`](research\u002F), which the offline tests also use as fixtures.\n\n## Development\n\n```bash\nuv sync\nuv run pytest                 # 155 offline tests (mock transport, captured metadata)\nuv run ruff check . && uv run ruff format --check .\nuv run python scripts\u002Fe2e_smoke.py \u002Ftmp\u002Fbroll-e2e   # live end-to-end over stdio against archive.org\n```\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md).\n\n## A note on rights\n\nbroll-mcp copies license information exactly as archive.org publishes it, and it makes no legal judgement. `commercial_use: \"unknown\"` means archive.org states no machine-readable license for that item. Check the source item before you publish footage, especially material that carries only a rights statement.\n\n## License\n\n[MIT](LICENSE) for the code. Footage belongs to its respective rights holders under the terms recorded in each clip's provenance file.\n","broll-mcp 是一个面向 MCP（Model Context Protocol）智能体的轻量级服务，用于在 Internet Archive 中发现、预览和精准裁剪公共领域（public-domain）的 B-roll 素材。它支持自然语言驱动的检索、基于关键帧的视觉预览、帧精度重编码裁剪（H.264 MP4），并为每个输出片段自动生成包含来源、许可、时间戳和完整归属信息的 JSON 证明文件。项目采用 Python 实现，无需 API 密钥，内置速率限制与缓存机制，专为 AI 智能体自动化视频内容生成场景设计，适用于教育视频制作、开源纪录片剪辑、合规性要求高的媒体合成等需要可验证版权来源的流程。","2026-11-24 04:53:23","CREATED_QUERY"]