@yukkit/e2b-mcp-server 0.4.0 → 0.5.0
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 +2 -0
- package/build/index.js +10 -5
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -110,6 +110,7 @@ Create a new isolated code execution sandbox.
|
|
|
110
110
|
|
|
111
111
|
**Parameters:**
|
|
112
112
|
|
|
113
|
+
- `secure` (optional): Whether to create a secure sandbox (default: true)
|
|
113
114
|
- `timeoutMs` (optional): Sandbox timeout in milliseconds (default: 300000, max: 3600000)
|
|
114
115
|
|
|
115
116
|
### 2. run_code
|
|
@@ -176,6 +177,7 @@ Get a download URL for a file in the sandbox.
|
|
|
176
177
|
|
|
177
178
|
- `filePath`: Path to the file
|
|
178
179
|
- `sandboxId`: Target sandbox ID
|
|
180
|
+
- `useSignatureExpiration` (optional): Signature expiration in milliseconds (default: 10000)
|
|
179
181
|
|
|
180
182
|
### 9. list_sandbox_ids
|
|
181
183
|
|
package/build/index.js
CHANGED
|
@@ -28,6 +28,7 @@ const MAX_ACTIVE_SANDBOXES = parseInt(process.env.MAX_ACTIVE_SANDBOXES || "10",
|
|
|
28
28
|
const LOG_LEVEL = process.env.LOG_LEVEL || "INFO";
|
|
29
29
|
// Schemas
|
|
30
30
|
const createSandboxSchema = z.object({
|
|
31
|
+
secure: z.boolean().default(true).describe("Whether to create a secure sandbox"),
|
|
31
32
|
timeoutMs: z
|
|
32
33
|
.number()
|
|
33
34
|
.min(1000)
|
|
@@ -67,6 +68,7 @@ const getSandboxUrlSchema = z.object({
|
|
|
67
68
|
const getFileDownloadUrlSchema = z.object({
|
|
68
69
|
filePath: z.string().min(1).describe("Path to the file"),
|
|
69
70
|
sandboxId: z.string().describe("Sandbox ID"),
|
|
71
|
+
useSignatureExpiration: z.number().default(10_000).describe("Signature expiration in milliseconds"),
|
|
70
72
|
});
|
|
71
73
|
const killSandboxSchema = z.object({
|
|
72
74
|
sandboxId: z.string().describe("Sandbox ID"),
|
|
@@ -125,13 +127,13 @@ class SandboxManager {
|
|
|
125
127
|
this.maxSandboxes = maxSandboxes;
|
|
126
128
|
logger.info(`SandboxManager initialized with max_sandboxes=${maxSandboxes}`);
|
|
127
129
|
}
|
|
128
|
-
async createSandbox(timeoutMs) {
|
|
130
|
+
async createSandbox(secure, timeoutMs) {
|
|
129
131
|
if (this.sandboxes.size >= this.maxSandboxes) {
|
|
130
132
|
throw new SandboxLimitExceededError(`Maximum number of sandboxes (${this.maxSandboxes}) reached`);
|
|
131
133
|
}
|
|
132
134
|
const timeout = Math.min(timeoutMs || DEFAULT_SANDBOX_TIMEOUT_MS, MAX_SANDBOX_TIMEOUT_MS);
|
|
133
135
|
try {
|
|
134
|
-
const sandbox = await Sandbox.create({ timeoutMs: timeout });
|
|
136
|
+
const sandbox = await Sandbox.create({ timeoutMs: timeout, secure: secure });
|
|
135
137
|
const sandboxId = sandbox.sandboxId;
|
|
136
138
|
this.sandboxes.set(sandboxId, sandbox);
|
|
137
139
|
logger.info(`Sandbox created: ${sandboxId} (timeout=${timeout}ms, active=${this.sandboxes.size})`);
|
|
@@ -332,7 +334,7 @@ class E2BServer {
|
|
|
332
334
|
}
|
|
333
335
|
async handleCreateSandbox(args) {
|
|
334
336
|
const parsed = createSandboxSchema.parse(args);
|
|
335
|
-
const { sandboxId } = await this.sandboxManager.createSandbox(parsed.timeoutMs);
|
|
337
|
+
const { sandboxId } = await this.sandboxManager.createSandbox(parsed.secure, parsed.timeoutMs);
|
|
336
338
|
const timeout = parsed.timeoutMs || DEFAULT_SANDBOX_TIMEOUT_MS;
|
|
337
339
|
const result = {
|
|
338
340
|
sandboxId,
|
|
@@ -540,12 +542,15 @@ class E2BServer {
|
|
|
540
542
|
async handleGetFileDownloadUrl(args) {
|
|
541
543
|
const parsed = getFileDownloadUrlSchema.parse(args);
|
|
542
544
|
const sandbox = this.sandboxManager.getSandbox(parsed.sandboxId);
|
|
545
|
+
const useSignatureExpiration = parsed.useSignatureExpiration;
|
|
543
546
|
try {
|
|
544
|
-
const url = sandbox.downloadUrl(parsed.filePath
|
|
547
|
+
const url = await sandbox.downloadUrl(parsed.filePath, {
|
|
548
|
+
useSignatureExpiration: useSignatureExpiration,
|
|
549
|
+
});
|
|
545
550
|
const result = {
|
|
546
551
|
sandboxId: parsed.sandboxId,
|
|
547
552
|
filePath: parsed.filePath,
|
|
548
|
-
url,
|
|
553
|
+
url: url,
|
|
549
554
|
};
|
|
550
555
|
logger.info(`Got download URL for file ${parsed.filePath} in sandbox ${parsed.sandboxId}`);
|
|
551
556
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yukkit/e2b-mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "A Model Context Protocol server",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"build"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@e2b/code-interpreter": "^
|
|
18
|
+
"@e2b/code-interpreter": "^2.3.3",
|
|
19
19
|
"@modelcontextprotocol/sdk": "1.25.2",
|
|
20
20
|
"dotenv": "^16.4.5",
|
|
21
21
|
"zod": "^3.25.1",
|