just-bash-mcp 2.9.1 → 2.9.3

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
@@ -9,18 +9,16 @@ Execute bash commands in a secure, isolated environment with an in-memory virtua
9
9
 
10
10
  Built on top of [`just-bash`](https://github.com/vercel-labs/just-bash) v2.10.2.
11
11
 
12
- ## What's New in v2.9.0
12
+ ## What's New in v2.9.2
13
13
 
14
- - **Synced with upstream `just-bash` v2.10.2** - Latest upstream commands, APIs, and type exports
14
+ - **Expanded Vercel Sandbox API coverage** - `bash_sandbox_run` now supports optional `includeOutput` and `includeLogs`
15
+ - **Sandbox domain support** - New `bash_sandbox_domain` tool returns the current sandbox domain/identifier
16
+ - **Synced with upstream `just-bash` v2.10.2** - Full upstream commands, APIs, and type exports
15
17
  - **Defense-in-depth mode** - Opt-in monkey-patching of dangerous JS globals (`JUST_BASH_DEFENSE_IN_DEPTH=true`)
16
18
  - **Python support** - Python3 via Pyodide (`JUST_BASH_ENABLE_PYTHON=true`)
17
- - **Vercel Sandbox API** - Compatible `bash_sandbox_*` tools for isolated execution
18
- - **oxlint/oxfmt toolchain** - Replaced tsc/biome with faster oxlint and oxfmt
19
- - **Configurable limits** - Fine-grained control over glob ops, string length, array size, heredoc size, and more
20
- - **`rg` (ripgrep)** - Fast regex search with `--files`, `-d`, `--stats`, `-t markdown`
21
- - **`tar`** - Archive support with compression
22
- - **MountableFS** - Mount multiple filesystems at different paths
23
- - **ReadWriteFS** - Direct read-write access to real directories
19
+ - **Vercel Sandbox API tools** - Compatible `bash_sandbox_*` tools for isolated execution
20
+ - **MountableFS + ReadWriteFS** - Real directory mounts with overlay/read-write options
21
+ - **Configurable execution limits** - Fine-grained control over loops, strings, arrays, heredocs, and substitutions
24
22
 
25
23
  ## Features
26
24
 
@@ -180,7 +178,8 @@ Get current working directory or environment variables.
180
178
 
181
179
  Compatible with the Vercel Sandbox API:
182
180
 
183
- - `bash_sandbox_run` - Run a command in the sandbox
181
+ - `bash_sandbox_run` - Run a command in the sandbox (optionally include structured output/logs)
182
+ - `bash_sandbox_domain` - Get the sandbox domain/identifier
184
183
  - `bash_sandbox_write_files` - Write multiple files at once
185
184
  - `bash_sandbox_read_file` - Read a file (supports base64 encoding)
186
185
  - `bash_sandbox_mkdir` - Create a directory
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "just-bash-mcp",
3
- "version": "2.9.1",
3
+ "version": "2.9.3",
4
4
  "description": "MCP server providing a sandboxed bash environment using just-bash",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -60,14 +60,14 @@
60
60
  },
61
61
  "packageManager": "bun@1.3.8",
62
62
  "dependencies": {
63
- "@modelcontextprotocol/sdk": "^1.26.0",
63
+ "@modelcontextprotocol/sdk": "^1.27.0",
64
64
  "just-bash": "^2.10.2",
65
65
  "zod": "^4.3.6"
66
66
  },
67
67
  "devDependencies": {
68
- "@types/node": "^25.2.3",
68
+ "@types/node": "^25.3.0",
69
69
  "oxfmt": "^0.28.0",
70
- "oxlint": "^1.48.0",
70
+ "oxlint": "^1.50.0",
71
71
  "oxlint-tsgolint": "^0.11.5"
72
72
  }
73
73
  }
package/src/index.ts CHANGED
File without changes
@@ -15,6 +15,7 @@ import {
15
15
  RedirectNotAllowedError,
16
16
  SecurityViolationError,
17
17
  TooManyRedirectsError,
18
+ type OutputMessage,
18
19
  } from "just-bash";
19
20
  import { z } from "zod/v4";
20
21
  import { config } from "../config/index.ts";
@@ -61,16 +62,28 @@ export function registerSandboxTools(server: McpServer): void {
61
62
  command: z.string().describe("The command to execute"),
62
63
  cwd: z.string().optional().describe("Working directory for the command"),
63
64
  env: z.record(z.string(), z.string()).optional().describe("Environment variables to set"),
65
+ includeOutput: z
66
+ .boolean()
67
+ .optional()
68
+ .describe("Include structured output messages from SandboxCommand.output()"),
69
+ includeLogs: z
70
+ .boolean()
71
+ .optional()
72
+ .describe("Include execution logs from SandboxCommand.logs()"),
64
73
  },
65
74
  },
66
75
  async ({
67
76
  command,
68
77
  cwd,
69
78
  env,
79
+ includeOutput = false,
80
+ includeLogs = false,
70
81
  }: {
71
82
  command: string;
72
83
  cwd?: string;
73
84
  env?: Record<string, string>;
85
+ includeOutput?: boolean;
86
+ includeLogs?: boolean;
74
87
  }) => {
75
88
  try {
76
89
  const sandbox = await getPersistentSandbox();
@@ -79,20 +92,55 @@ export function registerSandboxTools(server: McpServer): void {
79
92
  const stdout = await cmd.stdout();
80
93
  const stderr = await cmd.stderr();
81
94
 
82
- return createJsonResponse(
83
- {
84
- stdout: truncateOutput(stdout, config.MAX_OUTPUT_LENGTH, "stdout"),
85
- stderr: truncateOutput(stderr, config.MAX_OUTPUT_LENGTH, "stderr"),
86
- exitCode: result.exitCode,
87
- },
88
- result.exitCode !== 0,
89
- );
95
+ const response: {
96
+ stdout: string;
97
+ stderr: string;
98
+ exitCode: number;
99
+ output?: string;
100
+ logs?: OutputMessage[];
101
+ } = {
102
+ stdout: truncateOutput(stdout, config.MAX_OUTPUT_LENGTH, "stdout"),
103
+ stderr: truncateOutput(stderr, config.MAX_OUTPUT_LENGTH, "stderr"),
104
+ exitCode: result.exitCode,
105
+ };
106
+
107
+ if (includeOutput) {
108
+ response.output = truncateOutput(await cmd.output(), config.MAX_OUTPUT_LENGTH, "stdout");
109
+ }
110
+ if (includeLogs) {
111
+ const logs: OutputMessage[] = [];
112
+ for await (const message of cmd.logs()) {
113
+ logs.push(message);
114
+ }
115
+ response.logs = logs;
116
+ }
117
+
118
+ return createJsonResponse(response, result.exitCode !== 0);
90
119
  } catch (error) {
91
120
  return classifyError(error, "Sandbox error");
92
121
  }
93
122
  },
94
123
  );
95
124
 
125
+ // ========================================================================
126
+ // bash_sandbox_domain - Get sandbox domain
127
+ // ========================================================================
128
+ server.registerTool(
129
+ "bash_sandbox_domain",
130
+ {
131
+ description: "Get the current sandbox domain/identifier.",
132
+ inputSchema: {},
133
+ },
134
+ async () => {
135
+ try {
136
+ const sandbox = await getPersistentSandbox();
137
+ return createJsonResponse({ domain: sandbox.domain });
138
+ } catch (error) {
139
+ return classifyError(error, "Domain error");
140
+ }
141
+ },
142
+ );
143
+
96
144
  // ========================================================================
97
145
  // bash_sandbox_write_files - Write multiple files
98
146
  // ========================================================================