Video2Agent

mcp
Guvenlik Denetimi
Uyari
Health Uyari
  • License — License: Apache-2.0
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Low visibility — Only 9 GitHub stars
Code Gecti
  • Code scan — Scanned 12 files during light audit, no dangerous patterns found
Permissions Gecti
  • Permissions — No dangerous permissions requested

Bu listing icin henuz AI raporu yok.

SUMMARY

让 AI 搜索和理解 YouTube、B 站、抖音及本地视频,凭时间码和关键帧回看原片。Local-first video search and analysis with timecoded evidence for MCP clients and DeepSeek Harness (DSH).

README.md

English · 简体中文

Video2Agent — Local-first video search and frame-verified understanding MCP server for YouTube, Bilibili, Douyin, and local videos

CI PyPI Official MCP Registry License: Apache-2.0 Python 3.11+

Give Claude & Cursor video eyes — without burning tokens.

Local-first MCP server that lets AI agents search and inspect 1-hour YouTube talks, local screen recordings, Bilibili, and Douyin videos. Search transcripts and on-screen text first, then pull exact source frames only when visual proof matters — using ~99% fewer tokens than sending raw video frames to a multimodal model.

Quick Start · Why Video2Agent · Measured Performance · Capabilities · Architecture · Docs

Video2Agent MCP workflow in Cursor and Claude Code: instant captions, search hit, and on-demand verified source frame with same-frame OCR
Text first, pixels on request — captions load immediately; video downloads and exact frames are fetched only when your agent needs visual proof.


Quick Start (30 seconds · Choose uvx or pip)

Core install is ~24 MB (no GPU, no Docker, no heavy vision bundle required). Works with Claude Code, Claude Desktop, Cursor, VS Code, Windsurf, Cline, Codex, Cherry Studio, and DSH.

One-click install:
Install in Cursor (direct link) · Install in VS Code

Option A — Zero-install with uvx (recommended if you have uv)

# Claude Code
claude mcp add video2agent -- uvx video2agent mcp

Or paste into .cursor/mcp.json, claude_desktop_config.json, or your MCP client:

{
  "mcpServers": {
    "video2agent": {
      "command": "uvx",
      "args": ["video2agent", "mcp"]
    }
  }
}

Option B — Standard Python with pip (no uv required)

pip install video2agent

# Claude Code
claude mcp add video2agent -- video2agent mcp

Or run video2agent mcp --print-config (or paste directly):

{
  "mcpServers": {
    "video2agent": {
      "command": "video2agent",
      "args": ["mcp"]
    }
  }
}

Try asking your agent right away:

  • "Summarize this 45-minute YouTube talk with timestamps and check what the architecture slide around 14:20 says."
  • "Compare these 3 tutorials side-by-side — where do they agree, and where do they contradict each other?"
  • "Inspect this local .mp4 UI screen recording and pinpoint where the layout flickers."

Worked on your first video? A ⭐ on GitHub helps more developers find it.

Optional setup: Proactive Agent Skill, Visual Settings UI, Offline ASR/OCR & DSH Plugin

1. Make agents trigger Video2Agent automatically

Some MCP clients lazy-load tool lists until prompted. Install the companion Agent Skill so Claude Code, Codex, Antigravity, and DSH proactively invoke Video2Agent whenever you share a video link or ask a video-oriented question:

video2agent setup --target all        # or claude / codex / antigravity / dsh

2. Visual local Settings UI (no API keys in chat logs)

Configure optional cloud speech/OCR providers, download local Whisper models, check FFmpeg, change default search routing, or sign in to Bilibili/Douyin in a bilingual local web page:

video2agent ui

In a connected MCP client, you can also run the open-settings prompt or ask "Open Video2Agent settings."

3. Optional offline speech recognition, offline OCR & Douyin login

  • Subtitles first: When a linked video has usable captions, MCP reads them immediately and defers downloading the video until frames or visual evidence are requested.
  • Offline speech recognition: pip install "video2agent[asr]" (or enable in video2agent ui), then download a speech model in Settings (small is ~464 MB).
  • Offline on-screen text (OCR): pip install "video2agent[ocr]" (or enable in video2agent ui).
  • Cloud recognition (optional): Connect any OpenAI-compatible speech or OCR provider in video2agent ui (SiliconFlow preset included). Keys stay in your OS credential store, never in chat logs.
  • Optional account logins: YouTube and local files require no login. Optional Bilibili QR login unlocks additional subtitles and read-only favorites/history; optional Douyin login (pip install "video2agent[browser]") reads your profile, works, favorites, and likes.

4. Native DSH Plugin & Source Install

# Native DSH plugin (shares the same ~/.video2agent library)
dsh plugin --profile web add dsh-video2agent
# From source
git clone https://github.com/Harm0ny-AI/Video2Agent.git
cd Video2Agent
python -m venv .venv
# Windows: .venv\Scripts\activate    macOS/Linux: source .venv/bin/activate
pip install -e .
video2agent doctor
video2agent ingest "https://youtu.be/jNQXAC9IVRw"
video2agent search "elephants"

Why Video2Agent

Existing video tools usually fail in one of two ways: caption-only summarizers cannot read slides, charts, or UI state, while frame-streaming tools burn tens of thousands of tokens per question or silently return empty results on long videos.

Capability Caption-only summarizers Frame-streaming tools Video2Agent
Video sources Single links Local or single links YouTube + local recordings + Bilibili + Douyin
Token cost on 1h videos Text only (misses visuals) Heavy per-query image dumps Search text first, pull exact frames on demand (~99% saved)
Source-frame proof No visual context No cross-video search Exact frame + same-frame OCR + HH:MM:SS citation
Multi-video comparison Not supported Not supported Compare 1–10 videos for consensus & conflicts
Honesty on failure Guesses or hallucinates Often silent empty outputs Explicit errors; unread frames stay marked unknown
Footprint Cloud SaaS Heavy GPU / Docker stacks ~24 MB core, CPU-first, shared local library

Measured Performance & Honesty

We publish real measured numbers along with their scope and caveats — never cherry-picked full-benchmark claims.

Measurement Result Scope & Caveats
Context token reduction ~99% fewer tokens Searching transcripts/OCR first and attaching only 1–6 requested source frames vs. feeding sampled frames of a full video directly to a vision model.
Captioned video startup Seconds Default MCP mode reads usable captions immediately and defers video download until visual evidence is actually requested.
Long-video full indexing 61.2 s for a 67-min lecture Measured on CPU with AI captions, 1,976 transcript segments, 114 deduped frames, avg memory ~243 MB (LONG-VIDEO-BENCH.md). Uncaptioned long videos take longer when full speech recognition runs.
Video-MME internal eval 87.8% (79/90), 0 guesses Measured on a 90-question subset (30 short/medium/long videos; 95% CI: 81.0%–94.6%), not the 2,700-question full leaderboard (BENCH-VIDEOMME.md).

What It Does

1. First-class YouTube, local files, Bilibili & Douyin

  • YouTube (youtube.com, youtu.be, Shorts, Live): works out of the box with no login required; picks a single clean caption track to avoid rate limits and strips rolling auto-caption duplicates before indexing. Search directly with video_discover(platform="youtube").
  • Local videos & screen recordings (.mp4, .mkv, .webm, .mov): indexed directly from disk without copying media files; sidecar .srt/.vtt subtitles supported.
  • Bilibili & Douyin: metadata preview, cross-platform search, full indexing, and optional account sign-in for favorites, likes, history, and creator lists.
  • Smart search routing (auto): English queries search YouTube (with a quick fallback to Bilibili if unreachable); Chinese queries search Bilibili. Change anytime in video2agent ui.

2. 11 focused MCP tools with inline visual evidence

video_ingest, video_digest, video_read, video_search, video_evidence, video_frames, video_perceive, video_discover, video_library, video_account, and video_settings. Contact sheets (3×3 grids), exact source frames, and login QR codes return natively as inline images in supporting MCP clients.

3. Batch comparison & UI motion analysis

  • Compare 1–10 videos side-by-side: surface consensus, contradictions, and unique points across tutorials, reviews, or interviews.
  • UI & motion recordings (video_perceive): measure shot cuts, motion peaks, and looping cadence numerically before pulling a single frame.

4. Honest about gaps

Every citation binds to the exact frame returned (HH:MM:SS). Unread on-screen text stays explicitly marked unknown rather than guessing, out-of-range timestamps return clear errors, and caption tracks that mismatch the audio fall back cleanly to speech recognition.


How It Works

How Video2Agent works

  • Shared local state: MCP servers, CLI commands, video2agent ui, and the DSH plugin share the same local index and credentials under ~/.video2agent.
  • Automatic media tools: FFmpeg and FFprobe are prepared on demand (including native Apple Silicon builds) when media processing first needs them.
  • Bounded media cache: A 20 GB default media cache limit keeps disk usage predictable while preserving your searchable text library.

Docs

Contributing

Issues, workflow ideas, and PRs are welcome — jump into Discussions or read CONTRIBUTING.md. Before opening a PR, run:

python -m unittest discover -s tests -q
ruff check src tests --select E,F,I --ignore E501
node tests/test_plugin_card.mjs
node tests/test_plugin_manifest.mjs
node tests/test_plugin_host_settings.mjs
node tests/test_plugin_campaign.mjs
node tests/test_plugin_dock_state.mjs

License

Apache-2.0. Third-party notices are in THIRD_PARTY_LICENSES.md.

If Video2Agent saved you from scrubbing another 1-hour timeline, a ⭐ helps more developers discover it.

Yorumlar (0)

Sonuc bulunamadi