@avclabs.ai/media-mcp 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,65 +1,65 @@
1
1
  # media-mcp (Node.js)
2
2
 
3
- 中文 | [English](https://github.com/avclabs/media-mcp/blob/main/README_EN.md)
3
+ English | [中文](https://github.com/avclabs/media-mcp/blob/main/README_CN.md)
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/@avclabs.ai/media-mcp)](https://www.npmjs.com/package/@avclabs.ai/media-mcp)
6
6
  [![Node.js >=18](https://img.shields.io/badge/node-%3E%3D18-brightgreen.svg)](https://nodejs.org/)
7
7
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
8
8
 
9
- 基于 MCP 协议的视频增强与图像分割服务,作为 MCP Client-Server 与后端 HTTP Server 交互。
9
+ A video enhancement and image segmentation service based on the MCP protocol, acting as an MCP Client-Server to interact with backend HTTP Servers.
10
10
 
11
- ## 功能
11
+ ## Features
12
12
 
13
- 提供以下 MCP Tools:
13
+ Provides the following MCP Tools:
14
14
 
15
- **视频增强**
16
- - `create_task` - 创建视频增强任务(支持 URL 或本地文件上传)
17
- - `get_task_status` - 查询任务状态
18
- - `enhance_video_sync` - 同步增强视频(阻塞等待,默认50秒截断)
15
+ **Video Enhancement**
16
+ - `create_task` - Create a video enhancement task (supports URL or local file upload)
17
+ - `get_task_status` - Query task status
18
+ - `enhance_video_sync` - Synchronously enhance video (blocking wait, truncated at ~50s by default)
19
19
 
20
- **图像分割 (SAM3)**
21
- - `sam3_predict` - SAM3 图像分割(支持本地路径、URL 或 Base64 图片)
20
+ **Image Segmentation (SAM3)**
21
+ - `sam3_predict` - SAM3 image segmentation (supports local path, URL, or Base64 image)
22
22
 
23
- ## 前置要求
23
+ ## Prerequisites
24
24
 
25
- - **Node.js >= 18** (检查:`node --version`)
26
- - **API Key** (用于身份认证,请联系服务提供方获取)
25
+ - **Node.js >= 18** (check: `node --version`)
26
+ - **API Key** (required for authentication)
27
27
 
28
- ## 懒人安装(推荐)
28
+ ## Lazy Install (Recommended)
29
29
 
30
- 如果你使用的 AI Agent 有确定的 MCP 配置路径,直接复制下面这句发给 AI:
30
+ If your AI Agent has a known MCP config path, just copy the line below and send it to your AI:
31
31
 
32
32
  ```
33
- 帮我安装 npm 包 @avclabs.ai/media-mcp 作为 MCP server。我的 API Key 是:sk-xxxxxxxx。
33
+ Install the npm package @avclabs.ai/media-mcp as an MCP server. My API Key is: sk-xxxxxxxx.
34
34
  ```
35
35
 
36
- AI 会自动完成:
37
- 1. 检测你使用的 MCP 客户端
38
- 2. 找到配置文件路径
39
- 3. 写入正确的配置
40
- 4. 提示你重启客户端
36
+ The AI will automatically:
37
+ 1. Detect your MCP client
38
+ 2. Find the config file path
39
+ 3. Write the correct configuration
40
+ 4. Prompt you to restart the client
41
41
 
42
- ## 手动安装
42
+ ## Manual Install
43
43
 
44
- 无需安装,直接在 MCP 客户端配置中使用 `npx` 运行。
44
+ No installation needed. Use `npx` directly in your MCP client config.
45
45
 
46
- ### 1. Claude Code(CLI)
46
+ ### 1. Claude Code (CLI)
47
47
 
48
- 在 Claude Code 中运行:
48
+ Run in Claude Code:
49
49
 
50
50
  ```
51
51
  /mcp
52
52
  ```
53
53
 
54
- 查看输出中 **"User MCPs"** 对应的配置文件路径,然后编辑该文件。
54
+ Check the output for the **"User MCPs"** section to find the config file path, then edit that file.
55
55
 
56
- 常见路径(如果 `/mcp` 不可用):
56
+ Common paths (if `/mcp` is unavailable):
57
57
  - **Windows**: `%USERPROFILE%\.claude.json`
58
58
  - **macOS**: `~/.claude.json`
59
59
  - **Linux**: `~/.claude.json`
60
- - **旧版/备用**: `~/.claude/mcp.json`
60
+ - **Legacy/Alternative**: `~/.claude/mcp.json`
61
61
 
62
- 粘贴以下内容(将 `your-api-key` 替换为实际 API Key):
62
+ Paste this (replace `your-api-key`):
63
63
 
64
64
  ```json
65
65
  {
@@ -75,20 +75,20 @@ AI 会自动完成:
75
75
  }
76
76
  ```
77
77
 
78
- 保存后运行 `/mcp` 验证是否加载成功。
78
+ Save and run `/mcp` to verify it's loaded.
79
79
 
80
80
  ### 2. Cursor
81
81
 
82
- 进入 **设置 > Tools & MCPs > Add New MCP Server**:
82
+ Go to **Settings > Tools & MCPs > Add New MCP Server**:
83
83
 
84
- - **Name**:`video-enhancement`
85
- - **Type**:`command`
86
- - **Command**:
84
+ - **Name**: `video-enhancement`
85
+ - **Type**: `command`
86
+ - **Command**:
87
87
  ```bash
88
88
  env API_KEY=your-api-key npx -y @avclabs.ai/media-mcp@latest
89
89
  ```
90
90
 
91
- 或编辑 `~/.cursor/mcp.json`:
91
+ Or edit `~/.cursor/mcp.json`:
92
92
 
93
93
  ```json
94
94
  {
@@ -104,24 +104,24 @@ AI 会自动完成:
104
104
  }
105
105
  ```
106
106
 
107
- ## 验证安装
107
+ ## Verify Installation
108
108
 
109
- 重启客户端后,确认工具是否加载成功:
109
+ After restarting your client, check if the tools are available:
110
110
 
111
- 1. 或直接问 AI:"你有哪些可用的工具?"
112
- 2. 应看到:`create_task`、`get_task_status`、`enhance_video_sync`、`sam3_predict`
111
+ 1. Or ask: "What tools do you have available?"
112
+ 2. You should see: `create_task`, `get_task_status`, `enhance_video_sync`, `sam3_predict`
113
113
 
114
- ## 配置项
114
+ ## Configuration Options
115
115
 
116
- | 变量名 | 必填 | 默认值 | 说明 |
116
+ | Variable | Required | Default | Description |
117
117
  |---|---|---|---|
118
- | `API_KEY` | **是** | - | API 认证密钥(视频增强和 SAM3 共用) |
119
- | `HTTP_API_BASE_URL` | 否 | `https://mcp.avc.ai/enhance` | 视频增强服务接口地址 |
120
- | `SAM3_API_BASE_URL` | 否 | `https://mcp.avc.ai/sam` | SAM3 服务接口地址 |
121
- | `SAM3_POLL_INTERVAL` | 否 | `2000` | SAM3 轮询间隔(毫秒) |
122
- | `SAM3_POLL_MAX_ATTEMPTS` | 否 | `25` | SAM3 最大轮询次数 |
118
+ | `API_KEY` | **Yes** | - | API authentication key (shared by video enhancement and SAM3) |
119
+ | `HTTP_API_BASE_URL` | No | `https://mcp.avc.ai/enhance` | Video enhancement service endpoint |
120
+ | `SAM3_API_BASE_URL` | No | `https://mcp.avc.ai/sam` | SAM3 service endpoint |
121
+ | `SAM3_POLL_INTERVAL` | No | `2000` | SAM3 polling interval (milliseconds) |
122
+ | `SAM3_POLL_MAX_ATTEMPTS` | No | `25` | SAM3 maximum polling attempts |
123
123
 
124
- ### 自定义服务地址
124
+ ### Custom Endpoint
125
125
 
126
126
  ```json
127
127
  {
@@ -133,71 +133,71 @@ AI 会自动完成:
133
133
  }
134
134
  ```
135
135
 
136
- 或通过命令行参数:
136
+ Or via CLI args:
137
137
  ```bash
138
138
  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
139
139
  ```
140
140
 
141
- ## 推荐的工作流程
141
+ ## Recommended Workflow
142
142
 
143
- 本项目提供了**同步**和**异步**两种模式。
143
+ This project provides both **synchronous** and **asynchronous** modes.
144
144
 
145
- **由于 MCP Agent 对单个 tool 调用通常有约 60 秒的超时限制**,处理时间较长的任务(视频增强)强烈建议使用**异步模式**:
145
+ **Because MCP Agents typically enforce a ~60-second timeout per tool call**, tasks with longer processing times (video enhancement) are strongly recommended to use **asynchronous mode**:
146
146
 
147
- ### 异步模式(推荐)
147
+ ### Asynchronous Mode (Recommended)
148
148
 
149
- **视频增强**:
150
- 1. 调用 `create_task` 创建任务 → 立即获得 `task_id`
151
- 2. 等待几秒后,调用 `get_task_status` 查询状态
152
- 3. 如果 `status` 为 `processing`,继续等待并重复步骤 2
153
- 4. 如果 `status` 为 `completed`,任务完成,结果中包含 `video_url`
154
- 5. 如果 `status` 为 `failed`,任务失败,结果中包含 `error_message`
149
+ **Video Enhancement:**
150
+ 1. Call `create_task` to create a task → immediately get `task_id`
151
+ 2. Wait a few seconds, then call `get_task_status` to query the status
152
+ 3. If `status` is `processing`, continue waiting and repeat step 2
153
+ 4. If `status` is `completed`, the task is done and the result contains `video_url`
154
+ 5. If `status` is `failed`, the task failed and the result contains `error_message`
155
155
 
156
- ### 同步模式(简单场景)
156
+ ### Synchronous Mode (Simple Scenarios)
157
157
 
158
- **视频增强**:
159
- - 调用 `enhance_video_sync` → 服务器内部自动轮询
160
- - 默认最多等待50秒
161
- - 如果50秒内完成,直接返回结果
162
- - 如果50秒未完成,返回 `task_id` 和提示,让 Agent 切换到 `get_task_status` 继续查询
158
+ **Video Enhancement:**
159
+ - Call `enhance_video_sync` → the server polls internally
160
+ - Defaults to a maximum wait of 50 seconds
161
+ - If completed within 50 seconds, returns the result directly
162
+ - If not completed within 50 seconds, returns `task_id` and instructions for the Agent to switch to `get_task_status`
163
163
 
164
- **图像分割 (SAM3)**:
165
- - 调用 `sam3_predict` → 服务器内部自动轮询
166
- - 默认最多等待50秒(25次 × 2秒轮询间隔)
167
- - 如果50秒内完成,直接返回分割结果
168
- - 如果50秒未完成,返回截断提示,告知任务仍在处理中
164
+ **Image Segmentation (SAM3):**
165
+ - Call `sam3_predict` → the server polls internally
166
+ - Defaults to a maximum wait of 50 seconds (25 attempts × 2-second polling interval)
167
+ - If completed within 50 seconds, returns the segmentation result directly
168
+ - If not completed within 50 seconds, returns a truncation notice indicating the task is still processing
169
169
 
170
- ## 使用示例
170
+ ## Usage Examples
171
171
 
172
- 配置完成后,用自然语言对 AI 说:
172
+ Once configured, ask your AI agent naturally:
173
173
 
174
- > "帮我把这个视频增强到 1080p:https://example.com/video.mp4"
174
+ > "Enhance this video to 1080p: https://example.com/video.mp4"
175
175
 
176
- > "把我桌面的 video.mp4 提升到 2k 画质"
176
+ > "Improve the quality of /Users/me/Desktop/video.mp4 to 2k"
177
177
 
178
- > "帮我分析这张图片,找出里面的所有物体:C:\\Users\\xxx\\photo.png"
178
+ > "Analyze this image and find all objects: C:\\Users\\xxx\\photo.png"
179
179
 
180
- > "用 SAM3 分割这张图片,prompt 是 'find all cars'"
180
+ > "Use SAM3 to segment this image, prompt: 'find all cars'"
181
181
 
182
- AI 会根据任务复杂度自动选择同步或异步工具完成任务。
182
+ The agent will automatically choose sync or async tools based on task complexity.
183
183
 
184
- ## 提供的 Tools
184
+ ## Provided Tools
185
185
 
186
- ### 视频增强
186
+ ### Video Enhancement
187
187
 
188
188
  #### create_task
189
189
 
190
- 创建视频增强任务(异步)。
190
+ Create an asynchronous video enhancement task.
191
191
 
192
- > **推荐使用**:适用于绝大多数场景,尤其是时长超过10秒的视频,可避免超时和长时间阻塞连接。
192
+ > **Recommended for most use cases.** Ideal for longer videos (over 10 seconds) to avoid timeouts and blocking the connection.
193
193
 
194
- | 参数 | 类型 | 必填 | 默认值 | 说明 |
194
+ | Parameter | Type | Required | Default | Description |
195
195
  |---|---|---|---|---|
196
- | `video_source` | string | 是 | - | 视频 URL 或本地文件路径(URL 必须公网可访问,不支持需要登录或签名的链接) |
197
- | `type` | string | 否 | `url` | `url` 或 `local` |
198
- | `resolution` | string | 否 | `720p` | `480p`、`540p`、`720p`、`1080p`、`2k` |
196
+ | `video_source` | string | Yes | - | Video URL or local file path (URL must be publicly accessible, links requiring login or signatures are not supported) |
197
+ | `type` | string | No | `url` | `url` or `local` |
198
+ | `resolution` | string | No | `720p` | `480p`, `540p`, `720p`, `1080p`, `2k` |
199
199
 
200
- **返回值:**
200
+ **Returns:**
201
201
  ```json
202
202
  {
203
203
  "success": true,
@@ -208,15 +208,15 @@ AI 会根据任务复杂度自动选择同步或异步工具完成任务。
208
208
 
209
209
  #### get_task_status
210
210
 
211
- 查询视频增强任务状态。
211
+ Query video enhancement task status.
212
212
 
213
- > 返回值中的 `status` 字段可能为:`processing`(处理中)、`completed`(已完成)、`failed`(失败)。如果 `status` 为 `processing`,你需要等待几秒后再次调用此工具轮询。
213
+ > The returned `status` field can be: `processing`, `completed`, or `failed`. If `status` is `processing`, you need to wait a few seconds and call this tool again.
214
214
 
215
- | 参数 | 类型 | 必填 |
215
+ | Parameter | Type | Required |
216
216
  |---|---|---|
217
- | `task_id` | string | 是 |
217
+ | `task_id` | string | Yes |
218
218
 
219
- **返回值:**
219
+ **Returns:**
220
220
  ```json
221
221
  {
222
222
  "success": true,
@@ -224,76 +224,76 @@ AI 会根据任务复杂度自动选择同步或异步工具完成任务。
224
224
  "status": "completed",
225
225
  "progress": 100,
226
226
  "video_url": "https://...",
227
- "message": "任务仍在处理中,请稍后再查询"
227
+ "message": "Task is still processing, please check again later"
228
228
  }
229
229
  ```
230
230
 
231
- 其中 `message` 字段只在 `status` 为 `processing` 时出现,提示 Agent 继续等待。
231
+ The `message` field only appears when `status` is `processing`, prompting the Agent to continue waiting.
232
232
 
233
233
  #### enhance_video_sync
234
234
 
235
- 同步增强视频(阻塞等待完成)。
235
+ Synchronously enhance video (blocks until completion).
236
236
 
237
- > **仅适合短视频(预计处理时间 < 1 分钟)。** 如果任务在50秒内未完成,工具会提前返回并包含 `task_id`,你需要使用 `get_task_status` 继续查询。
237
+ > **Best for short videos (estimated processing time < 1 minute).** If the task is not completed within 50 seconds, the tool returns early with a `task_id`, and you need to use `get_task_status` to continue querying.
238
238
 
239
- | 参数 | 类型 | 必填 | 默认值 | 说明 |
239
+ | Parameter | Type | Required | Default | Description |
240
240
  |---|---|---|---|---|
241
- | `video_source` | string | 是 | - | 视频 URL 或本地文件路径 |
242
- | `type` | string | 否 | `url` | `url` 或 `local` |
243
- | `resolution` | string | 否 | `720p` | 目标分辨率 |
244
- | `poll_interval` | number | 否 | `5` | 轮询间隔(秒) |
245
- | `timeout` | number | 否 | `50` | 同步等待超时时间(秒),超过后主动返回 |
241
+ | `video_source` | string | Yes | - | Video URL or local file path |
242
+ | `type` | string | No | `url` | `url` or `local` |
243
+ | `resolution` | string | No | `720p` | Target resolution |
244
+ | `poll_interval` | number | No | `5` | Poll interval (seconds) |
245
+ | `timeout` | number | No | `50` | Sync wait timeout (seconds), returns early when exceeded |
246
246
 
247
- **截断返回示例(50秒未完成):**
247
+ **Truncated return example (not completed within 50s):**
248
248
  ```json
249
249
  {
250
250
  "success": true,
251
251
  "status": "processing",
252
252
  "task_id": "xxx",
253
- "message": "任务仍在处理中(已等待 50 秒)。请使用 get_task_status 工具继续查询此任务状态。",
254
- "note": "此工具对长任务的同步等待已被截断,请切换到 get_task_status 轮询模式。"
253
+ "message": "Task is still processing (waited 50 seconds). Please use get_task_status to continue polling.",
254
+ "note": "The synchronous wait for this long-running task has been truncated. Switch to get_task_status polling."
255
255
  }
256
256
  ```
257
257
 
258
- ### 图像分割 (SAM3)
258
+ ### Image Segmentation (SAM3)
259
259
 
260
260
  #### sam3_predict
261
261
 
262
- 使用 SAM3 分割 API 分析图片,生成推理结果(masks、boxes、scores)。
262
+ Analyze an image using the SAM3 segmentation API to generate inference results (masks, boxes, scores).
263
263
 
264
- **参数:**
264
+ **Parameters:**
265
265
 
266
- 图片输入(三选一,必须提供其中一种):
266
+ Image input (choose one, must provide exactly one):
267
267
 
268
- - `imagePath` (string): 本地图片的绝对路径。支持常见图片格式(如 PNG、JPG、JPEG)。
269
- - 示例:`"C:\\Users\\xxx\\photo.png"`、`"/home/user/images/cat.jpg"`
270
- - 适用场景:用户明确提供了本地文件路径
268
+ - `imagePath` (string): Absolute path of a local image file. Supports common formats (PNG, JPG, JPEG).
269
+ - Example: `"C:\\Users\\xxx\\photo.png"`, `"/home/user/images/cat.jpg"`
270
+ - Use when: The user explicitly provides a local file path
271
271
 
272
- - `imageUrl` (string): 公开可访问的图片 URL。
273
- - 示例:`"https://example.com/photo.jpg"`
274
- - 适用场景:图片已在网上,用户提供了链接
275
- - 注意:URL 必须公开可访问,不支持需要登录或签名的链接
272
+ - `imageUrl` (string): Publicly accessible URL of the image.
273
+ - Example: `"https://example.com/photo.jpg"`
274
+ - Use when: The image is already online and the user provides a link
275
+ - Note: The URL must be publicly accessible. Links requiring login or signatures are not supported
276
276
 
277
- - `imageBase64` (string): Base64 编码的图片数据。
278
- - 示例:`"iVBORw0KGgoAAAANSUhEUgAA..."`
279
- - 适用场景:用户拖拽或上传了图片附件,Agent 将图片编码为 base64 后传入
280
- - 注意:大图片的 base64 数据会比较大,传输时间可能稍长
277
+ - `imageBase64` (string): Base64-encoded image data.
278
+ - Example: `"iVBORw0KGgoAAAANSUhEUgAA..."`
279
+ - Use when: The user drags or uploads an image attachment, and the Agent encodes it as base64
280
+ - Note: Large images will produce very large base64 strings, which may slow transmission
281
281
 
282
- 其他参数:
282
+ Other parameters:
283
283
 
284
- - `prompt` (string, required): 英文文本提示,用于指定要在图片中分割的目标物体。由于 SAM3 模型仅接受英文 prompt,建议传入英文描述。如果用户提供中文或其他非英文文本,Agent 会自动翻译为英文后调用。
284
+ - `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.
285
285
 
286
- **正常完成返回:**
286
+ **Normal completion return:**
287
287
 
288
- 推理完成后,直接返回 JSON 字符串。该 JSON 包含以下三个字段:
288
+ After inference completes, returns a JSON string containing three fields:
289
289
 
290
- - **`masks`**:二维数组。每个元素是一个与输入图片尺寸相同的二值掩码(取值为 0 或 1),用于标记检测到的物体在图片中的像素级位置。数组中的第 i 个掩码对应第 i 个检测到的物体实例。
291
- - **`boxes`**:二维数组。每个元素是 `[x1, y1, x2, y2]` 格式的边界框坐标,表示检测到的物体在图片中的矩形区域。`x1`、`y1` 为左上角坐标,`x2`、`y2` 为右下角坐标。
290
+ - **`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.
291
+ - **`boxes`**: 2D array. Each element is a bounding box in `[x1, y1, x2, y2]` format, representing the rectangular region of the detected object. `x1`, `y1` are the top-left coordinates; `x2`, `y2` are the bottom-right coordinates.
292
292
 
293
- 坐标系说明:以图片左上角为原点 `(0, 0)`,`x` 轴向右增长,`y` 轴向下增长,单位为像素。例如 `[120, 80, 300, 450]` 表示该物体区域从图片左边缘向右 120px、上边缘向下 80px 处开始,延伸至左边缘向右 300px、上边缘向下 450px 处结束,区域宽度为 `x2 - x1 = 180px`,高度为 `y2 - y1 = 370px`。
294
- - **`scores`**:一维数组。每个元素是对应检测结果的置信度分数,取值范围为 0 到 1。分数越高,表示模型对该检测结果的把握越大。
293
+ 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`.
294
+ - **`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.
295
295
 
296
- 结果 JSON 内容示例:
296
+ Example result JSON:
297
297
 
298
298
  ```json
299
299
  {
@@ -309,7 +309,7 @@ AI 会根据任务复杂度自动选择同步或异步工具完成任务。
309
309
  }
310
310
  ```
311
311
 
312
- **截断返回示例(50秒未完成):**
312
+ **Truncated return example (not completed within 50s):**
313
313
  ```json
314
314
  {
315
315
  "success": true,
@@ -320,100 +320,100 @@ AI 会根据任务复杂度自动选择同步或异步工具完成任务。
320
320
  }
321
321
  ```
322
322
 
323
- ## 常见问题
323
+ ## FAQ
324
324
 
325
- ### Agent 调用工具时报超时怎么办?
325
+ ### Agent reports timeout when calling tools?
326
326
 
327
- 这是本项目重点解决的问题。MCP Agent(如 Claude、Cursor)对单个 tool 调用通常有约 60 秒的超时限制。如果任务处理时间超过此限制,Agent 会报错并切断连接。
327
+ This is the primary issue this project addresses. MCP Agents (such as Claude, Cursor) typically enforce a ~60-second timeout per tool call. If task processing exceeds this limit, the Agent will error and disconnect.
328
328
 
329
- **解决方案:**
329
+ **Solutions:**
330
330
 
331
- 1. **优先使用异步工具**:对于视频增强等耗时任务,始终使用 `create_task` + `get_task_status`。这些工具每次调用都是瞬间返回的,不会触发超时。
331
+ 1. **Prefer asynchronous tools**: For video enhancement and other time-consuming tasks, always use `create_task` + `get_task_status`. These tools return instantly on each call and will not trigger timeouts.
332
332
 
333
- 2. **同步工具的截断机制**:`enhance_video_sync` 已在内部设置了50秒的截断限制。如果任务未在50秒内完成,工具会主动返回 `task_id`,并提示 Agent 使用 `get_task_status` 继续跟进。
333
+ 2. **Sync tool truncation mechanism**: `enhance_video_sync` has an internal 50-second truncation limit. If the task is not completed within 50 seconds, the tool proactively returns a `task_id` and instructs the Agent to use `get_task_status` to follow up.
334
334
 
335
- 3. **SAM3 的截断机制**:`sam3_predict` 默认轮询25次(约50秒),如果任务未完成会返回截断提示,告知任务仍在处理中。
335
+ 3. **SAM3 truncation mechanism**: `sam3_predict` defaults to 25 polling attempts (~50 seconds). If the task is not completed, it returns a truncation notice indicating the task is still processing.
336
336
 
337
- 4. **调整 SAM3 轮询参数**(高级):如果你确定 SAM3 任务通常很快(例如10秒内),可以通过环境变量增加轮询次数:
337
+ 4. **Adjust SAM3 polling parameters** (advanced): If you are confident that SAM3 tasks are usually fast (e.g., under 10 seconds), you can increase polling attempts via environment variable:
338
338
  ```bash
339
339
  SAM3_POLL_MAX_ATTEMPTS=60
340
340
  ```
341
- 但请确保总等待时间不超过 Agent 的超时限制。
341
+ But ensure the total wait time does not exceed your Agent's timeout limit.
342
342
 
343
- ### 拖拽附件后提示找不到文件?
343
+ ### Drag-and-drop attachment says file not found?
344
344
 
345
- 这是 stdio MCP 的已知限制。当通过 Agent 界面拖拽或上传附件时,文件路径通常不会自动传给 MCP Server。
345
+ This is a known limitation of stdio MCP. When dragging or uploading an attachment through the Agent interface, the file path is usually not automatically passed to the MCP Server.
346
346
 
347
- **解决方法:**
347
+ **Solutions:**
348
348
 
349
- 1. **同时提供路径**(推荐):拖拽图片后,在文字中补充说明图片的本地绝对路径:
350
- > "请处理这张图片 `D:\\photos\\cat.jpg`,找出里面的猫"
349
+ 1. **Provide the path simultaneously** (recommended): After dragging the image, add the local absolute path in your message:
350
+ > "Please analyze this image `D:\\photos\\cat.jpg` and find the cat"
351
351
 
352
- 2. **等待自动编码**:Claude 可能会自动将图片编码为 base64 传入。如果成功,无需额外操作。
352
+ 2. **Wait for auto-encoding**: Claude may automatically encode the image as base64. If successful, no extra action is needed.
353
353
 
354
- 3. **回答路径询问**:如果 Claude 询问图片路径,直接回复本地绝对路径即可。
354
+ 3. **Reply to path inquiry**: If Claude asks for the image path, simply reply with the local absolute path.
355
355
 
356
- ### 三种输入方式有优先级吗?
356
+ ### Is there a priority among the three input methods?
357
357
 
358
- 没有严格优先级。Claude 会根据对话上下文自动选择最合适的方式:
358
+ There is no strict priority. Claude will automatically choose the most appropriate method based on conversation context:
359
359
 
360
- - 你提供了本地路径 → 使用 `imagePath`
361
- - 你提供了网络链接 → 使用 `imageUrl`
362
- - 你拖拽了附件且没有路径 → 尝试 `imageBase64`
360
+ - You provided a local path → uses `imagePath`
361
+ - You provided a web link → uses `imageUrl`
362
+ - You dragged an attachment without a path → tries `imageBase64`
363
363
 
364
- ### 支持哪些图片格式?
364
+ ### What image formats are supported?
365
365
 
366
- 支持常见格式:PNG、JPG、JPEG、BMP、WebP 等。建议优先使用 PNG 或 JPG。
366
+ Common formats: PNG, JPG, JPEG, BMP, WebP, etc. PNG or JPG is recommended.
367
367
 
368
- ### URL 图片下载失败怎么办?
368
+ ### What if URL image download fails?
369
369
 
370
- 确保 URL 是**公开可访问**的,不需要登录、Cookie 或签名。如果图片在需要身份验证的服务上(如私有 S3 Bucket、需要登录的图床),请先下载到本地再使用 `imagePath`。
370
+ Ensure the URL is **publicly accessible**, requiring no login, cookies, or signatures. If the image is on a service requiring authentication (e.g., private S3 Bucket, login-required image host), download it locally first and use `imagePath`.
371
371
 
372
- ### Base64 图片太大怎么办?
372
+ ### What if the base64 image is too large?
373
373
 
374
- 如果图片很大(如 4K 分辨率),base64 编码后的数据会非常大,可能导致传输变慢。建议:
374
+ If the image is very large (e.g., 4K resolution), the base64-encoded data will be very large and may slow transmission. Suggestions:
375
375
 
376
- 1. 使用 `imagePath` 代替
377
- 2. 或先将图片压缩后再编码
376
+ 1. Use `imagePath` instead
377
+ 2. Or compress the image before encoding
378
378
 
379
- ## 文件上传说明
379
+ ## File Upload Notes
380
380
 
381
- 当 `type` 为 `"local"` 时,MCP Server 会:
382
- 1. 读取本地文件
383
- 2. 通过预签名 URL 直传到 TOS 对象存储
384
- 3. **最大文件大小:100MB**
381
+ When `type` is `"local"`:
382
+ 1. File is read locally by the MCP Server
383
+ 2. Uploaded directly to TOS object storage via pre-signed URL
384
+ 3. **Max file size: 100MB**
385
385
 
386
- ## 故障排查
386
+ ## Troubleshooting
387
387
 
388
388
  ### "command not found: npx"
389
389
 
390
- 安装 Node.js >= 18:https://nodejs.org/
390
+ Install Node.js >= 18: https://nodejs.org/
391
391
 
392
- ### "错误: 需要提供 --api-key 或设置 API_KEY"
392
+ ### "Error: --api-key argument or API_KEY environment variable is required"
393
393
 
394
- API Key 缺失,请检查配置中的 `env.API_KEY`。
394
+ Your API Key is missing. Double-check the `env.API_KEY` in your config.
395
395
 
396
- ### MCP Server 在客户端显示红色/错误
396
+ ### MCP Server shows red/error in client
397
397
 
398
- 查看日志:
399
- - **Claude Desktop macOS**:`~/Library/Logs/Claude/mcp*.log`
400
- - **Claude Desktop Windows**:`%APPDATA%\Claude\logs\mcp*.log`
401
- - **Cursor**:Output 面板 > MCP
398
+ Check logs:
399
+ - **Claude Desktop macOS**: `~/Library/Logs/Claude/mcp*.log`
400
+ - **Claude Desktop Windows**: `%APPDATA%\Claude\logs\mcp*.log`
401
+ - **Cursor**: Output panel > MCP
402
402
 
403
- ### "TOS 上传失败"
403
+ ### "TOS upload failed"
404
404
 
405
- 通常是签名不匹配,请确认 `HTTP_API_BASE_URL` 和 `API_KEY` 正确且有效。
405
+ Usually a signature mismatch. Ensure your `HTTP_API_BASE_URL` and `API_KEY` are correct and active.
406
406
 
407
- ## 全局安装(可选)
407
+ ## Global Install (Alternative)
408
408
 
409
- 如果你不想每次都用 `npx`:
409
+ If you prefer not using `npx` every time:
410
410
 
411
411
  ```bash
412
412
  npm install -g @avclabs.ai/media-mcp
413
413
  ```
414
414
 
415
- 然后在配置中使用 `"command": "media-mcp"` 配合 `"args": ["--api-key", "your-api-key"]` 。
415
+ Then use `"command": "media-mcp"` with `"args": ["--api-key", "your-api-key"]` in your config.
416
416
 
417
417
  ## License
418
418
 
419
- MIT License - 详见 [LICENSE](LICENSE) 文件
419
+ MIT License - See [LICENSE](LICENSE) file for details