@visionengine/remotion-file-bridge 1.0.0 → 1.0.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-zh.md +23 -1
- package/README.md +2 -0
- package/dist/client.js +24 -0
- package/dist/server.js +16 -5
- package/package.json +1 -1
package/README-zh.md
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
- `read_file`:直接读取文本文件,或返回二进制资源的预览/下载地址。
|
|
21
21
|
- `download_file`:把远端工作区文件下载到本地 `WORKDIR`。
|
|
22
22
|
- `save_file`:把本地文件、文本、base64 内容或远端 URL 保存到工作区。
|
|
23
|
+
- `delete_file`:按完整工作区相对路径删除远端文件。该操作需要使用用户 API KEY 做后端校验。
|
|
23
24
|
|
|
24
25
|
## 后端依赖
|
|
25
26
|
|
|
@@ -27,5 +28,26 @@
|
|
|
27
28
|
|
|
28
29
|
- `GET /api/v1/auth/me`
|
|
29
30
|
- `GET /api/v1/files/list`
|
|
31
|
+
- `DELETE /api/v1/files/delete`
|
|
30
32
|
- `GET /shared/{userId}/{path}`
|
|
31
|
-
- `POST /save`
|
|
33
|
+
- `POST /save`
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"mcpServers": {
|
|
39
|
+
"ve-remotion-file-bridge": {
|
|
40
|
+
"type": "local",
|
|
41
|
+
"command": "npx",
|
|
42
|
+
"args": ["-y", "@visionengine/remotion-file-bridge@latest"],
|
|
43
|
+
"transport": "stdio",
|
|
44
|
+
"env": {
|
|
45
|
+
"API_KEY": "你的API密钥"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
// npx -y @visionengine/remotion-file-bridge@latest
|
|
51
|
+
// npm info @visionengine/remotion-file-bridge@latest
|
|
52
|
+
```
|
|
53
|
+
|
package/README.md
CHANGED
|
@@ -20,6 +20,7 @@ Required:
|
|
|
20
20
|
- `read_file`: read text files directly, or return preview/download URLs for binary assets.
|
|
21
21
|
- `download_file`: download a remote workspace file into local `WORKDIR`.
|
|
22
22
|
- `save_file`: save local files, text, base64 content, or remote URLs into the workspace.
|
|
23
|
+
- `delete_file`: delete a remote workspace file by full workspace-relative path. This operation requires API key authentication.
|
|
23
24
|
|
|
24
25
|
## Backend requirements
|
|
25
26
|
|
|
@@ -27,5 +28,6 @@ This MCP package depends on these backend endpoints:
|
|
|
27
28
|
|
|
28
29
|
- `GET /api/v1/auth/me`
|
|
29
30
|
- `GET /api/v1/files/list`
|
|
31
|
+
- `DELETE /api/v1/files/delete`
|
|
30
32
|
- `GET /shared/{userId}/{path}`
|
|
31
33
|
- `POST /save`
|
package/dist/client.js
CHANGED
|
@@ -185,3 +185,27 @@ export async function saveProjectFile(args) {
|
|
|
185
185
|
},
|
|
186
186
|
};
|
|
187
187
|
}
|
|
188
|
+
export async function deleteProjectFile(args) {
|
|
189
|
+
const userId = await resolveUserId(args.userId);
|
|
190
|
+
const workspacePath = normalizeWorkspacePath(args.path, userId);
|
|
191
|
+
if (!workspacePath || workspacePath === '.') {
|
|
192
|
+
throw new Error('path must be a full workspace-relative file path');
|
|
193
|
+
}
|
|
194
|
+
const query = new URLSearchParams({ path: workspacePath });
|
|
195
|
+
const response = await fetch(`${getBaseUrl()}/api/v1/files/delete?${query.toString()}`, {
|
|
196
|
+
method: 'DELETE',
|
|
197
|
+
headers: buildAuthHeaders(),
|
|
198
|
+
});
|
|
199
|
+
if (!response.ok) {
|
|
200
|
+
throw new Error(`Failed to delete file: ${response.status} ${await response.text()}`);
|
|
201
|
+
}
|
|
202
|
+
const payload = await response.json();
|
|
203
|
+
return {
|
|
204
|
+
success: payload.success,
|
|
205
|
+
userId,
|
|
206
|
+
workspacePath: payload.path,
|
|
207
|
+
metadata: {
|
|
208
|
+
deleted: payload.deleted,
|
|
209
|
+
},
|
|
210
|
+
};
|
|
211
|
+
}
|
package/dist/server.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { FastMCP } from 'fastmcp';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { downloadProjectFile, listProjectFiles, readProjectFile, saveProjectFile } from './client.js';
|
|
3
|
+
import { deleteProjectFile, downloadProjectFile, listProjectFiles, readProjectFile, saveProjectFile } from './client.js';
|
|
4
4
|
const server = new FastMCP({
|
|
5
5
|
name: 'VE Remotion File Bridge',
|
|
6
6
|
version: '1.0.0',
|
|
7
|
+
instructions: 'Use this MCP only when the user explicitly asks to operate files in the remote Remotion project workspace, VEC cloud workspace, cloud project files, or other clearly remote workspace assets. Do not use it for ordinary local file operations unless the user clearly indicates they want to work with the remote VEC workspace.',
|
|
7
8
|
});
|
|
8
9
|
server.addTool({
|
|
9
10
|
name: 'list_files',
|
|
10
|
-
description: '
|
|
11
|
+
description: 'Use only when the user explicitly wants to browse files in the remote Remotion/VEC cloud workspace. Lists files from the current remote project workspace via the backend file bridge API, not the ordinary local filesystem.',
|
|
11
12
|
annotations: { title: 'List Remotion Project Files', readOnlyHint: true, openWorldHint: false },
|
|
12
13
|
parameters: z.object({
|
|
13
14
|
userId: z.string().optional().describe('Optional user id override. Normally resolved automatically from API key.'),
|
|
@@ -22,7 +23,7 @@ server.addTool({
|
|
|
22
23
|
});
|
|
23
24
|
server.addTool({
|
|
24
25
|
name: 'read_file',
|
|
25
|
-
description: '
|
|
26
|
+
description: 'Use only when the user explicitly wants to read a file from the remote Remotion/VEC cloud workspace. Reads remote text files when suitable, or returns preview/download URLs for remote binary assets.',
|
|
26
27
|
annotations: { title: 'Read Remotion Project File', readOnlyHint: true, openWorldHint: false },
|
|
27
28
|
parameters: z.object({
|
|
28
29
|
userId: z.string().optional(),
|
|
@@ -34,7 +35,7 @@ server.addTool({
|
|
|
34
35
|
});
|
|
35
36
|
server.addTool({
|
|
36
37
|
name: 'download_file',
|
|
37
|
-
description: '
|
|
38
|
+
description: 'Use only when the user explicitly wants to fetch a file from the remote Remotion/VEC cloud workspace into the local environment. Downloads a remote workspace file into local WORKDIR.',
|
|
38
39
|
annotations: { title: 'Download Remotion Project File', readOnlyHint: false, openWorldHint: false },
|
|
39
40
|
parameters: z.object({
|
|
40
41
|
userId: z.string().optional(),
|
|
@@ -45,7 +46,7 @@ server.addTool({
|
|
|
45
46
|
});
|
|
46
47
|
server.addTool({
|
|
47
48
|
name: 'save_file',
|
|
48
|
-
description: '
|
|
49
|
+
description: 'Use only when the user explicitly wants to save or upload content into the remote Remotion/VEC cloud workspace. Saves local files, text, base64 payloads, or remote URLs into the current user remote workspace.',
|
|
49
50
|
annotations: { title: 'Save Remotion Project File', readOnlyHint: false, openWorldHint: true },
|
|
50
51
|
parameters: z.object({
|
|
51
52
|
userId: z.string().optional(),
|
|
@@ -59,4 +60,14 @@ server.addTool({
|
|
|
59
60
|
}),
|
|
60
61
|
execute: async (args) => JSON.stringify(await saveProjectFile(args), null, 2),
|
|
61
62
|
});
|
|
63
|
+
server.addTool({
|
|
64
|
+
name: 'delete_file',
|
|
65
|
+
description: 'Use only when the user explicitly wants to delete a file from the remote Remotion/VEC cloud workspace. Deletes a file in the current user remote workspace and requires the full workspace-relative file path.',
|
|
66
|
+
annotations: { title: 'Delete Remotion Project File', readOnlyHint: false, openWorldHint: false },
|
|
67
|
+
parameters: z.object({
|
|
68
|
+
userId: z.string().optional(),
|
|
69
|
+
path: z.string().min(1).describe('Full workspace-relative file path to delete, such as src/Root.tsx or public/videos/demo.mp4.'),
|
|
70
|
+
}),
|
|
71
|
+
execute: async (args) => JSON.stringify(await deleteProjectFile(args), null, 2),
|
|
72
|
+
});
|
|
62
73
|
export { server };
|