AVCLabs Media MCP
About
AVCLabs MCP integrates AI-powered video upscaling, quality enhancement, and SAM3 image segmentation into MCP workflows. It enhances low-resolution videos, cleans noisy footage, and extracts target objects through text prompts.
Details
- Author
- avclabs
- Categories
- Productivity, Other, AI, Media
Jump to
Setup
Install AVCLabs Media MCP in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/avclabs/media-mcp
Follow the installation instructions in the repository README, then restart your MCP client.
A video enhancement, image enhancement/colorization/denoising, and image segmentation service based on the MCP protocol, acting as an MCP Client-Server to interact with backend HTTP Servers.
- create_task- Create a video enhancement task (supports URL or local file upload)
- get_task_status- Query task status
- enhance_video_sync- Synchronously enhance video (blocking wait, truncated at ~50s by default)
- enhance_image_sync- Enhance image quality and optimize faces (supports URL or local file upload)
- colorize_image_sync- Colorize black-and-white photos (supports URL or local file upload)
- denoise_image_sync- Remove noise from images (supports URL or local file upload)
- get_image_task_status- Query image task status (for polling after sync timeout)
- sam3_predict- SAM3 image segmentation (supports local path, URL, or Base64 image)
- get_sam3_task_status- Query SAM3 task status (for polling after sync timeout)
- Node.js >= 18(check:node --version)
- API Key(required for authentication)
If your AI Agent has a known MCP config path, just copy the line below and send it to your AI:
Install the npm package @avclabs.ai/media-mcp as an MCP server. My API Key is: sk-xxxxxxxx.
- Detect your MCP client
- Find the config file path
- Write the correct configuration
- Prompt you to restart the client
No installation needed. Usenpxdirectly in your MCP client config.
Check the output for the"User MCPs"section to find the config file path, then edit that file.
- Windows:%USERPROFILE%\.claude.json
- macOS:~/.claude.json
- Linux:~/.claude.json
- Legacy/Alternative:~/.claude/mcp.json
{ "mcpServers": { "video-enhancement": { "command": "npx", "args": ["-y", "@avclabs.ai/media-mcp@latest"], "env": { "API_KEY": "your-api-key" } } } }
Save and run/mcpto verify it's loaded.
Go toSettings > Tools & MCPs > Add New MCP Server:
- Name:video-enhancement
- Type:command
- Command:
env API_KEY=your-api-key npx -y @avclabs.ai/media-mcp@latest
{ "mcpServers": { "video-enhancement": { "command": "npx", "args": ["-y", "@avclabs.ai/media-mcp@latest"], "env": { "API_KEY": "your-api-key" } } } }
After restarting your client, check if the tools are available:
- Or ask: "What tools do you have available?"
- You should see:create_task,get_task_status,enhance_video_sync,enhance_image_sync,colorize_image_sync,denoise_image_sync,get_image_task_status,sam3_predict,get_sam3_task_status
{ "env": { "HTTP_API_BASE_URL": "https://your-endpoint.com", "API_KEY": "your-api-key", "SAM3_API_BASE_URL": "https://your-sam3-endpoint.com" } }
npx -y @avclabs.ai/media-mcp@latest --base-url https://your-endpoint.com --api-key your-api-key --sam3-base-url https://your-sam3-endpoint.com
This project provides bothsynchronousandasynchronousmodes.
Because MCP Agents typically enforce a ~60-second timeout per tool call, tasks with longer processing times (video enhancement) are strongly recommended to useasynchronous mode:
- Callcreate_taskto create a task → immediately gettask_id
- Wait a few seconds, then callget_task_statusto query the status
- Ifstatusisprocessing, continue waiting and repeat step 2
- Ifstatusiscompleted, the task is done and the result containsvideo_url
- Ifstatusisfailed, the task failed and the result containserror_message
- Callenhance_video_sync→ the server polls internally
- Defaults to a maximum wait of 50 seconds
- If completed within 50 seconds, returns the result directly
- If not completed within 50 seconds, returnstask_idand instructions for the Agent to switch toget_task_status
- Callsam3_predict→ the server polls internally
- Defaults to a maximum wait of 50 seconds (25 attempts × 2-second polling interval)
- If completed within 50 seconds, returns the segmentation result directly
- If not completed within 50 seconds, returns a truncation notice indicating the task is still processing
Once configured, ask your AI agent naturally:
"Enhance this video to 1080p:https://example.com/video.mp4"
"Improve the quality of /Users/me/Desktop/video.mp4 to 2k"
"Enhance this image:https://example.com/photo.jpg"
"Colorize this black-and-white photo: /Users/me/Desktop/old_photo.png"
"Remove noise from this image: C:\Users\xxx\noisy.jpg"
"Analyze this image and find all objects: C:\Users\xxx\photo.png"
"Use SAM3 to segment this image, prompt: 'find all cars'"
The agent will automatically choose sync or async tools based on task complexity.
Create an asynchronous video enhancement task.
Recommended for most use cases.Ideal for longer videos (over 10 seconds) to avoid timeouts and blocking the connection.
{ "success": true, "task_id": "xxx", "status": "processing" }
The returnedstatusfield can be:processing,completed, orfailed. Ifstatusisprocessing, you need to wait a few seconds and call this tool again.
{ "success": true, "task_id": "xxx", "status": "completed", "progress": 100, "video_url": "https://...", "message": "Task is still processing, please check again later" }
Themessagefield only appears whenstatusisprocessing, prompting the Agent to continue waiting.
Synchronously enhance video (blocks until completion).
Best for short videos (estimated processing time < 1 minute).If the task is not completed within 50 seconds, the tool returns early with atask_id, and you need to useget_task_statusto continue querying.
Truncated return example (not completed within 50s):
{ "success": true, "status": "processing", "task_id": "xxx", "message": "Task is still processing (waited 50 seconds). Please use get_task_status to continue polling.", "note": "The synchronous wait for this long-running task has been truncated. Switch to get_task_status polling." }
Three image processing tools are provided, each targeting a specific use case:
All three tools share the same parameters and behavior pattern. They aresynchronous— the tool blocks until the image is processed or the timeout is reached.
Supported image formats: PNG, JPG, JPEG, BMP, WebP, etc.
- URL upload: provide a publicly accessible image URL (type: "url")
- Local upload: provide a local file path, the MCP Server auto-uploads to TOS object storage (type: "local", max file size: 100MB)
Synchronously enhance an image to improve quality and optimize faces.
The tool internally creates a task and polls for the result. If processing completes within the timeout (default 50s), the result is returned directly. If not, the tool returns early with atask_id— useget_image_task_statusto continue polling.
{ "success": true, "task_id": "xxx", "status": "completed", "progress": 100, "image_url": "https://..." }
Truncated return (not completed within 50s):
{ "success": true, "status": "processing", "task_id": "xxx", "message": "Task is still processing (waited 50 seconds). Please use get_image_task_status to continue polling.", "note": "The synchronous wait for this long-running task has been truncated. Switch to get_image_task_status polling." }
Synchronously colorize a black-and-white photo with AI.
Best for old black-and-white photos. The AI will add realistic colors to the image. Supports the same parameters and return format asenhance_image_sync.
Returns:Same format asenhance_image_sync.
Synchronously remove noise from an image.
Best for grainy/noisy photos taken in low-light conditions or with high ISO settings. Supports the same parameters and return format asenhance_image_sync.
Returns:Same format asenhance_image_sync.
Query image processing task status. Used to poll for results when a sync tool times out.
The returnedstatusfield can be:processing,completed, orfailed. Ifstatusisprocessing, wait a few seconds and call this tool again.
{ "success": true, "task_id": "xxx", "status": "completed", "progress": 100, "image_url": "https://...", "message": "Task is still processing, please check again later" }
Themessagefield only appears whenstatusisprocessing, prompting the Agent to continue waiting.
- For most images: Callenhance_image_sync/colorize_image_sync/denoise_image_syncdirectly — the tool handles everything and returns the result
- If truncated: The tool returns atask_id, then useget_image_task_statusto poll untilstatusbecomescompletedorfailed
- If failed: Check theerror_messagefield for details
Analyze an image using the SAM3 segmentation API to generate inference results (masks, boxes, scores).
Image input (choose one, must provide exactly one):
-
imagePath(string): Absolute path of a local image file. Supports common formats (PNG, JPG, JPEG).
- Example:"C:\\Users\\xxx\\photo.png","/home/user/images/cat.jpg"
- Use when: The user explicitly provides a local file path
imageUrl(string): Publicly accessible URL of the image.
- Example:"https://example.com/photo.jpg"
- Use when: The image is already online and the user provides a link
- Note: The URL must be publicly accessible. Links requiring login or signatures are not supported
imageBase64(string): Base64-encoded image data.
- Example:"iVBORw0KGgoAAAANSUhEUgAA..."
- Use when: The user drags or uploads an image attachment, and the Agent encodes it as base64
- Note: Large images will produce very large base64 strings, which may slow transmission
- prompt(string, required): English text prompt specifying the target object to segment. Since the SAM3 model only accepts English prompts, provide an English description. If the user provides Chinese or other non-English text, the Agent will automatically translate it before calling the tool.
After inference completes, returns a JSON string containing three fields:
-
masks: 2D array. Each element is a binary mask (values 0 or 1) with the same dimensions as the input image, marking the pixel-level location of detected objects. The i-th mask corresponds to the i-th detected object instance.
boxes: 2D array. Each element is a bounding box in[x1, y1, x2, y2]format, representing the rectangular region of the detected object.x1,y1are the top-left coordinates;x2,y2are the bottom-right coordinates.
Coordinate system: The top-left corner of the image is the origin(0, 0). The x-axis increases to the right, and the y-axis increases downward, in pixels. For example,[120, 80, 300, 450]means the region starts 120px from the left edge and 80px from the top edge, extending to 300px from the left and 450px from the top. Width =x2 - x1 = 180px, Height =y2 - y1 = 370px.
scores: 1D array. Each element is a confidence score for the corresponding detection result, ranging from 0 to 1. Higher scores indicate greater model confidence.
{ "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] }
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





