{"_id":"@cf-lp/mcp-server-video-context","_rev":"3-11a2d481adc0b0f81b249b252d01ead6","name":"@cf-lp/mcp-server-video-context","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@cf-lp/mcp-server-video-context","version":"0.1.0","keywords":["mcp","model-context-protocol","video","ocr","ai","context","jira"],"license":"MIT","_id":"@cf-lp/mcp-server-video-context@0.1.0","maintainers":[{"name":"cf-lp","email":"phuonglqhe130835@gmail.com"}],"bin":{"mcp-server-video-context":"bin/cli.cjs"},"dist":{"shasum":"adfa01860b7d772eecab1d4b2581e6619f22c71f","tarball":"https://registry.npmjs.org/@cf-lp/mcp-server-video-context/-/mcp-server-video-context-0.1.0.tgz","fileCount":6,"integrity":"sha512-uY0OBFGx6kQKg70rvxntrLOmt4S8+oR5Yts8icDcSsC/TuQzJy3FHv7g2s498XlZqi5QBC9ssOR6Iw8M2pkTng==","signatures":[{"sig":"MEMCH2yvAlgdWs76Phhxe3NU2ihZc/znFpV/alCnAcMbiesCICXer9JOQvinvTLfJRemRTxI18kJpB/JIvs7hdw2dqP3","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":116631},"main":"./dist/index.js","type":"module","engines":{"node":">=18"},"scripts":{"dev":"tsup --watch","build":"tsup","inspect":"npx @modelcontextprotocol/inspector node dist/index.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"cf-lp","email":"phuonglqhe130835@gmail.com"},"_npmVersion":"10.9.2","description":"MCP server that analyzes videos and extracts optimized context for AI consumption - frame extraction, OCR, scene detection","directories":{},"_nodeVersion":"22.14.0","dependencies":{"zod":"^3.24.4","sharp":"^0.33.0","playwright":"^1.59.1","tesseract.js":"^5.1.1","fluent-ffmpeg":"^2.1.3","@ffmpeg-installer/ffmpeg":"^1.1.0","@modelcontextprotocol/sdk":"^1.12.1"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","typescript":"~5.8.2","@types/node":"^22.14.0","@types/fluent-ffmpeg":"^2.1.26"},"_npmOperationalInternal":{"tmp":"tmp/mcp-server-video-context_0.1.0_1777013554602_0.7785481412839641","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@cf-lp/mcp-server-video-context","version":"0.1.1","keywords":["mcp","model-context-protocol","video","ocr","ai","context","jira"],"license":"MIT","_id":"@cf-lp/mcp-server-video-context@0.1.1","maintainers":[{"name":"cf-lp","email":"phuonglqhe130835@gmail.com"}],"bin":{"mcp-server-video-context":"bin/cli.cjs"},"dist":{"shasum":"186c4515e88082b0209012f97a4226498990ecd9","tarball":"https://registry.npmjs.org/@cf-lp/mcp-server-video-context/-/mcp-server-video-context-0.1.1.tgz","fileCount":6,"integrity":"sha512-gwanWHMJHmjolnlstRJE4rdFu7J1nN6loqy8LyU0BY+BX6J1qYjMFPgSEq9yH7elvF5QWliHhCs2zuOVTjaYvQ==","signatures":[{"sig":"MEYCIQC9CSPoKZ0EWEYOjoL6qCd53oxONf+D5ix6/pkNfgLTuAIhAL5L5LTV76dqI1Aj+3JH2X4mDKVaKXNUSEhdVuYpzlxW","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":116843},"main":"./dist/index.js","type":"module","engines":{"node":">=18"},"scripts":{"dev":"tsup --watch","build":"tsup","inspect":"npx @modelcontextprotocol/inspector node dist/index.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"cf-lp","email":"phuonglqhe130835@gmail.com"},"_npmVersion":"10.9.2","description":"MCP server that analyzes videos and extracts optimized context for AI consumption - frame extraction, OCR, scene detection","directories":{},"_nodeVersion":"22.14.0","dependencies":{"zod":"^3.24.4","sharp":"^0.33.0","playwright":"^1.59.1","tesseract.js":"^5.1.1","fluent-ffmpeg":"^2.1.3","@ffmpeg-installer/ffmpeg":"^1.1.0","@modelcontextprotocol/sdk":"^1.12.1"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","typescript":"~5.8.2","@types/node":"^22.14.0","@types/fluent-ffmpeg":"^2.1.26"},"_npmOperationalInternal":{"tmp":"tmp/mcp-server-video-context_0.1.1_1777017153776_0.35100969649325786","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@cf-lp/mcp-server-video-context","version":"0.2.0","description":"MCP server that analyzes videos and extracts optimized context for AI consumption - frame extraction, OCR, scene detection","type":"module","license":"MIT","keywords":["mcp","model-context-protocol","video","ocr","ai","context","jira"],"bin":{"mcp-server-video-context":"bin/cli.cjs"},"main":"./dist/index.js","scripts":{"build":"tsup","dev":"tsup --watch","prepublishOnly":"npm run build","inspect":"npx @modelcontextprotocol/inspector node dist/index.js"},"dependencies":{"@ffmpeg-installer/ffmpeg":"^1.1.0","@modelcontextprotocol/sdk":"^1.12.1","fluent-ffmpeg":"^2.1.3","sharp":"^0.33.0","tesseract.js":"^5.1.1","zod":"^3.24.4"},"devDependencies":{"@types/fluent-ffmpeg":"^2.1.26","@types/node":"^22.14.0","tsup":"^8.4.0","typescript":"~5.8.2"},"engines":{"node":">=18"},"_id":"@cf-lp/mcp-server-video-context@0.2.0","gitHead":"d2702da87b27a36984ee95c8cc7a0a8c73d4c7c2","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-nNWl7FSKUkUfXIw9pqGmGyFMtqG6PotkKuCdrpK+UgIREvWZUk63aP9FG2raxPtb4D5mwRZijh8K5UvMgOcE/g==","shasum":"1cdb49540fdd72428a2d34bb3a935951e42c6c1b","tarball":"https://registry.npmjs.org/@cf-lp/mcp-server-video-context/-/mcp-server-video-context-0.2.0.tgz","fileCount":6,"unpackedSize":177887,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIAa0neP+d6pV4KP0bKWmvK2Ac2LgJU5FZHuTaDpVjA1GAiEA0ycRZsF0yhivWqrD/a+BPfpB3+GLhvyYigQPR6e7sdg="}]},"_npmUser":{"name":"cf-lp","email":"phuonglqhe130835@gmail.com"},"directories":{},"maintainers":[{"name":"cf-lp","email":"phuonglqhe130835@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mcp-server-video-context_0.2.0_1777345267215_0.8574439288133531"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-24T06:52:34.491Z","modified":"2026-04-28T03:01:07.497Z","0.1.0":"2026-04-24T06:52:34.768Z","0.1.1":"2026-04-24T07:52:33.909Z","0.2.0":"2026-04-28T03:01:07.399Z"},"license":"MIT","keywords":["mcp","model-context-protocol","video","ocr","ai","context","jira"],"description":"MCP server that analyzes videos and extracts optimized context for AI consumption - frame extraction, OCR, scene detection","maintainers":[{"name":"cf-lp","email":"phuonglqhe130835@gmail.com"}],"readme":"# mcp-server-video-context\n\nMCP server that analyzes videos and extracts structured text context optimized for AI consumption.\n\n**Pipeline:** Video → Smart Frame Extraction → OCR → Text Classification → Token-Optimized Markdown\n\n## Features\n\n- **Scene detection** — ffmpeg-based scene change detection with configurable sensitivity\n- **Perceptual dedup** — Parallel hash-based deduplication removes near-identical frames\n- **OCR** — Tesseract.js text extraction with persistent worker (no re-init overhead)\n- **Text classification** — Prioritizes errors, stack traces, code over UI labels\n- **Caching** — File-based cache with TTL expiry and secure permissions (0600)\n- **Multi-source download** — 4-tier strategy: direct HTTP, yt-dlp, browser fallback, local file\n- **Security hardened** — SSRF protection, path traversal prevention, input sanitization, TLS enforcement\n- **Concurrency safe** — Semaphore-controlled parallel analyses with proper resource cleanup\n\n## Quick Start\n\n**Option 1 — Claude Code CLI (recommended):**\n\n```bash\nclaude mcp add video-context npx -- -y @cf-lp/mcp-server-video-context\n```\n\n**Option 2 — Manual config (`claude_desktop_config.json` / MCP settings):**\n\n```json\n{\n  \"mcpServers\": {\n    \"video-context\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@cf-lp/mcp-server-video-context\"]\n    }\n  }\n}\n```\n\n## Tools\n\n### `analyze_video`\n\nAnalyze a video and get structured context.\n\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `video_url` | string | * | URL to download video from |\n| `video_path` | string | * | Local file path |\n| `auth_header` | string | No | Authorization header for URL download |\n| `max_frames` | number | No | Max frames to analyze (default from `MAX_FRAMES` env) |\n| `include_frames` | boolean | No | Include base64 thumbnails (default: false) |\n| `use_browser` | boolean | No | Force browser-based download (default: false) |\n\n\\* Provide exactly one of `video_url` or `video_path`.\n\n### `get_cached_analysis`\n\nRetrieve cached analysis results.\n\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `video_url` | string | * | URL used in original analysis |\n| `video_path` | string | * | Path used in original analysis |\n| `cleanup_expired` | boolean | No | Clean up expired cache entries |\n\n\\* At least one of `video_url` or `video_path` is required.\n\n### `browser_download`\n\nDownload a video via the system browser (for SSO/OAuth-protected URLs).\n\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `url` | string | Yes | URL to download |\n| `jira_domain` | string | No | Jira domain for attachment URL conversion |\n| `filename` | string | No | Expected filename |\n\n### `open_in_browser`\n\nOpen a URL in the system default browser.\n\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `url` | string | Yes | URL to open (http/https only) |\n\n## Video URL Support\n\n`analyze_video` supports all common video sources via a 4-tier download strategy:\n\n1. **Direct HTTP fetch** — fast path for direct video URLs (`.mp4`, `.webm`, `.mov`, `.avi`, `.mkv`, `.m4v`, `.ts`, `.flv`)\n2. **yt-dlp extraction** — YouTube, Vimeo, TikTok, Twitter/X, Facebook, Instagram, Google Drive, Dropbox, HLS/DASH streams, and 1000+ other sites\n3. **Browser download** — fallback for SSO/OAuth-protected URLs (opens user's default browser)\n4. **Local file** — pass `video_path` for already-downloaded files\n\nURL routing is automatic — just pass any video URL to `analyze_video(video_url=...)`.\n\n### yt-dlp (Optional but Recommended)\n\nyt-dlp enables automatic download from video platforms without user interaction.\n\n```bash\nbrew install yt-dlp          # macOS\npip install yt-dlp            # cross-platform\n```\n\nThe server works without yt-dlp but falls back to browser download for platform URLs.\n\n## Workflow with Jira (Atlassian MCP)\n\n```\n1. Use Atlassian MCP → getJiraIssue(\"PROJ-123\") → get attachment URLs\n2. Use browser_download → download via authenticated browser session\n3. Use analyze_video(video_path=...) → get structured markdown context\n```\n\n## Output Format\n\n```markdown\n## Video: recording.mp4 | 2m34s | 1920x1080 | 18 frames analyzed\n\n### Timeline\n| Time | Key Text |\n|------|----------|\n| 0:00 | Sign in to Dashboard, Email, Password |\n| 0:12 | Error: 500 Internal Server Error |\n\n### Errors & Stack Traces\n- 500 Internal Server Error\n- TypeError: Cannot read property 'map' of undefined at App.jsx:42\n\n### UI Labels\nSign in, Dashboard, Settings\n```\n\n## Environment Variables\n\nAll optional:\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `CACHE_DIR` | `~/.cache/mcp-video-context` | Cache directory |\n| `CACHE_TTL_HOURS` | `168` (7 days) | Cache expiry |\n| `MAX_FRAMES` | `30` | Default max frames (1-200) |\n| `SCENE_THRESHOLD` | `0.3` | Scene change sensitivity (0.0-1.0) |\n| `FFMPEG_PATH` | auto-detected | Custom ffmpeg path |\n| `YT_DLP_PATH` | auto-detected | Custom yt-dlp path |\n| `YT_DLP_TIMEOUT` | `600000` (10 min) | yt-dlp download timeout (ms) |\n| `MAX_VIDEO_SIZE_MB` | `500` | Max video download size (10-5000 MB) |\n\n## Security\n\n- **SSRF protection** — DNS resolution validates against private IP ranges before fetching\n- **Path traversal prevention** — `video_path` is resolved and validated\n- **Input sanitization** — Auth headers reject newline injection, URLs validate scheme\n- **TLS enforced** — All external connections use certificate verification\n- **Secure cache** — Files created with `0600` permissions, directories with `0700`\n- **URL logging** — Query parameters redacted from logs to prevent token leakage\n- **Concurrency limits** — Max 2 concurrent analyses prevent resource exhaustion\n\n## Requirements\n\n- Node.js >= 18\n\nffmpeg is bundled automatically — no manual installation needed. yt-dlp is optional but recommended for platform video URLs (YouTube, Vimeo, etc.).\n\n## Development\n\n```bash\nnpm install\nnpm run build        # Build with tsup\nnpm run dev          # Watch mode\nnpm run inspect      # MCP Inspector\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}