Skip to main content
Glama
video-url-analyzer-mcp

video-url-analyzer-mcp

by u2n4

これは何ですか?

Video URL Analyzer MCPは、Claude(またはMCP互換のAI)がYouTube、TikTok、Instagramの動画をURLを貼り付けるだけで分析できるようにするModel Context Protocol (MCP) サーバーです。GoogleのGemini APIを活用し、音声と映像の両方を分析することで、文字起こしの抽出、AIによるインサイトの提供、さらには実行可能なチュートリアル手順の抽出まで行います。

Related MCP server: Social → Context

機能

  • YouTube分析 — Gemini APIによる直接分析(ダウンロード不要)

  • TikTok & Instagram — yt-dlpによるダウンロードとGemini Files APIを使用した非同期ジョブパターン

  • 音声・映像のフル分析 — 動画フレームと音声・発話の両方を分析

  • 6つのツール — 分析、文字起こし、Q&A、視聴・分析、チュートリアル実行、ジョブ確認

  • バイリンガル — アラビア語と英語のプロンプトおよび応答をサポート

  • 非同期ジョブ — バックグラウンド処理によりClaude Desktopのタイムアウトによるクラッシュを防止

  • セキュリティ強化 — URL許可リスト、SSRF保護、コマンドインジェクション防止、パストラバーサルブロック

  • ゼロコンフィグインストール — uvx video-url-analyzer-mcpを実行するだけですぐに使用可能

対応プラットフォーム

プラットフォーム

手法

速度

YouTube

Geminiによる直接分析 — ダウンロード不要

即時

TikTok

tikwm.com API (高速) → yt-dlp フォールバック

~8秒

Instagram

curl_cffiによるページスクレイピング (高速) → yt-dlp フォールバック

~10秒

YouTube動画はGeminiのネイティブな動画理解機能を通じて直接分析されるため、ダウンロードやアップロードがゼロで、最高速度で処理されます。


クイックスタート

オプション1: uvx (推奨)

uvが必要です。

Claude Desktop -- claude_desktop_config.jsonに追加:

{
  "mcpServers": {
    "video-analyzer": {
      "command": "uvx",
      "args": ["video-url-analyzer-mcp"],
      "env": {
        "GEMINI_API_KEY": "your_key"
      }
    }
  }
}

Claude Code:

claude mcp add video-analyzer -s user -e GEMINI_API_KEY=your_key -- uvx video-url-analyzer-mcp

Cursor / VS Code -- .cursor/mcp.json または .vscode/mcp.jsonに追加:

{
  "servers": {
    "video-analyzer": {
      "command": "uvx",
      "args": ["video-url-analyzer-mcp"],
      "env": { "GEMINI_API_KEY": "your_key" }
    }
  }
}

Windsurf -- ~/.codeium/windsurf/mcp_config.jsonに追加:

{
  "mcpServers": {
    "video-analyzer": {
      "command": "uvx",
      "args": ["video-url-analyzer-mcp"],
      "env": { "GEMINI_API_KEY": "your_key" }
    }
  }
}

オプション2: pip install

pip install video-url-analyzer-mcp

オプション3: ソースからインストール

git clone https://github.com/u2n4/video-url-analyzer-mcp.git
cd video-url-analyzer-mcp
pip install -e .

ツール

ツール

説明

analyze_video

カスタムプロンプトを使用した音声・映像のフル分析。最先端のマルチモーダル理解のためにGeminiを使用します。

get_transcript

話者識別付きのタイムスタンプ付き文字起こしを抽出。自動検出により100以上の言語をサポート。

ask_about_video

「何人登場していますか?」「0:45に表示されているブランドは何ですか?」「主な主張を要約して」など、動画に関するあらゆる質問に対応。

watch_and_analyze

技術系動画からチュートリアル手順、シェルコマンド、コードスニペット、ファイルパスを抽出。

execute_tutorial_steps

抽出された手順を安全に確認し、承認を得て実行。コマンドとパスの検証によるサンドボックス環境。

check_analysis_job

TikTok/Instagramの非同期ダウンロードのバックグラウンドジョブステータスをポーリング。

仕組み

YouTube — 同期処理: URLがGemini APIに直接送信され、即座に分析されます(ダウンロードなし)。

TikTok & Instagram — 非同期処理: 動画がyt-dlp経由でダウンロードされ、Gemini Files APIにアップロードされて分析された後、クリーンアップされます。job_idが即座に返されるため、check_analysis_jobでポーリングします。


使用例

# Full video analysis
analyze_video("https://www.youtube.com/watch?v=dQw4w9WgXcQ")

# Custom analysis prompt
analyze_video("https://www.tiktok.com/@user/video/123",
              prompt="List every product shown and estimate prices")

# Multilingual transcript extraction
get_transcript("https://www.instagram.com/reel/ABC123/", lang="ar")

# Ask specific questions about video content
ask_about_video("https://youtu.be/abc",
                question="What programming language is used in the tutorial?")

# Watch & build — extract tutorial steps
watch_and_analyze("https://www.youtube.com/watch?v=tutorial123")

アーキテクチャ

コンポーネント

役割

Gemini API

マルチモーダルモデル — 音声と映像を一度に理解

FastMCP 3.x

stdioトランスポート上のMCPプロトコルフレームワーク

yt-dlp + curl_cffi

アンチボットを回避するためのブラウザなりすまし機能付き動画ダウンローダー

tikwm.com API

yt-dlpがWAFでブロックされた際のTikTok用高速パスフォールバック

バックグラウンドジョブ

Claude Desktopのタイムアウトを防ぐためのTikTok/Instagram用非同期スレッド

video-url-analyzer-mcp/
├── pyproject.toml                    # Package metadata & dependencies
├── src/
│   └── video_url_analyzer_mcp/
│       ├── __init__.py               # Package init + version
│       ├── __main__.py               # python -m support
│       └── server.py                 # Main MCP server (all 6 tools)
├── .env.example                      # Environment variable template
├── llms.txt                          # AI-readable project summary
├── llms-install.md                   # AI-readable install guide
├── CONTRIBUTING.md
├── CHANGELOG.md
└── LICENSE

プラットフォーム検出

URLは自動的に適切なパイプラインにルーティングされます:

  • YouTube: youtube.com, youtu.be, youtube.com/shorts/

  • TikTok: tiktok.com, vm.tiktok.com, vt.tiktok.com

  • Instagram: instagram.com/reels/, instagram.com/reel/, instagram.com/p/


セキュリティ

このサーバーは包括的な脅威モデルに対して強化されています:

レイヤー

保護内容

SSRF

URL許可リスト — YouTube、TikTok、Instagramドメインのみ許可。プライベートIP、localhost、file://はブロック。

コマンドインジェクション

shell=False + shlex.split()を使用。危険なコマンドのブロックリスト(rm -rf、リバースシェル、eval、パイプからシェルへの実行など)。

パストラバーサル

25以上の機密パスパターンをブロック(.ssh, .aws, .env, システムディレクトリ, AppData)。

TLS

すべてのダウンロードで完全な証明書検証を実施。

ブラウザCookie

VIDEO_ANALYZER_COOKIES=trueによるオプトインのみ。デフォルトでは無効。

ダウンロードサイズ

動画あたり100MBのハード制限。

DoS保護

最大10個の同時バックグラウンドジョブ。1時間後に自動期限切れ。200分析のストレージ上限。

スキーマ検証

GeminiのJSON応答を実行前に検証。応答サイズは500K文字に制限。

依存関係

すべてのバージョンをpyproject.tomlで固定。


設定

変数

説明

デフォルト

GEMINI_API_KEY

Google Gemini APIキー (必須)

—

ANALYSES_DIR

分析結果を保存するディレクトリ

./analyses

VIDEO_ANALYZER_COOKIES

yt-dlpのブラウザCookieを有効化

false


技術スタック

技術

用途

google-genai

Google Gemini API SDK

FastMCP

MCPプロトコルフレームワーク

yt-dlp

動画ダウンローダー

curl_cffi

ブラウザなりすまし (TLSフィンガープリント)

python-dotenv

環境変数読み込み


トラブルシューティング

問題

解決策

GEMINI_API_KEY not set

.envファイルを作成するか、環境変数経由で渡してください

TikTokのダウンロード失敗

tikwm.comフォールバックが自動的に有効になります。curl_cffiがインストールされていることを確認してください。

Instagramのダウンロード失敗

ブラウザなりすましサポートのため pip install curl_cffi を実行してください

Windowsで ENOENT エラー

コマンドとして uvx video-url-analyzer-mcp を使用してください

Claude Desktopのタイムアウト

TikTok/Instagramはバックグラウンドで実行されます — check_analysis_job(job_id) でポーリングしてください

Pythonが見つからない

python.org からPython 3.10+をインストールしてください


貢献

ガイドラインについては CONTRIBUTING.md を参照してください。

ライセンス

MIT — LICENSE を参照してください。

サポート

もしこれが役に立ったなら、ぜひこのリポジトリにスターを付けてください!


サウジアラビア東部州にて ❤️ を込めて作成。


العربية

خادم تحليل الفيديو بالذكاء الاصطناعي

خادم MCP لتحليل الفيديو باستخدام Google Gemini — احدث واقوى نموذج ذكاء اصطناعي متعدد الوسائط من جوجل.

المميزات

الاداة

الوصف

analyze_video

تحليل شامل للصوت والصورة مع دعم الاوامر المخصصة

get_transcript

استخراج النص المنطوق مع الطوابع الزمنية — يدعم +100 لغة

ask_about_video

اسال اي سؤال عن محتوى الفيديو

watch_and_analyze

استخراج خطوات الشروحات التقنية والاوامر والاكواد

execute_tutorial_steps

مراجعة وتنفيذ الخطوات المستخرجة بامان

المنصات المدعومة

المنصة

السرعة

يوتيوب

فوري — تحليل مباشر بدون تحميل

تيك توك

~8 ثواني — واجهة tikwm.com السريعة

انستاجرام

~10 ثواني — استخراج مباشر من الصفحة

التثبيت السريع

git clone https://github.com/u2n4/video-url-analyzer-mcp.git
cd video-url-analyzer-mcp
pip install -e .

الامان

الخادم محمي ضد:

  • SSRF — قائمة بيضاء للنطاقات المسموحة فقط

  • حقن الاوامر — حظر الاوامر الخطيرة + تنفيذ بدون shell

  • اختراق المسارات — حظر 25+ مسار حساس

  • حماية من الحمل الزائد — حد اقصى 10 مهام متزامنة

الحصول على مفتاح API

  1. اذهب الى Google AI Studio

  2. انشئ مفتاح API مجاني

  3. ضعه في ملف .env

Available Tools

18 tools
analyze_videoA

Analyze a video or photo/slideshow post from YouTube, TikTok, or Instagram.

Provides comprehensive audio + visual analysis using Gemini AI. Works with videos AND photo/slideshow posts on TikTok, Instagram, and YouTube community posts. YouTube videos are analyzed directly and return the result immediately. TikTok and Instagram videos are processed in the background — the tool returns a job_id. Use check_analysis_job(job_id) to poll for the result.

Inputs: url (required), model, prompt. Returns: result

analyze_video_segmentB

Analyze only a selected video segment.

Uses Gemini video_metadata clipping when available. Gemini performs video/audio/visual reasoning. detail controls model + max_output_tokens + thinking/media config.

Inputs: end (required), url (required), start (required), model, +3 more. Returns: result

ask_about_videoA

Ask a specific question about a video or photo/slideshow post.

Works with videos AND photo/slideshow posts on TikTok, Instagram, and YouTube community posts. YouTube returns the answer immediately. TikTok/Instagram return a job_id — use check_analysis_job(job_id) to poll for the result.

Inputs: url (required), question (required), model. Returns: result

ask_video_contextC

Answer a question from saved video context without Gemini by default.

Inputs: question (required), video_id_or_url (required), detail, use_gemini, +1 more. Returns: result

check_analysis_jobA

Check the status of a background video analysis job.

When analyze_video, get_transcript, ask_about_video, or watch_and_analyze returns a job_id (for TikTok/Instagram videos), use this tool to poll for the result. Keep calling until status is "completed" or "failed".

Inputs: job_id (required). Returns: result

cleanup_video_cacheC

Inspect or clean managed video cache files. Safe dry-run by default.

Inputs: scope, dry_run, video_id. Returns: result

delete_video_contextC

Delete one saved local video context file.

Inputs: video_id_or_url (required). Returns: result

execute_tutorial_stepsA

Review or execute tutorial steps extracted by watch_and_analyze.

SAFETY: By default (confirm=false), this only shows a summary of what WOULD be executed. Set confirm=true ONLY after reviewing the steps.

Inputs: steps_json (required), confirm. Returns: result

find_video_momentsB

Find moments in a video matching a semantic query.

Gemini performs the video/audio/visual reasoning. detail controls model + max_output_tokens + thinking/media config. compact is default and returns concise structured JSON.

Inputs: url (required), query (required), model, detail, +3 more. Returns: result

get_transcriptA

Extract speech transcript from a video or slideshow audio track.

YouTube returns the result immediately. TikTok/Instagram return a job_id — use check_analysis_job(job_id) to poll for the result. Slideshows without audio return a structured slideshow_no_audio response.

Inputs: url (required), lang, model. Returns: result

get_video_clipC

Extract a local video clip under 30 seconds and return metadata.

Inputs: end (required), start (required), video_id_or_url (required), reason, +3 more. Returns: result

get_video_evidence_assetC

Find saved visual evidence and return a local frame/clip reference.

Inputs: request (required), video_id_or_url (required), asset_type, preferred_end, +3 more. Returns: result

get_video_frameC

Extract a local still frame and return compact asset metadata.

Inputs: timestamp (required), video_id_or_url (required), reason, force_refresh, +1 more. Returns: result

list_video_contextsC

List saved local video context files.

Inputs: limit, filter_text. Returns: result

list_video_sourcesC

List cached video sources, contexts, and assets. Never calls Gemini.

Inputs: limit, filter_text. Returns: result

prepare_slideshow_assetsA

Return slideshow images as ordered MCP image blocks for client-side vision.

This tool does not call Gemini. It downloads TikTok Photo Mode, Instagram photo/carousel posts, or YouTube community post images, then returns each image directly to the MCP client with an explicit image_index label. Use it when you want Claude/the client AI to inspect the images itself instead of receiving a Gemini-generated analysis.

Inputs: url (required), include_audio. Returns: result

prepare_video_contextC

Analyze a whole video once and save a local structured context.

Inputs: url (required), model, detail, chunk_seconds, +1 more. Returns: result

watch_and_analyzeA

Watch a video tutorial and extract all technical steps, commands, and code.

Downloads the video, analyzes it with Gemini AI, and returns structured JSON with every command, code snippet, file path, and tool mentioned. YouTube returns the result immediately. TikTok/Instagram return a job_id — use check_analysis_job(job_id) to poll for the result.

This tool ONLY analyzes — it does NOT execute anything. Use execute_tutorial_steps to run the extracted steps after review.

Inputs: url (required), lang, model. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 18 tools

    Disambiguation3/5

    Several tools have overlapping purposes, such as analyze_video, watch_and_analyze, and prepare_video_context all performing analysis, and multiple get_* tools for extracting clips/frames. While descriptions provide some differentiation, an agent could easily confuse them.

    Naming Consistency4/5

    Tool names consistently use verb_noun snake_case (e.g., analyze_video, get_transcript). Minor deviations include ask_video_context (missing preposition) and watch_and_analyze (compound verb), but overall pattern is predictable.

    Tool Count3/5

    18 tools is somewhat high for a video analyzer, covering analysis, Q&A, extraction, and management. The count is at the upper bound of reasonable, but many tools are specialized and the scope justifies most.

    Completeness4/5

    The tool surface covers analysis, Q&A, transcript, moments, clips, context management, and tutorial extraction. Missing operations like updating sources or more advanced editing, but core workflows are well-supported.

    Maintenance

    ActivityMaintained
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers