mcp-media-toolbox
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-media-toolbox pull the AAC audio track out of /sdcard/Movies/clip.mp4"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-media-toolbox
一个零依赖的 MCP 服务器:媒体元数据探测 / AAC 音轨直抽 / EXIF 读取。不需要 ffmpeg,不需要 Python。
A zero-dependency MCP server for media probing, AAC extraction and EXIF — no ffmpeg, no Python. Runs where you cannot install binaries: Android app sandboxes, Termux, minimal containers.
整个 server 只 import 4 个 Node 内置模块(fs / os / crypto / readline),
npm install 什么都不装,node server.mjs 直接跑。
为什么会有这个
主流媒体工具都依赖 ffmpeg/ffprobe。但在受限环境里(Android 应用私有目录禁止执行二进制、
无 root、无 Python、容器里不想装 100 MB 依赖),这条路直接断掉。
这个项目把最常用的三件事用纯 JS 重写:
能力 | 怎么做的 |
MP4/MOV 元数据 | 手工解析 ISO-BMFF: |
AAC 音轨 → | 按 |
EXIF | 解析 JPEG APP1 的 TIFF/IFD(IFD0 / ExifIFD / GPS IFD,支持 II/MM 字节序) |
Related MCP server: image-analysis-mcp
快速开始
git clone https://github.com/Verchiel666/mcp-media-toolbox.git && cd mcp-media-toolbox
npm run fixtures # 生成合成测试素材(仓库里没有第三方二进制)
npm run selftest # 21 项断言,退出码 0 = 全过
node client.mjs --demo接进任何 MCP 客户端(Claude Desktop / Cursor / 自研):
{
"mcpServers": {
"media-toolbox": {
"command": "node",
"args": ["/absolute/path/to/server.mjs"]
}
}
}已发布到 npm,可以直接用 npx(无需 clone):
{
"mcpServers": {
"media-toolbox": {
"command": "npx",
"args": ["-y", "mcp-media-toolbox"]
}
}
}npx -y mcp-media-toolbox # 直接作为 stdio server 启动工具
工具 | 说明 |
| 容器/时长/总码率;每轨编码、分辨率、帧率、码率、声道、采样率、AAC 参数;图片给尺寸;其他文件给魔数嗅探 |
| mp4/m4a 的 AAC 轨直抽为 ADTS |
| 目录批量体检 + 按类型汇总占用 |
| Top 子目录 / 类型分布 / 最大文件 |
| 大小预筛 + sha256 确认的重复文件组 |
| 拍摄时间、机型、GPS、光圈快门 ISO 焦距;并对比文件 mtime 提示「该信哪一个」 |
| 架构 / 内存 / 磁盘 / Node 版本 |
全部只读,或只新增输出文件,不修改、不删除源文件。
实测数据
在 Android 15(arm64,Node v24.22.1,无 ffmpeg)上:
项目 | 结果 |
4.17 MiB mp4(854×480 avc1 24fps + mp4a AAC-LC 48k 2ch) |
|
同一文件的 AAC 直抽 | 2435 帧 / 839716 字节,42.6 ms |
产物校验 | 逐帧遍历 ADTS:覆盖率 100%、0 异常、推算时长 51.95 s 与源轨道 51.947 s 一致 |
5712×4284 手机照片 | 3.7 ms |
selftest.mjs 用合成素材跑同样的断言,所以 CI 不需要任何外部文件。
已知限制(诚实清单)
只解析带
moov的 ISO-BMFF;碎片化 mp4 / fMP4 / MKV / 裸流一律明确报错,不假装成功。只直抽 AAC(
mp4a);Opus / AC-3 / ALAC 不支持。不做重采样、不转 WAV。HE-AAC(SBR/PS)会被当成 AAC-LC 写 ADTS 头:能播,但采样率标注可能偏低。
EXIF 仅 JPEG;PNG/HEIC 未实现。
find_duplicates对超大目录只做有界扫描(默认 3000 文件),返回里有truncated标记。
三个必踩的坑(experiments/ 可复现)
写 MCP server 时最容易在这三处翻车,详见 docs/mcp-notes.md:
工具里一句
console.log污染 stdout → 客户端 JSON 解析当场崩。美化输出(
JSON.stringify(x, null, 2))把一个消息拆成多行,同样违规,而且症状只是「没反应」。握手顺序错(缺
notifications/initialized)→ 客户端无限转圈。
node client.mjs --list --server experiments/server-pretty.mjs # 看它怎么炸在 DSH(Android)里挂本地 server
DSH 引擎自带 @deepseek-ai/dsh-mcp-client,但 App 的设置页只接受远程 HTTP / npm 包,
拒绝本地 node script.mjs 这种写法。可行方式与踩坑记录见 docs/dsh-android.md。
在 npm 上
mcp-media-toolbox —— 只发布 server.mjs 与文档,测试素材不进包(21.6 KiB)。
相关
同源的姊妹项目:DSH(本项目的 MCP 桥接就是在它上面验证的)。
License
MIT
Available Tools
7 toolsextract_audio_track抽取视频音轨(ADTS AAC)A
把 mp4/m4a 里的 AAC 音轨按样本表(stsz/stco/stsc)直抽出来,手工构造 ADTS 头写成 .aac 裸流,可直接播放或喂给语音识别。本机无 ffmpeg,故不做重采样/转 WAV。
Inputs: input_path (required), output_path.
find_duplicates重复文件查找A
找出目录里的重复文件:先按文件大小分组,只对同尺寸的候选算 sha256 确认,返回重复组、可回收空间。适合清理相册里重复保存的图片。只读,不删除。
Inputs: dir_path (required), max_files, min_bytes.
get_system_hardware宿主机硬件/运行时快照A
获取宿主机 CPU 架构、操作系统、内存、磁盘、Node 运行时版本与 MCP 服务信息,供 Agent 决策本地算力分配。
Inputs: no named parameters.
get_video_info视频/媒体元数据探测A
获取本地媒体文件的容器、时长、视频流(编码/分辨率/帧率/码率)与音频流(编码/声道/采样率/AAC 参数);对图片返回 JPEG/PNG/GIF 尺寸,其他文件返回魔数嗅探。纯 JS 解析,不需要 ffprobe。参数为本地绝对路径。
Inputs: file_path (required).
probe_dir目录媒体体检A
批量体检一个目录:逐个文件的类型(魔数嗅探)、大小、修改时间,视频给出时长/分辨率/编码,图片给出尺寸,并按图片/视频/音频/文档/压缩包汇总占用。比逐个调 get_video_info 省往返。
Inputs: dir_path (required), sort, limit, recursive.
read_exif照片 EXIF(拍摄时间/GPS/机型)A
读取 JPEG 的 EXIF:拍摄时间(DateTimeOriginal)、机型、GPS 经纬度、光圈/快门/ISO/焦距、像素尺寸,并对比文件修改时间提示「文件时间是否可信」。传目录则批量汇总(有 EXIF 几张、时间跨度、机型分布)。用于按真实拍摄时间整理相册。
Inputs: file_path (required), limit.
storage_report空间占用分析A
分析一个目录的空间都去哪了:Top 子目录、按文件类型(图片/视频/音频/文档/压缩包)的占用分布、最大的几个文件。用于「手机空间不够了帮我看看」。
Inputs: path (required), top, max_entries.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Most tools target clearly distinct operations: single-file inspection, bulk directory inspection, space analysis, duplicate finding, EXIF reading, audio extraction, and system info. The two potential overlaps (get_video_info vs probe_dir on per-file detail, probe_dir vs storage_report on type aggregation) are explicitly disambiguated by the descriptions ('比逐个调 get_video_info 省往返', '分析空间去哪了' vs per-file listing).
All names are snake_case and six of seven follow a verb_noun pattern (get_video_info, extract_audio_track, get_system_hardware, probe_dir, find_duplicates, read_exif). storage_report is the one noun-phrase outlier, a minor deviation but still readable and in-family.
Seven tools is well within the 3-15 sweet spot and each covers a distinct analysis task. No obvious filler; get_system_hardware is slightly tangential to media but justified as local-compute context for an agent.
The surface is solid for read-only inspection/analysis (info, directory probing, storage, duplicates, EXIF, audio extraction). However it is entirely read-only: there is no tool to actually reorganize/move/rename/delete files, even though read_exif is pitched as '整理相册' and duplicates are found but not removable—leaving agents at a dead end after analysis.
Maintenance
Related MCP Connectors
YouTube and video analysis, C2PA marking for AI images, lossless EXIF/GPS removal. Pay per call.
ffprobe metadata, frames, scene cuts, contact sheet and loudness from direct video or audio links.
Read EXIF, GPS, XMP, C2PA and AI-generator metadata from a public image or video URL. Read-only.
Open-source developer, PDF, image, SEO and security tools over a stateless HTTP MCP server. No key.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn offline MCP server that allows LLMs or humans to extract and analyze metadata from images using the exifr library, supporting various image formats and metadata segments without external tools.1140BSD 2-Clause "Simplified"
- FlicenseAqualityDmaintenanceMCP server for image analysis, providing OCR text extraction, image metadata, and EXIF/GPS data as structured JSON for downstream processing.3-
- FlicenseAqualityDmaintenanceFastMCP server for image analysis providing OCR, metadata, and EXIF extraction.3-
- AlicenseBqualityDmaintenanceAn MCP server that lets LLMs read and edit image metadata (EXIF, GPS, XMP, ICC, IPTC, and more) entirely offline. Supports files, URLs, base64, and includes a browser-based UI for analysis, GPS extraction, and metadata stripping.13BSD 2-Clause "Simplified"