openmedia-mcp
Enables AI agents to extract, analyze, and manipulate images, PDFs, video, and audio while conserving context through downscaling, truncation, and frame/page caps.
README
openmedia-mcp
Context-efficient MCP server suite for extracting, analyzing and manipulating media — images, PDFs, video, audio — designed for AI agents.
Works with any MCP-compatible harness (opencode, Claude Code/Desktop, Cursor, Windsurf, Cline, LM Studio, ...) over stdio, streamable HTTP, or SSE.
Why
Multimodal models can see, but most harnesses give them no clean way to look at a video, a scanned PDF, or a 20 MB photo without either failing or burning enormous context. openmedia-mcp fixes that with hard rules:
- Every visual output is downscaled + recompressed before it reaches the model (configurable max dimension / JPEG quality).
- Every text output is capped with an explicit truncation marker telling the model how to fetch more.
- Frame/page caps per call (12 frames, 8 pages) prevent accidental context floods.
- URLs are first-class: video page URLs (YouTube + 1000+ sites via yt-dlp) are fetched once at ≤720p and cached; direct file URLs are cached with a size cap.
Requirements
Python ≥ 3.10 plus system binaries (all resolved at call time with actionable error messages — only the tools you actually call need their binary):
| Binary | Needed for | Arch package |
|---|---|---|
ffmpeg/ffprobe |
video, audio | ffmpeg |
yt-dlp |
video URLs, downloads | yt-dlp |
pdftotext/pdftoppm/pdfinfo/pdfimages |
poppler |
|
tesseract |
image_ocr, pdf_ocr | tesseract + language data |
Optional: pip install 'openmedia-mcp[whisper]' enables local speech-to-text
(audio_transcribe) via faster-whisper.
Install & run
# From a local checkout
uv run --project /path/to/openmedia-mcp openmedia-mcp
# Or install as a tool
uv tool install git+https://github.com/Builderstar/openmedia-mcp.git
openmedia-mcp --tools pdf,image
opencode
{
"mcp": {
"openmedia": {
"type": "local",
"command": ["uv", "run", "--project", "/home/you/projects/openmedia-mcp", "openmedia-mcp"]
}
}
}
Claude Desktop / generic MCP config
{
"mcpServers": {
"openmedia": {
"command": "uv",
"args": ["run", "--project", "/home/you/projects/openmedia-mcp", "openmedia-mcp"]
}
}
}
HTTP transport
openmedia-mcp --transport streamable-http --host 127.0.0.1 --port 8756
Toolsets
Mount only what a given harness needs with --tools image,pdf,video,audio
(default: all). media_probe is always available.
image
| Tool | Purpose |
|---|---|
image_view |
See an image (auto-downscaled); region param zooms into details |
image_info |
Format, dimensions, EXIF summary — no pixels spent |
image_ocr |
Tesseract text extraction |
image_transform |
crop / resize / rotate / flip / grayscale / format convert |
image_compare |
Two images side-by-side in one composite |
| Tool | Purpose |
|---|---|
pdf_info |
Metadata + detects whether a text layer exists |
pdf_read |
Text-layer extraction (page ranges, layout mode) |
pdf_view |
Render pages as images for the model (scans, figures, layout) |
pdf_ocr |
Tesseract OCR for scanned PDFs |
pdf_extract_images |
Pull embedded figures/photos to disk |
video
| Tool | Purpose |
|---|---|
video_info |
ffprobe for files; yt-dlp metadata for URLs (no download) |
video_frames |
See the video: uniform sampling or exact timestamps |
video_transcript |
Captions via yt-dlp (URLs) or embedded subs (files) |
video_download |
yt-dlp download with resolution control |
video_clip |
Cut sections (stream-copy or re-encode) |
video_extract_audio |
Audio track to mp3/m4a/wav/flac/opus |
audio
| Tool | Purpose |
|---|---|
audio_info |
Codec, duration, tags |
audio_convert |
Format/bitrate/sample-rate/mono conversion |
audio_trim |
Lossless section cut |
audio_waveform |
See the waveform as an image |
audio_transcribe |
Local Whisper STT (optional [whisper] extra) |
Configuration (env vars)
| Variable | Default | Meaning |
|---|---|---|
OPENMEDIA_CACHE_DIR |
~/.cache/openmedia-mcp |
URL/video download cache |
OPENMEDIA_OUTPUT_DIR |
~/Downloads/openmedia |
Default output location |
OPENMEDIA_TEXT_CAP |
20000 |
Default max chars for text outputs |
OPENMEDIA_MAX_IMAGE_DIM |
1024 |
Default longest edge for returned images |
OPENMEDIA_JPEG_QUALITY |
80 |
Default JPEG quality |
OPENMEDIA_MAX_DOWNLOAD_BYTES |
209715200 |
Direct-URL download cap |
Security and privacy
This server acts with the permissions of the user who starts it. Its tools can read local media, fetch URLs, run media-processing binaries, and write to caller-selected output paths. Tool responses may include absolute paths and media metadata. Only connect trusted MCP clients.
The HTTP transports do not provide authentication. They bind to loopback by default; do not expose them to another host or an untrusted network without a separate authenticated proxy and network policy. URL fetching can reach addresses visible from the host, including private-network services.
The optional Whisper tool downloads and caches the base faster-whisper model
on first use. Prepare that model cache in advance for offline operation.
Development
uv sync # install deps
uv run python tests/smoke_test.py [sample-video.mp4] # exercises every tool
The smoke test generates its own test image and PDF; pass any local video file to also cover the video/audio toolsets.
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
mcp-server-qdrant
这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器