media-mcp
Officialmedia-mcp (Node.js)
中文 | English
Сервис для улучшения видео и сегментации изображений на основе протокола MCP, взаимодействующий с бэкенд-сервером HTTP в качестве MCP Client-Server.
Функции
Предоставляет следующие инструменты MCP:
create_task— создание задачи по улучшению видео (поддерживает URL или загрузку локальных файлов)get_task_status— запрос статуса задачиenhance_video_sync— синхронное улучшение видео (блокирующее ожидание завершения)sam3_predict— сегментация изображений SAM3 (поддерживает локальные пути, URL или изображения в формате Base64)
Related MCP server: Grok Imagine Video MCP Server
Предварительные требования
Node.js >= 18 (проверка:
node --version)API Key (для аутентификации, обратитесь к поставщику услуг для получения)
Установка для ленивых (рекомендуется)
Если у вашего AI-агента есть определенный путь конфигурации MCP, просто скопируйте следующую строку и отправьте её ИИ:
帮我安装 npm 包 @avclabs.ai/media-mcp 作为 MCP server。我的 API Key 是:sk-xxxxxxxx。ИИ автоматически выполнит:
Обнаружение используемого вами MCP-клиента
Поиск пути к файлу конфигурации
Запись правильной конфигурации
Предложение перезапустить клиент
Ручная установка
Установка не требуется, используйте npx непосредственно в конфигурации MCP-клиента.
1. Claude Code (CLI)
Запустите в Claude Code:
/mcpНайдите путь к файлу конфигурации, соответствующий "User MCPs" в выводе, и отредактируйте этот файл.
Типичные пути (если /mcp недоступен):
Windows:
%USERPROFILE%\.claude.jsonmacOS:
~/.claude.jsonLinux:
~/.claude.jsonСтарая версия/резерв:
~/.claude/mcp.json
Вставьте следующее содержимое (замените your-api-key на ваш реальный API Key):
{
"mcpServers": {
"video-enhancement": {
"command": "npx",
"args": ["-y", "@avclabs.ai/media-mcp@latest"],
"env": {
"API_KEY": "your-api-key"
}
}
}
}После сохранения выполните /mcp для проверки успешности загрузки.
2. Cursor
Перейдите в Settings > Tools & MCPs > Add New MCP Server:
Name:
video-enhancementType:
commandCommand:
env HTTP_API_KEY=your-api-key npx -y @avclabs.ai/media-mcp@latest
Или отредактируйте ~/.cursor/mcp.json:
{
"mcpServers": {
"video-enhancement": {
"command": "npx",
"args": ["-y", "@avclabs.ai/media-mcp@latest"],
"env": {
"API_KEY": "your-api-key"
}
}
}
}Проверка установки
После перезапуска клиента убедитесь, что инструменты загружены успешно:
Либо просто спросите ИИ: "Какие инструменты у тебя есть?"
Вы должны увидеть:
create_task,get_task_status,enhance_video_sync,sam3_predict
Параметры конфигурации
Имя переменной | Обязательно | Значение по умолчанию | Описание |
| Да | - | Ключ аутентификации API (общий для улучшения видео и SAM3) |
| Нет |
| Адрес интерфейса сервиса улучшения видео |
| Нет |
| Адрес интерфейса сервиса SAM3 |
| Нет |
| Интервал опроса (мс) |
| Нет |
| Максимальное количество попыток опроса |
Пользовательский адрес сервиса
{
"env": {
"HTTP_API_BASE_URL": "https://your-endpoint.com",
"API_KEY": "your-api-key",
"SAM3_API_BASE_URL": "http://localhost:8001"
}
}Или через аргументы командной строки:
npx -y @avclabs.ai/media-mcp@latest --base-url https://your-endpoint.com --api-key your-api-key --sam3-base-url http://localhost:8001Примеры использования
После настройки скажите ИИ на естественном языке:
"Помоги мне улучшить это видео до 1080p: https://example.com/video.mp4"
"Улучши качество видео video.mp4 с моего рабочего стола до 2k"
ИИ автоматически вызовет соответствующий инструмент для выполнения задачи.
"Помоги мне проанализировать это изображение и найти все объекты на нем: C:\Users\xxx\photo.png"
"Используй SAM3 для сегментации этого изображения, промпт: 'find all cars'"
Предоставляемые инструменты
create_task
Создание задачи по улучшению видео (асинхронно).
Параметр | Тип | Обязательно | Значение по умолчанию | Описание |
| string | Да | - | URL видео или путь к локальному файлу (URL должен быть доступен из публичной сети, ссылки, требующие входа или подписи, не поддерживаются) |
| string | Нет |
|
|
| string | Нет |
|
|
Возвращаемое значение:
{
"success": true,
"task_id": "xxx",
"status": "wait"
}get_task_status
Запрос статуса задачи.
Параметр | Тип | Обязательно |
| string | Да |
Возвращаемое значение:
{
"success": true,
"task_id": "xxx",
"status": "completed",
"progress": 100,
"video_url": "https://..."
}enhance_video_sync
Синхронное улучшение видео (блокирующее ожидание завершения).
Параметр | Тип | Обязательно | Значение по умолчанию | Описание |
| string | Да | - | URL видео или путь к локальному файлу |
| string | Нет |
|
|
| string | Нет |
| Целевое разрешение |
| number | Нет |
| Интервал опроса (секунды) |
| number | Нет |
| Время ожидания (секунды) |
sam3_predict
Использование API сегментации SAM3 для анализа изображения и генерации результатов вывода (маски, рамки, оценки).
Параметры:
Ввод изображения (один из трех, обязательно предоставление одного из них):
imagePath(string): Абсолютный путь к локальному изображению. Поддерживаются распространенные форматы (например, PNG, JPG, JPEG).imageUrl(string): Публично доступный URL изображения.imageBase64(string): Данные изображения в кодировке Base64.
Другие параметры:
prompt(string, required): Текстовая подсказка на английском языке для указания целевых объектов для сегментации. Например, "person", "car", "a cat sitting on a sofa". Поскольку модель SAM3 принимает только английские промпты, рекомендуется передавать описание на английском.
Возврат:
После завершения вывода возвращается JSON-строка, содержащая поля masks, boxes и scores.
Пример содержимого JSON результата:
{
"masks": [
[[0, 0, 1, ...], [0, 1, 1, ...], ...],
[[0, 0, 0, ...], [0, 0, 1, ...], ...]
],
"boxes": [
[120, 80, 300, 450],
[400, 200, 600, 500]
],
"scores": [0.95, 0.87]
}Часто задаваемые вопросы
Ошибка "файл не найден" после перетаскивания вложения?
Это известное ограничение stdio MCP. При перетаскивании или загрузке вложений через интерфейс агента путь к файлу обычно не передается автоматически в MCP Server.
Решение:
Укажите путь вручную (рекомендуется): после перетаскивания изображения добавьте в тексте абсолютный путь к локальному файлу.
Дождитесь автоматического кодирования: Claude может автоматически закодировать изображение в base64.
Ответьте на запрос пути: если Claude спрашивает путь, просто укажите абсолютный путь.
Есть ли приоритет у трех способов ввода?
Строгого приоритета нет. Claude автоматически выбирает наиболее подходящий способ в зависимости от контекста диалога.
Какие форматы изображений поддерживаются?
Поддерживаются распространенные форматы: PNG, JPG, JPEG, BMP, WebP и т.д.
Что делать, если загрузка изображения по URL не удалась?
Убедитесь, что URL является публично доступным и не требует входа, Cookie или подписи.
Что делать, если Base64 изображение слишком большое?
Если изображение очень большое (например, 4K), данные в кодировке base64 будут очень тяжелыми. Рекомендуется использовать imagePath.
Инструкции по загрузке файлов
Когда type равен "local", MCP Server:
Считывает локальный файл
Загружает его напрямую в объектное хранилище TOS через предварительно подписанный URL
Максимальный размер файла: 100 МБ
Устранение неполадок
"command not found: npx"
Установите Node.js >= 18: https://nodejs.org/
"Ошибка: необходимо предоставить --api-key или установить API_KEY"
Отсутствует API Key, проверьте env.API_KEY в конфигурации.
MCP Server отображается красным/ошибкой в клиенте
Проверьте логи:
Claude Desktop macOS:
~/Library/Logs/Claude/mcp*.logClaude Desktop Windows:
%APPDATA%\Claude\logs\mcp*.logCursor: Панель Output > MCP
"Ошибка загрузки TOS"
Обычно это несоответствие подписи, убедитесь, что HTTP_API_BASE_URL и HTTP_API_KEY верны.
Глобальная установка (опционально)
Если вы не хотите использовать npx каждый раз:
npm install -g @avclabs.ai/media-mcpЗатем используйте "command": "media-mcp" с "args": ["--api-key", "your-api-key"] в конфигурации.
Лицензия
MIT License - подробнее см. файл LICENSE
Available Tools
4 toolscreate_taskB
创建视频增强任务(异步)
支持两种上传方式:
URL 上传:提供视频 URL
本地上传:提供本地文件路径,MCP Server 自动上传到 TOS 对象存储
参数说明:
video_source: 视频 URL 或本地文件路径
type: "url" 或 "local"
resolution: 目标分辨率
| Name | Required | Description | Default |
|---|---|---|---|
| video_source | Yes | 视频URL地址或本地文件路径(URL必须公网可访问,不支持需要登录或签名的链接) | |
| type | No | 上传类型:url=网络视频,local=本地文件 | url |
| resolution | No | 目标分辨率,默认720p | 720p |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so the description must carry full burden. It notes async behavior and TOS upload but omits side effects, permissions, failure modes, or rate limits. The description only partially discloses behavioral traits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise with three bullet points and front-loaded purpose. Every sentence earns its place, but structure could be slightly improved with clearer differentiation from siblings.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers input parameters well but lacks output schema explanation (e.g., task ID or status). With no annotations and multiple siblings, more context on post-creation steps would improve completeness.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Input schema has 100% description coverage, so baseline is 3. The description groups parameters and explains the two upload modes, but does not add new information beyond the schema's existing parameter descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool creates an async video enhancement task and distinguishes between two upload methods (URL and local). It uses specific verbs and resources, and is not a tautology.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explains when to use each upload type (URL vs local) but does not explicitly guide when to use this async tool over its sync sibling (enhance_video_sync) or other tools like get_task_status.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
enhance_video_syncA
同步增强视频(阻塞等待完成)
支持两种上传方式:
URL 上传:提供视频 URL
本地上传:提供本地文件路径,MCP Server 自动上传到 TOS 对象存储
参数说明:
video_source: 视频 URL 或本地文件路径
type: "url" 或 "local"
resolution: 目标分辨率
poll_interval: 轮询间隔(秒)
timeout: 超时时间(秒)
| Name | Required | Description | Default |
|---|---|---|---|
| video_source | Yes | 视频URL地址或本地文件路径(URL必须公网可访问,不支持需要登录或签名的链接) | |
| type | No | 上传类型:url=网络视频,local=本地文件 | url |
| resolution | No | 目标分辨率,默认720p | 720p |
| poll_interval | No | 轮询间隔(秒),默认5 | |
| timeout | No | 超时时间(秒),默认600 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description bears full responsibility for behavioral disclosure. It explicitly states 'blocking wait for completion', explains the automatic upload of local files to TOS storage, and mentions polling parameters, giving good transparency. It does not mention side effects, but given the nature, none are expected.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with bullet points and clear categorization of upload methods and parameters. Every sentence serves a purpose, and there is no redundancy or unnecessary detail.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers the blocking nature, upload methods, and all parameters thoroughly. It lacks an explicit description of the return value, but given the synchronous nature, it likely returns the enhanced video. Overall, it is fairly complete for a tool without an output schema.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline is 3. The description adds context beyond the schema, such as the automatic upload process for local files and that URLs must be publicly accessible. This extra information enhances understanding of parameter usage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: to enhance video synchronously, with a blocking wait. It details two upload methods (URL and local), distinguishing it from sibling tools that handle different operations like task creation or status checking.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explains the two upload methods and the blocking nature, implicitly indicating when to use the tool. However, it does not explicitly contrast with siblings like create_task (likely async) or provide when-not-to-use guidance, making usage guidelines less explicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_task_statusA
查询视频增强任务状态
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | 任务ID |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, and the description only states the purpose without disclosing any behavioral traits such as polling requirements, rate limits, or expected response behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence with no wasted words; efficient and to the point.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple status query with one parameter, the description is mostly complete but could benefit from mentioning possible return statuses or output format since no output schema is provided.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, and the description adds no additional meaning beyond what is already in the input schema, so baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'query' and the resource 'video enhancement task status', distinguishing from sibling tools 'create_task' and 'enhance_video_sync' which have different actions.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance on when to use this tool versus alternatives, but the context of sibling tools implies it is for checking status after creation or enhancement.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
sam3_predictA
Analyze an image using the SAM3 segmentation API to generate inference results (masks, boxes, scores). The image can be provided in one of three ways:
imagePath: Absolute path of a local image file (e.g. C:\Users\xxx\photo.png). Use this when the user provides a local file path.
imageUrl: Publicly accessible URL of the image (e.g. https://example.com/photo.jpg). Use this when the user provides a web link.
imageBase64: Base64-encoded image data. Use this when the user uploads or drags-and-drops an image as an attachment and no local path is available. In this case, encode the image content as base64 and pass it via this parameter. If the user mentions an uploaded image but does not provide a path, URL, or base64 data, ask the user for the local absolute path. Prompt must be in English. If the user provides Chinese or other non-English text, translate it to English before calling this tool.
| Name | Required | Description | Default |
|---|---|---|---|
| imagePath | No | Absolute path of a local image file (e.g. C:\\Users\\xxx\\photo.png) | |
| imageUrl | No | Publicly accessible URL of the image to process | |
| imageBase64 | No | Base64-encoded image data. Use this when the image is provided as an attachment without a local path | |
| prompt | Yes | Text prompt for mask generation. Must be in English. If the user provides Chinese or other non-English text, translate it to English before calling this tool |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden. It discloses that it calls an external API and generates masks, boxes, scores. However, it lacks details on potential side effects, authentication, error handling, or rate limits. It does not contradict annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with bullet points, front-loading the main purpose. Every sentence serves a purpose, explaining input methods and prompt requirements without redundancy. It is concise yet comprehensive.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers what the tool does (segmentation analysis), how to provide input (three methods), and what outputs are generated (masks, boxes, scores). Even without an output schema, it gives sufficient information for an agent to use the tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Although schema coverage is 100%, the description adds significant value by explaining usage contexts for each image parameter and specifying that the prompt must be in English, requiring translation if needed. This goes beyond schema descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function: 'Analyze an image using the SAM3 segmentation API to generate inference results (masks, boxes, scores).' This specifies the verb (analyze), resource (image via SAM3 API), and output, effectively distinguishing it from siblings like create_task.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit guidance on when to use each image input method (imagePath, imageUrl, imageBase64) and includes instructions for handling non-English prompts. However, it does not explicitly mention when not to use this tool or compare it to alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
4 tool updates
v0.1.0- First observed
create_task - First observed
enhance_video_sync - First observed
get_task_status - First observed
sam3_predict
TDQS
Scored across 4 tools
The first three tools are about video enhancement tasks with overlapping functionality (create_task and enhance_video_sync both appear to initiate enhancement), and the fourth tool (sam3_predict) is for image segmentation, a completely different domain. The descriptions are not clear enough to distinguish which tool to use for a given task, causing confusion.
Tool names partially follow a verb_noun pattern (create_task, get_task_status), but 'enhance_video_sync' is awkward and 'sam3_predict' mixes model name with verb, introducing inconsistency.
With 4 tools, the count is reasonable for a focused server, but the server actually combines two unrelated capabilities (video enhancement and image segmentation), making the scope unclear but the number itself is not extreme.
For video enhancement, there are create, sync enhance, and status query, but missing cancel, list, or delete operations. For image segmentation, only a single predict tool exists. The surface is incomplete for both domains.
Maintenance
Related MCP Connectors
MCP server for Wan AI video generation
MCP server for Google Veo AI video generation
MCP server for MiniMax H3 multimodal video generation
MCP server for Luma Dream Machine AI video generation
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceMCP server for 4K video generation using Google VEO 3.1 — text-to-video, image-to-video, video extension, and frame interpolation.1MIT
- AlicenseAqualityBmaintenanceMCP server for generating, editing, and batch processing videos using xAI's Grok Imagine Video API, with support for text-to-video, image-to-video, and video editing via natural language prompts.438 npm1MIT
- AlicenseAqualityDmaintenanceMCP server for AI-powered media generation: images, videos, audio, and upscaling using 99 AI models.6MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server enabling video processing via natural language: transcription with Whisper, segment cutting with FFmpeg, and file management.MIT