just-bash-mcp 2.9.5 → 3.0.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 +33 -7
- package/package.json +3 -2
- package/src/config/index.ts +346 -326
- package/src/index.ts +8 -12
- package/src/tools/bash-instance.ts +66 -131
- package/src/tools/exec-tools.ts +92 -139
- package/src/tools/file-tools.ts +89 -182
- package/src/tools/index.ts +19 -27
- package/src/tools/info-tools.ts +103 -135
- package/src/tools/sandbox-tools.ts +114 -209
- package/src/types.ts +1 -1
- package/src/utils/index.ts +20 -55
package/README.md
CHANGED
|
@@ -7,11 +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)
|
|
10
|
+
Built on top of [`just-bash`](https://github.com/vercel-labs/just-bash) v3.0.1.
|
|
11
11
|
|
|
12
|
-
## What's New in
|
|
12
|
+
## What's New in v3.0.0
|
|
13
13
|
|
|
14
|
-
- **Synced with upstream `just-bash`
|
|
14
|
+
- **Synced with upstream `just-bash` v3.0.1** - Full upstream commands, APIs, and type exports
|
|
15
|
+
- **Byte-safe stdin handling** - Tracks the upstream v3 TypeScript-enforced stdin byte/UTF-8 model
|
|
16
|
+
- **Executor integration plumbing** - Includes upstream support for `js-exec` tool invocation hooks and executor package integration
|
|
17
|
+
- **ESM runtime fix** - Includes the upstream v3.0.1 dynamic `require("tty")`/`file` command crash fix
|
|
15
18
|
- **Persistent sandbox tools** - `bash_sandbox_*` tools remain available for higher-level isolated workflows
|
|
16
19
|
- **Defense-in-depth mode** - Opt-in monkey-patching of dangerous JS globals (`JUST_BASH_DEFENSE_IN_DEPTH=true`)
|
|
17
20
|
- **Python support** - Python3 via the upstream emscripten CPython runtime (`JUST_BASH_ENABLE_PYTHON=true`)
|
|
@@ -30,8 +33,16 @@ Built on top of [`just-bash`](https://github.com/vercel-labs/just-bash) v2.12.5.
|
|
|
30
33
|
|
|
31
34
|
## Synced Upstream Features
|
|
32
35
|
|
|
33
|
-
The current wrapper release tracks `just-bash` `
|
|
36
|
+
The current wrapper release tracks `just-bash` `v3.0.1`, which brings in the post-`v2.12.5` upstream feature set, including:
|
|
34
37
|
|
|
38
|
+
- Breaking v3 stdin byte/UTF-8 handling updates for custom commands
|
|
39
|
+
- Executor and `js-exec` integration plumbing
|
|
40
|
+
- ESM Node bundle dynamic-require fix for commands that load `tty` transitively
|
|
41
|
+
- `jq` control-character handling inside JSON strings
|
|
42
|
+
- Faster `grep` pattern matching via matcher reuse and literal pre-filtering
|
|
43
|
+
- AWK lexer fixes for POSIX multi-line statement continuation
|
|
44
|
+
- Bug fixes across network, sqlite3, xan, rg, terminal rendering, and CI
|
|
45
|
+
- Workspace/Changesets migration with unchanged public import paths and bin entries
|
|
35
46
|
- Defense-in-depth hardening across the runtime and filesystem layers
|
|
36
47
|
- Defense-in-depth enabled by default upstream, plus additional hardening passes
|
|
37
48
|
- Filesystem hardening for overlays, external filesystems, symlinks, and broken symlink handling
|
|
@@ -42,7 +53,7 @@ The current wrapper release tracks `just-bash` `v2.12.5`, which brings in the po
|
|
|
42
53
|
- UTF-8 handling and write-path fixes
|
|
43
54
|
- CommonJS compatibility improvements upstream
|
|
44
55
|
- `ls -F` / `--classify` support
|
|
45
|
-
- Additional cleanup and internal hardening work shipped through `
|
|
56
|
+
- Additional cleanup and internal hardening work shipped through `v3.0.1`
|
|
46
57
|
|
|
47
58
|
## Installation
|
|
48
59
|
|
|
@@ -138,6 +149,8 @@ Add to your MCP settings:
|
|
|
138
149
|
| `JUST_BASH_MAX_COMMAND_COUNT` | Maximum total commands per execution | `10000` |
|
|
139
150
|
| `JUST_BASH_MAX_LOOP_ITERATIONS` | Maximum iterations per loop | `10000` |
|
|
140
151
|
| `JUST_BASH_ENABLE_PYTHON` | Enable Python3 via emscripten CPython (`true`/`false`) | `false` |
|
|
152
|
+
| `JUST_BASH_ENABLE_JAVASCRIPT` | Enable upstream `js-exec` via QuickJS (`true`/`false`) | `false` |
|
|
153
|
+
| `JUST_BASH_JAVASCRIPT_BOOTSTRAP` | Bootstrap JavaScript code before each `js-exec` invocation | - |
|
|
141
154
|
| `JUST_BASH_DEFENSE_IN_DEPTH` | Enable defense-in-depth mode (`true`/`false`) | `false` |
|
|
142
155
|
| `JUST_BASH_DEFENSE_IN_DEPTH_AUDIT` | Audit mode: log violations but don't block | `false` |
|
|
143
156
|
| `JUST_BASH_DEFENSE_IN_DEPTH_LOG` | Log violations to console | `false` |
|
|
@@ -150,6 +163,19 @@ Add to your MCP settings:
|
|
|
150
163
|
|
|
151
164
|
## Tools
|
|
152
165
|
|
|
166
|
+
### `bash`
|
|
167
|
+
|
|
168
|
+
Execute bash commands in the sandbox environment. This is the upstream-compatible MCP exposure of the `just-bash`/`bash-tool` execute interface and accepts the same single `command` argument.
|
|
169
|
+
|
|
170
|
+
```json
|
|
171
|
+
{
|
|
172
|
+
"name": "bash",
|
|
173
|
+
"arguments": {
|
|
174
|
+
"command": "ls -la && cat package.json | head -5"
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
153
179
|
### `bash_exec`
|
|
154
180
|
|
|
155
181
|
Execute a bash command in a sandboxed environment. Each execution is isolated.
|
|
@@ -209,7 +235,7 @@ Persistent isolated-environment helpers:
|
|
|
209
235
|
`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`
|
|
210
236
|
|
|
211
237
|
### Data Processing
|
|
212
|
-
`jq` (JSON), `sqlite3` (SQLite), `xan` (CSV), `yq` (YAML/XML/TOML)
|
|
238
|
+
`jq` (JSON), `js-exec` (JavaScript/TypeScript via QuickJS when enabled), `sqlite3` (SQLite), `xan` (CSV), `yq` (YAML/XML/TOML)
|
|
213
239
|
|
|
214
240
|
### Compression & Archives
|
|
215
241
|
`gzip` (+ `gunzip`, `zcat`), `tar`
|
|
@@ -288,7 +314,7 @@ Persistent isolated-environment helpers:
|
|
|
288
314
|
|
|
289
315
|
## Upstream API Coverage
|
|
290
316
|
|
|
291
|
-
This wrapper integrates the full public API surface of `just-bash`
|
|
317
|
+
This wrapper integrates the full public API surface of `just-bash` v3.0.1:
|
|
292
318
|
|
|
293
319
|
| Category | Exports Used |
|
|
294
320
|
|----------|-------------|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "just-bash-mcp",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "MCP server providing a sandboxed bash environment using just-bash",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"scripts": {
|
|
22
22
|
"start": "node src/index.ts",
|
|
23
23
|
"dev": "node --watch src/index.ts",
|
|
24
|
+
"bench:stdio": "bash ./bench/hyperfine-stdin-vs-bash.sh",
|
|
24
25
|
"lint": "oxlint --type-aware",
|
|
25
26
|
"lint:fix": "oxlint --type-aware --fix",
|
|
26
27
|
"typecheck": "oxlint --type-aware --type-check",
|
|
@@ -60,7 +61,7 @@
|
|
|
60
61
|
"packageManager": "bun@1.3.8",
|
|
61
62
|
"dependencies": {
|
|
62
63
|
"@modelcontextprotocol/sdk": "^1.27.0",
|
|
63
|
-
"just-bash": "^
|
|
64
|
+
"just-bash": "^3.0.1",
|
|
64
65
|
"zod": "^4.3.6"
|
|
65
66
|
},
|
|
66
67
|
"devDependencies": {
|