just-bash-mcp 2.9.3 → 2.9.4
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 +12 -14
- package/package.json +3 -4
- package/src/config/index.ts +6 -4
- package/src/index.ts +1 -1
- package/src/tools/bash-instance.ts +1 -1
- package/src/tools/index.ts +1 -1
- package/src/tools/sandbox-tools.ts +8 -35
package/README.md
CHANGED
|
@@ -7,16 +7,14 @@ An MCP (Model Context Protocol) server that provides a sandboxed bash environmen
|
|
|
7
7
|
|
|
8
8
|
Execute bash commands in a secure, isolated environment with an in-memory virtual filesystem.
|
|
9
9
|
|
|
10
|
-
Built on top of [`just-bash`](https://github.com/vercel-labs/just-bash) v2.
|
|
10
|
+
Built on top of [`just-bash`](https://github.com/vercel-labs/just-bash) v2.12.5.
|
|
11
11
|
|
|
12
|
-
## What's New in v2.9.
|
|
12
|
+
## What's New in v2.9.4
|
|
13
13
|
|
|
14
|
-
- **
|
|
15
|
-
- **
|
|
16
|
-
- **Synced with upstream `just-bash` v2.10.2** - Full upstream commands, APIs, and type exports
|
|
14
|
+
- **Synced with upstream `just-bash` v2.12.5** - Full upstream commands, APIs, and type exports
|
|
15
|
+
- **Persistent sandbox tools** - `bash_sandbox_*` tools remain available for higher-level isolated workflows
|
|
17
16
|
- **Defense-in-depth mode** - Opt-in monkey-patching of dangerous JS globals (`JUST_BASH_DEFENSE_IN_DEPTH=true`)
|
|
18
|
-
- **Python support** - Python3 via
|
|
19
|
-
- **Vercel Sandbox API tools** - Compatible `bash_sandbox_*` tools for isolated execution
|
|
17
|
+
- **Python support** - Python3 via the upstream emscripten CPython runtime (`JUST_BASH_ENABLE_PYTHON=true`)
|
|
20
18
|
- **MountableFS + ReadWriteFS** - Real directory mounts with overlay/read-write options
|
|
21
19
|
- **Configurable execution limits** - Fine-grained control over loops, strings, arrays, heredocs, and substitutions
|
|
22
20
|
|
|
@@ -123,7 +121,7 @@ Add to your MCP settings:
|
|
|
123
121
|
| `JUST_BASH_MAX_CALL_DEPTH` | Maximum function recursion depth | `100` |
|
|
124
122
|
| `JUST_BASH_MAX_COMMAND_COUNT` | Maximum total commands per execution | `10000` |
|
|
125
123
|
| `JUST_BASH_MAX_LOOP_ITERATIONS` | Maximum iterations per loop | `10000` |
|
|
126
|
-
| `JUST_BASH_ENABLE_PYTHON` | Enable Python3 via
|
|
124
|
+
| `JUST_BASH_ENABLE_PYTHON` | Enable Python3 via emscripten CPython (`true`/`false`) | `false` |
|
|
127
125
|
| `JUST_BASH_DEFENSE_IN_DEPTH` | Enable defense-in-depth mode (`true`/`false`) | `false` |
|
|
128
126
|
| `JUST_BASH_DEFENSE_IN_DEPTH_AUDIT` | Audit mode: log violations but don't block | `false` |
|
|
129
127
|
| `JUST_BASH_DEFENSE_IN_DEPTH_LOG` | Log violations to console | `false` |
|
|
@@ -174,16 +172,16 @@ Get information about the bash environment configuration, including defense-in-d
|
|
|
174
172
|
|
|
175
173
|
Get current working directory or environment variables.
|
|
176
174
|
|
|
177
|
-
###
|
|
175
|
+
### `bash_sandbox_*`
|
|
178
176
|
|
|
179
|
-
|
|
177
|
+
Persistent isolated-environment helpers:
|
|
180
178
|
|
|
181
|
-
- `bash_sandbox_run` - Run a command
|
|
182
|
-
- `bash_sandbox_domain` - Get the sandbox domain/identifier
|
|
179
|
+
- `bash_sandbox_run` - Run a command with optional structured output/logs
|
|
180
|
+
- `bash_sandbox_domain` - Get the current sandbox domain/identifier
|
|
183
181
|
- `bash_sandbox_write_files` - Write multiple files at once
|
|
184
182
|
- `bash_sandbox_read_file` - Read a file (supports base64 encoding)
|
|
185
183
|
- `bash_sandbox_mkdir` - Create a directory
|
|
186
|
-
- `bash_sandbox_stop` - Stop and clean up the sandbox
|
|
184
|
+
- `bash_sandbox_stop` - Stop and clean up the sandbox state
|
|
187
185
|
- `bash_sandbox_reset` - Reset the sandbox state
|
|
188
186
|
|
|
189
187
|
## Supported Commands
|
|
@@ -274,7 +272,7 @@ Compatible with the Vercel Sandbox API:
|
|
|
274
272
|
|
|
275
273
|
## Upstream API Coverage
|
|
276
274
|
|
|
277
|
-
This wrapper integrates the full public API surface of `just-bash` v2.
|
|
275
|
+
This wrapper integrates the full public API surface of `just-bash` v2.12.5:
|
|
278
276
|
|
|
279
277
|
| Category | Exports Used |
|
|
280
278
|
|----------|-------------|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "just-bash-mcp",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.4",
|
|
4
4
|
"description": "MCP server providing a sandboxed bash environment using just-bash",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -42,8 +42,7 @@
|
|
|
42
42
|
"cline",
|
|
43
43
|
"roo-code",
|
|
44
44
|
"windsurf",
|
|
45
|
-
"just-bash"
|
|
46
|
-
"vercel"
|
|
45
|
+
"just-bash"
|
|
47
46
|
],
|
|
48
47
|
"author": "dalist1",
|
|
49
48
|
"license": "Apache-2.0",
|
|
@@ -61,7 +60,7 @@
|
|
|
61
60
|
"packageManager": "bun@1.3.8",
|
|
62
61
|
"dependencies": {
|
|
63
62
|
"@modelcontextprotocol/sdk": "^1.27.0",
|
|
64
|
-
"just-bash": "^2.
|
|
63
|
+
"just-bash": "^2.12.5",
|
|
65
64
|
"zod": "^4.3.6"
|
|
66
65
|
},
|
|
67
66
|
"devDependencies": {
|
package/src/config/index.ts
CHANGED
|
@@ -372,7 +372,8 @@ export const ENVIRONMENT_VARIABLES = {
|
|
|
372
372
|
"Max file read size in bytes for OverlayFs/ReadWriteFs (default: 10MB)",
|
|
373
373
|
JUST_BASH_ENABLE_LOGGING: "Enable debug logging (default: false)",
|
|
374
374
|
JUST_BASH_ENABLE_TRACING: "Enable performance tracing (default: false)",
|
|
375
|
-
JUST_BASH_ENABLE_PYTHON:
|
|
375
|
+
JUST_BASH_ENABLE_PYTHON:
|
|
376
|
+
"Enable python3/python commands via the upstream emscripten CPython runtime (default: false)",
|
|
376
377
|
JUST_BASH_DEFENSE_IN_DEPTH:
|
|
377
378
|
"Enable defense-in-depth mode that patches dangerous JS globals (default: false)",
|
|
378
379
|
JUST_BASH_DEFENSE_IN_DEPTH_AUDIT:
|
|
@@ -390,7 +391,7 @@ export const COMMAND_CATEGORIES = {
|
|
|
390
391
|
textProcessing:
|
|
391
392
|
"awk, base64, column, comm, cut, diff, expand, fold, grep (egrep, fgrep), head, join, md5sum, nl, od, paste, printf, rev, rg (ripgrep), sed, sha1sum, sha256sum, sort, strings, tac, tail, tr, unexpand, uniq, wc, xargs",
|
|
392
393
|
dataProcessing:
|
|
393
|
-
"jq (JSON), python3/python (Python via
|
|
394
|
+
"jq (JSON), python3/python (Python via emscripten CPython), sqlite3 (SQLite), xan (CSV), yq (YAML/XML/TOML/CSV)",
|
|
394
395
|
compression: "gzip (gunzip, zcat), tar",
|
|
395
396
|
navigation:
|
|
396
397
|
"basename, cd, dirname, du, echo, env, export, find, hostname, printenv, pwd, tee, whoami",
|
|
@@ -411,8 +412,9 @@ export const FEATURES = {
|
|
|
411
412
|
trace: "Performance profiling via TraceCallback (upstream type)",
|
|
412
413
|
commandFilter: "Restrict available commands via JUST_BASH_ALLOWED_COMMANDS env var",
|
|
413
414
|
sandboxApi:
|
|
414
|
-
"
|
|
415
|
-
python:
|
|
415
|
+
"Additional persistent sandbox tools via bash_sandbox_* (run, write, read, mkdir, stop, reset)",
|
|
416
|
+
python:
|
|
417
|
+
"Python support via the upstream emscripten CPython runtime (opt-in via JUST_BASH_ENABLE_PYTHON=true)",
|
|
416
418
|
defenseInDepth:
|
|
417
419
|
"Defense-in-depth with SecurityViolationLogger, audit mode, and console logging (opt-in via JUST_BASH_DEFENSE_IN_DEPTH=true)",
|
|
418
420
|
overlayReadOnly:
|
package/src/index.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* just-bash-mcp - MCP Server for sandboxed bash execution
|
|
5
5
|
*
|
|
6
6
|
* A Model Context Protocol (MCP) server that provides AI agents with a
|
|
7
|
-
* secure, sandboxed bash environment powered by just-bash
|
|
7
|
+
* secure, sandboxed bash environment powered by just-bash.
|
|
8
8
|
*
|
|
9
9
|
* @see https://github.com/vercel-labs/just-bash
|
|
10
10
|
* @see https://modelcontextprotocol.io
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Handles creation and lifecycle of Bash instances
|
|
4
4
|
*
|
|
5
5
|
* Uses all upstream just-bash APIs:
|
|
6
|
-
* - Bash
|
|
6
|
+
* - Bash and Sandbox for execution
|
|
7
7
|
* - DefenseInDepthBox with SecurityViolationLogger for security monitoring
|
|
8
8
|
* - defineCommand for custom command registration
|
|
9
9
|
* - All filesystem variants (InMemoryFs, MountableFs, OverlayFs, ReadWriteFs)
|
package/src/tools/index.ts
CHANGED
|
@@ -37,7 +37,7 @@ export function registerAllTools(server: McpServer): void {
|
|
|
37
37
|
// File operation tools
|
|
38
38
|
registerFileTools(server);
|
|
39
39
|
|
|
40
|
-
//
|
|
40
|
+
// Additional persistent sandbox tools
|
|
41
41
|
registerSandboxTools(server);
|
|
42
42
|
|
|
43
43
|
// Information and state tools
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Sandbox API tools
|
|
3
|
-
*
|
|
3
|
+
* Tools for execution in a persistent isolated environment
|
|
4
4
|
*
|
|
5
5
|
* Uses upstream Sandbox/SandboxCommand APIs:
|
|
6
6
|
* - Sandbox.create(), runCommand(), writeFiles(), readFile(), mkDir(), stop()
|
|
@@ -27,9 +27,6 @@ import {
|
|
|
27
27
|
} from "../utils/index.ts";
|
|
28
28
|
import { getPersistentSandbox, resetPersistentSandbox } from "./bash-instance.ts";
|
|
29
29
|
|
|
30
|
-
/**
|
|
31
|
-
* Classify errors from just-bash into user-friendly messages.
|
|
32
|
-
*/
|
|
33
30
|
function classifyError(error: unknown, prefix: string) {
|
|
34
31
|
if (error instanceof NetworkAccessDeniedError) {
|
|
35
32
|
return createErrorResponse(error, `${prefix} [Network Access Denied]`);
|
|
@@ -46,18 +43,12 @@ function classifyError(error: unknown, prefix: string) {
|
|
|
46
43
|
return createErrorResponse(error, prefix);
|
|
47
44
|
}
|
|
48
45
|
|
|
49
|
-
/**
|
|
50
|
-
* Register Vercel Sandbox compatible tools with the MCP server
|
|
51
|
-
*/
|
|
52
46
|
export function registerSandboxTools(server: McpServer): void {
|
|
53
|
-
// ========================================================================
|
|
54
|
-
// bash_sandbox_run - Run command in sandbox
|
|
55
|
-
// ========================================================================
|
|
56
47
|
server.registerTool(
|
|
57
48
|
"bash_sandbox_run",
|
|
58
49
|
{
|
|
59
50
|
description:
|
|
60
|
-
"Run a command in a
|
|
51
|
+
"Run a command in a persistent isolated environment with optional structured output and logs.",
|
|
61
52
|
inputSchema: {
|
|
62
53
|
command: z.string().describe("The command to execute"),
|
|
63
54
|
cwd: z.string().optional().describe("Working directory for the command"),
|
|
@@ -122,13 +113,10 @@ export function registerSandboxTools(server: McpServer): void {
|
|
|
122
113
|
},
|
|
123
114
|
);
|
|
124
115
|
|
|
125
|
-
// ========================================================================
|
|
126
|
-
// bash_sandbox_domain - Get sandbox domain
|
|
127
|
-
// ========================================================================
|
|
128
116
|
server.registerTool(
|
|
129
117
|
"bash_sandbox_domain",
|
|
130
118
|
{
|
|
131
|
-
description: "Get the current sandbox domain
|
|
119
|
+
description: "Get the current sandbox domain or identifier.",
|
|
132
120
|
inputSchema: {},
|
|
133
121
|
},
|
|
134
122
|
async () => {
|
|
@@ -141,13 +129,10 @@ export function registerSandboxTools(server: McpServer): void {
|
|
|
141
129
|
},
|
|
142
130
|
);
|
|
143
131
|
|
|
144
|
-
// ========================================================================
|
|
145
|
-
// bash_sandbox_write_files - Write multiple files
|
|
146
|
-
// ========================================================================
|
|
147
132
|
server.registerTool(
|
|
148
133
|
"bash_sandbox_write_files",
|
|
149
134
|
{
|
|
150
|
-
description: "Write multiple files to the
|
|
135
|
+
description: "Write multiple files to the persistent isolated environment at once.",
|
|
151
136
|
inputSchema: {
|
|
152
137
|
files: z.record(z.string(), z.string()).describe("Files to write (path -> content)"),
|
|
153
138
|
},
|
|
@@ -166,13 +151,10 @@ export function registerSandboxTools(server: McpServer): void {
|
|
|
166
151
|
},
|
|
167
152
|
);
|
|
168
153
|
|
|
169
|
-
// ========================================================================
|
|
170
|
-
// bash_sandbox_read_file - Read file from sandbox
|
|
171
|
-
// ========================================================================
|
|
172
154
|
server.registerTool(
|
|
173
155
|
"bash_sandbox_read_file",
|
|
174
156
|
{
|
|
175
|
-
description: "Read a file from the
|
|
157
|
+
description: "Read a file from the persistent isolated environment.",
|
|
176
158
|
inputSchema: {
|
|
177
159
|
path: z.string().describe("The file path to read"),
|
|
178
160
|
encoding: z.enum(["utf-8", "base64"]).optional().describe("File encoding (default: utf-8)"),
|
|
@@ -197,13 +179,10 @@ export function registerSandboxTools(server: McpServer): void {
|
|
|
197
179
|
},
|
|
198
180
|
);
|
|
199
181
|
|
|
200
|
-
// ========================================================================
|
|
201
|
-
// bash_sandbox_mkdir - Create directory in sandbox
|
|
202
|
-
// ========================================================================
|
|
203
182
|
server.registerTool(
|
|
204
183
|
"bash_sandbox_mkdir",
|
|
205
184
|
{
|
|
206
|
-
description: "Create a directory in the
|
|
185
|
+
description: "Create a directory in the persistent isolated environment.",
|
|
207
186
|
inputSchema: {
|
|
208
187
|
path: z.string().describe("The directory path to create"),
|
|
209
188
|
recursive: z
|
|
@@ -224,14 +203,11 @@ export function registerSandboxTools(server: McpServer): void {
|
|
|
224
203
|
},
|
|
225
204
|
);
|
|
226
205
|
|
|
227
|
-
// ========================================================================
|
|
228
|
-
// bash_sandbox_stop - Stop and clean up sandbox
|
|
229
|
-
// ========================================================================
|
|
230
206
|
server.registerTool(
|
|
231
207
|
"bash_sandbox_stop",
|
|
232
208
|
{
|
|
233
209
|
description:
|
|
234
|
-
"Stop and clean up the
|
|
210
|
+
"Stop and clean up the persistent isolated environment, releasing all resources. Use bash_sandbox_reset to just clear state.",
|
|
235
211
|
inputSchema: {},
|
|
236
212
|
},
|
|
237
213
|
async () => {
|
|
@@ -244,13 +220,10 @@ export function registerSandboxTools(server: McpServer): void {
|
|
|
244
220
|
},
|
|
245
221
|
);
|
|
246
222
|
|
|
247
|
-
// ========================================================================
|
|
248
|
-
// bash_sandbox_reset - Reset sandbox
|
|
249
|
-
// ========================================================================
|
|
250
223
|
server.registerTool(
|
|
251
224
|
"bash_sandbox_reset",
|
|
252
225
|
{
|
|
253
|
-
description: "Reset the
|
|
226
|
+
description: "Reset the persistent isolated environment, clearing all files and state.",
|
|
254
227
|
inputSchema: {},
|
|
255
228
|
},
|
|
256
229
|
async () => {
|