Skip to main content
Glama

🗄️ MediaVault MCP

English | 简体中文

CI Coverage Python MCP License PRs Welcome

Paste a link, get the original. A local, key-free stdio MCP server that pulls native no-watermark media from 1800+ platforms and hands your AI agent real video evidence — transcript plus keyframe images — without ever calling a second LLM.

Your agent already has a model. Why should a media MCP demand another API key? MediaVault collects deterministic evidence on your machine (yt-dlp / f2 / gallery-dl → ffmpeg → local Whisper) and returns it as MCP content blocks, so the agent you already run does the reasoning. An optional server-side summary fusion is there if you want it, but it is never required.

✨ Why MediaVault?

  • 🔑 Zero required API keys. parse_url, download and analyze work with no key and never call a third-party model. Speech is transcribed on-device with faster-whisper; frames come back as image blocks for the agent's own vision.

  • 🛡️ Honest no-watermark claims. We fetch the platform's own source stream and report native / unknown / none per item. No cropping, no inpainting, no pretending a watermark was removed.

  • 🔗 Scored adapter fallback chain. f2 (CN-first) → gallery-dl (image sets) → yt-dlp (1800+ sites). A stale extractor degrades transparently instead of failing the request.

  • 🧠 Agent-native video understanding. One analyze call returns a JSON evidence block (caption, timestamped transcript, pipeline status) plus one image content block per keyframe — exactly what a vision-capable agent needs.

  • 📚 Persistent media library. Every result is atomically cached per video; repeat calls skip re-downloading and re-transcribing, with refresh=true to force a fresh run.

  • 🔒 Local-first and private. Cookies and proxies stay on your machine, are validated before use, and never appear in logs or cached evidence.

Related MCP server: avv-mcp

🧩 How it works

flowchart LR
    A[AI Agent / MCP Client] -->|stdio JSON-RPC| B[MediaVault MCP Server]
    B --> C[Scored Adapter Registry]
    C --> D1["f2 · score 200<br/>Douyin / XHS / Kuaishou / TikTok"]
    C --> D2["gallery-dl · 150<br/>image sets"]
    C --> D3["yt-dlp · 100<br/>1800+ sites"]
    D1 -. AdapterStale .-> D2 -. AdapterStale .-> D3
    B --> E[Key-free Evidence Pipeline]
    E --> Gf[ffmpeg keyframes]
    E --> Gw[faster-whisper on-device ASR]
    B --> H[("Media Library<br/>evidence.json cache")]
    B -. optional .-> I[OpenAI-compatible endpoint<br/>summarize fusion only]

The MCP surface never changes when a platform shifts: only the adapter behind the registry does, and AdapterStale automatically walks the chain.

🚀 Quick start

Requires Python 3.11+, uv, and ffmpeg (brew install ffmpeg on macOS, or your distro's package).

git clone https://github.com/Majiturbo/mediavault-mcp.git
cd mediavault-mcp
uv venv --python 3.11
uv pip install -e ".[dev]"
uv pip install -e ".[local-asr]"   # optional: fully offline speech-to-text
cp .env.example .env               # optional: proxy/cookies/LLM settings

Run the stdio server:

uv run python -m mediavault
# or the installed console script: mediavault

Point any MCP client at it (stdio):

{
  "mcpServers": {
    "mediavault": {
      "command": "uv",
      "args": ["--directory", "/abs/path/to/mediavault-mcp",
               "run", "python", "-m", "mediavault"]
    }
  }
}

Optional backends are auto-detected on PATH — install neither, one, or both:

pipx install f2           # first-class Douyin/Xiaohongshu/Kuaishou/TikTok/Weibo/Bilibili
pipx install gallery-dl   # image-set posts (Xiaohongshu, Instagram, Pinterest, Weibo)

🛠️ The seven tools

Tool

Input

What it does

parse_url

share text or URL

Normalized metadata, no bytes downloaded

download

share text or URL, quality=compat/quality/speed

Native media under MEDIAVAULT_HOME

analyze

share text or URL, with_media=true, refresh=false

No key: JSON evidence + keyframe image blocks, cached per video

summarize

share text or URL, with_media=true

Optional server-side fused summary job (needs an OpenAI-compatible endpoint); poll with get_job

get_job

job id

Job polling (queued/running/succeeded/failed)

list_jobs

—

Recent background jobs, newest first

list_library

—

Index cached evidence/summary artifacts

Collection responses use an explicit envelope {"count": n, "results": [...]}, so a pasted blob with several links never silently loses one. analyze is single-resource (its images belong to one clip) and reports urls_detected / additional_urls so the agent knows which links still need a call.

🌐 Platform coverage

Platform

Video

Image sets

Primary adapter

Douyin (抖音), Kuaishou (快手)

✅

—

f2 → yt-dlp fallback

Xiaohongshu (小红书)

✅

✅

f2 → gallery-dl → yt-dlp

TikTok, Weibo (微博), Bilibili (B站)

✅

partial

f2 → yt-dlp

YouTube, X/Twitter, Vimeo, Reddit

✅

—

yt-dlp (native clean streams)

Instagram, Pinterest

✅

✅

gallery-dl → yt-dlp

1800+ other yt-dlp sites

✅

partial

yt-dlp

External CLIs are optional: when f2 or gallery-dl is absent, its adapter raises AdapterStale and the registry falls through automatically — the same MCP call keeps working.

🧠 Two ways to understand a video

1. analyze — agent-native, no key (recommended). Deterministic evidence: title/author/caption, a timestamped transcript (local faster-whisper or your ASR endpoint), and up to MEDIAVAULT_KEYFRAME_MAX downscaled JPEG keyframes returned as MCP image blocks. Every stage reports itself honestly in pipeline (ok / off / not-configured / extracted / skipped-* / empty / error); one failed stage never kills the run. Your agent reads the transcript and looks at the frames with its own model.

2. summarize — optional server-side fusion. Runs the same evidence collection, then makes one OpenAI-compatible chat call that fuses caption, transcript and visual observations into a stable schema (tldr, chapters, entities, hooks, ...). Fails fast with an actionable message when no endpoint is configured — in which case analyze is the answer.

Fully local, no commercial key

Point everything at a local stack and keep audio on-device:

OPENAI_BASE_URL=http://localhost:11434/v1   # Ollama / LM Studio / vLLM
OPENAI_API_KEY=ollama                        # placeholder, local servers ignore it
MEDIAVAULT_LLM_MODEL=qwen2.5
MEDIAVAULT_VLM_MODEL=llava
MEDIAVAULT_ASR_BACKEND=local                 # faster-whisper, audio never leaves the machine
MEDIAVAULT_WHISPER_MODEL=base
MEDIAVAULT_WHISPER_DEVICE=mps                # cpu on CI/Linux · mps on Apple Silicon · cuda on NVIDIA

⚙️ Configuration

All settings come from environment variables or .env (see .env.example for the full list).

Variable

Default

Purpose

MEDIAVAULT_HOME

~/MediaVault

Download + cache root (<platform>/<id>/)

MEDIAVAULT_PROXY

—

http(s)/socks4/socks5/socks5h; bare host:port assumed HTTP; invalid values fail fast

MEDIAVAULT_COOKIES_FILE

—

Netscape cookies.txt, validated before use; bad paths skipped with a warning

MEDIAVAULT_COOKIES_BROWSER

—

Reuse a logged-in browser (chrome/firefox/...)

MEDIAVAULT_F2_BIN / MEDIAVAULT_GALLERYDL_BIN

f2 / gallery-dl

Override optional CLI paths

MEDIAVAULT_ASR_BACKEND

openai

openai (hosted) / local (faster-whisper) / off

MEDIAVAULT_WHISPER_MODEL / _DEVICE

base / cpu

Local ASR size and device (cpu/mps/cuda)

MEDIAVAULT_KEYFRAME_MAX / _WIDTH

8 / 768

Frame budget and downscale width

OPENAI_BASE_URL / OPENAI_API_KEY

OpenAI / —

Only needed for summarize, hosted ASR and server VLM

Downloads land in ~/MediaVault/<platform>/<canonical_id>/ alongside resource.json, evidence.json (the analyze cache) and optional summary.json; media runs also write audio.wav and a keyframes/ folder.

🧭 Design principles

  1. The host agent is the brain. MCP servers should gather evidence, not rent a second LLM behind the caller's back. Model calls are opt-in.

  2. Degrade honestly, per stage. Every adapter failure, skipped media stage and ignored cookie file is surfaced as a marker or note — never hidden.

  3. No-watermark means source-native, not "removed". We never crop or blur; unverifiable streams stay unknown.

  4. Credentials stay local. No third-party parser keys, no telemetry, no credentials in URLs, logs or caches.

  5. Test the seams, mock the world. 228 offline tests at 100% statement and branch coverage; real ffmpeg smoke tests run when ffmpeg is present and skip themselves otherwise.

🗺️ Roadmap

  • Next: self-built SSR adapters for CN platforms (calibrated against live page shapes), richer local models — speaker diarization and denser scene detection.

  • Always: keeping the adapter chain and evidence schema stable while platforms drift.

🧪 Development

.venv/bin/ruff check src tests                          # lint
.venv/bin/python -m pytest -q --cov-fail-under=100      # offline suite, 100% gate
uv build                                                # wheel + sdist

CI runs the same three checks on Ubuntu/macOS × Python 3.11/3.12. See CONTRIBUTING.md for the adapter contract and coverage policy, CHANGELOG.md for release history, and SECURITY.md for vulnerability reporting.

⚖️ License

MIT. Only process publicly available content, respect each platform's terms of service and applicable copyright, and keep downloads for personal study. This project performs no DRM circumvention.

Available Tools

7 tools
analyzeA

Collect video evidence WITHOUT any server-side API key, for this agent's own model to summarize. Returns one JSON text block (title, author, caption, timestamped transcript, pipeline status) followed by one image content block per extracted keyframe, so a vision-capable agent can see the frames directly. Local faster-whisper handles speech when configured; nothing is sent to a third-party model. Set with_media=false for caption/metadata only (no download). Results are cached per video: repeat calls return cached evidence (cached=true); set refresh=true to re-download and re-analyze. Use summarize instead only if you want the MCP server itself to produce the fused structured summary.

Inputs: text (required), refresh, with_media.

downloadB

Download native media for every URL in the pasted text.

quality: "compat" (default, <=1080p H.264 MP4), "quality" (highest source), or "speed" (smallest). Returns local file paths under MEDIAVAULT_HOME.

Inputs: text (required), quality.

get_jobA

Return status and result of a summarize job (queued/running/succeeded/failed).

Inputs: job_id (required).

list_jobsB

List recent background jobs, newest first.

Inputs: no named parameters.

list_libraryA

List cached analyze/summary artifacts under MEDIAVAULT_HOME, newest discovery order, with canonical id, title and whether a fused summary is available. Re-run analyze with refresh=true to update an entry.

Inputs: no named parameters.

parse_urlA

Extract every URL from pasted share text and return normalized media metadata (platform, author, caption, direct streams, no-watermark status). Does not download any bytes.

Inputs: text (required).

summarizeA

Submit an async multimodal summary job. Returns a job id; poll with get_job. With with_media=true (default) the video is downloaded at speed profile and analyzed through ASR transcript + keyframe VLM when those backends are configured; failures degrade honestly to caption-only. Set with_media=false for a metadata-only caption summary.

Inputs: text (required), with_media.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 7 tools

    Disambiguation4/5

    Most tools are clearly separated by resource and action: parse_url only extracts metadata, download only fetches bytes, and get_job/list_jobs/list_library are distinct. The only fuzzy pair is analyze vs summarize, which both process a video but differ in who produces the summary; the descriptions call this out explicitly, so an agent can distinguish them.

    Naming Consistency4/5

    The set mostly uses a verb_noun pattern (parse_url, list_library, get_job, list_jobs) but mixes in bare verbs (download, analyze, summarize). It is still readable and intuitive, just not a single uniform convention.

    Tool Count5/5

    Seven tools is well-scoped for a media ingest/analyze/summarize server: metadata parsing, downloading, local evidence collection, server-side summarization, job polling/listing, and library listing. Each tool has a clear role without filler.

    Completeness4/5

    The core lifecycle is covered: parse, download, analyze, summarize, track jobs, and list cached artifacts. Minor gaps remain, such as no job cancellation, no deletion/cleanup of library entries, and no single-item library lookup, but these are workable omissions.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers