mcp-bash
v3.48.10FLUJO's standalone cross-platform shell MCP server
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
shell_info
Describe this machine before running anything: platform, the effective "default" shell and absolute path, resolved paths for pwsh/powershell/bash/cmd/sh, and common interpreters. Explicit Bash execution uses the reported Git Bash path; call this instead of invoking a bare "bash" from PowerShell.
open_terminal
Open a real interactive pseudoterminal (PTY/ConPTY) and display its MCP App. Returns an owner-scoped terminal sessionId.
| Parameter | Type | Description |
|---|---|---|
cols | number | Initial terminal columns (20-400, default 100). |
cwd | string | Working directory. Defaults to the chat project folder (else the FLUJO data directory), which relative paths also resolve from; configured roots still apply. |
detached | boolean | Keep the terminal alive after the run that opened it finishes (default false). Still bounded by the host session cap and the absolute max lifetime. |
env | object | Environment variables to add or override for this command. |
rows | number | Initial terminal rows (5-200, default 30). |
shell | string | Command parser. "default" uses PowerShell on Windows and /bin/sh elsewhere. Explicit "bash" launches FLUJO's absolute resolved Git Bash path on Windows (WSL relay launchers are rejected). Explicit "pw… |
terminal_read
Read incremental ANSI/VT output from an owner-scoped interactive terminal session.
| Parameter | Type | Description |
|---|---|---|
sessionId * | string | |
cursor | number | Output cursor returned by the previous read. |
terminal_write
Write raw keyboard or pasted input to an owner-scoped interactive terminal PTY.
| Parameter | Type | Description |
|---|---|---|
data * | string | |
sessionId * | string |
terminal_resize
Resize an owner-scoped interactive terminal PTY.
| Parameter | Type | Description |
|---|---|---|
cols * | number | |
rows * | number | |
sessionId * | string |
terminal_close
Close an owner-scoped interactive terminal PTY.
| Parameter | Type | Description |
|---|---|---|
sessionId * | string |
terminal_list
List interactive terminal PTY sessions owned by this MCP App scope.
run
Run one command to completion. "output" is stdout and stderr MERGED (no 2>&1 needed) and "isError" reflects the process exit code only — text on stderr is not a failure. On an unknown machine call "shell_info" first; prefer shell:"bash" for POSIX syntax (&&, pipes into head/grep). Results include the absolute shellPath used. PowerShell programs use BOM-free encoded transport and invariant culture. Use start/status for a persistent background session.
| Parameter | Type | Description |
|---|---|---|
command * | string | Command text in the selected shell's syntax. |
cwd | string | Working directory. Defaults to the chat project folder (else the FLUJO data directory), which relative paths also resolve from; configured roots still apply. |
encoding | string | How to decode child output. "auto" (default) detects UTF-16LE (BOM or NUL-heavy) and otherwise uses UTF-8. |
env | object | Environment variables to add or override for this command. |
maxOutputChars | number | Cap the returned output (default and hard maximum 100000 characters). When exceeded, the head and tail are kept and the omitted middle is reported. |
normalizeNewlines | boolean | If true, CRLF/CR in the captured output are normalized to LF. |
outputFile | string | Spool the full merged output to this file (confined to the configured roots) while the result stays bounded. |
shell | string | Command parser. "default" uses PowerShell on Windows and /bin/sh elsewhere. Explicit "bash" launches FLUJO's absolute resolved Git Bash path on Windows (WSL relay launchers are rejected). Explicit "pw… |
timeout | number | Bash-side timeout in seconds (default 60; -1 disables it; positive values are capped at 12 hours by default). While running, output and 10-second liveness heartbeats are sent as MCP progress. On timeo… |
start
Start an independent background command and return its sessionId plus the effective shell and absolute shellPath. Output is stdout and stderr merged, decoded as UTF-8. Multiple sessions may run in parallel; use status/wait, write_stdin, or kill.
| Parameter | Type | Description |
|---|---|---|
command * | string | The command line to execute in the background. |
cwd | string | Working directory. Defaults to the chat project folder (else the FLUJO data directory), which relative paths also resolve from; configured roots still apply. |
detached | boolean | Survive the end of the run that started it (default false). Detached sessions are still bounded by the host session cap and the absolute max lifetime, and are always killed when the bash server shuts… |
encoding | string | How to decode child output. "auto" (default) detects UTF-16LE (BOM or NUL-heavy) and otherwise uses UTF-8. |
env | object | Environment variables to add or override for this command. |
maxOutputChars | number | Cap the returned output (default and hard maximum 100000 characters). When exceeded, the head and tail are kept and the omitted middle is reported. |
outputFile | string | Spool the full merged output to this file (confined to the configured roots) while the result stays bounded. |
shell | string | Command parser. "default" uses PowerShell on Windows and /bin/sh elsewhere. Explicit "bash" launches FLUJO's absolute resolved Git Bash path on Windows (WSL relay launchers are rejected). Explicit "pw… |
status
Return the current state of a background session: { sessionId, running, exitCode, output, truncated }.
| Parameter | Type | Description |
|---|---|---|
sessionId * | string | The id returned by start. |
wait
Wait until a background session completes or the maximum timeout elapses, sending new output as live progress when supported. The timeout does not kill the session. A finite wait that completes early reports the remaining duration and points to sleep for fixed delays.
| Parameter | Type | Description |
|---|---|---|
sessionId * | string | The id returned by start. |
output | string | Output returned in the result: "delta" includes only output since the previous wait result, "full" includes all retained output (default), and "none" omits the output field. Every wait advances the de… |
timeout | number | Max seconds to wait (default 60; -1 waits until completion or cancellation; positive values are capped at 12 hours by default). |
sleep
Wait for a fixed duration independent of background-session state. Use this instead of wait when the full delay must elapse even if a command finishes early.
| Parameter | Type | Description |
|---|---|---|
seconds * | number | Fixed positive number of seconds to sleep. Values above the configured Bash timeout ceiling are rejected rather than shortened. |
write_stdin
Write UTF-8 text to a running background session's stdin. Pass "newline": false to omit the trailing newline. Leading-BOM stripping is opt-in; raw input is preserved by default. Returns { sessionId, written }.
| Parameter | Type | Description |
|---|---|---|
data * | string | Text to encode as UTF-8 and write to stdin. |
sessionId * | string | The id returned by start. |
bomPolicy | string | Leading UTF-8 BOM policy. "preserve" is the default; "strip-leading" removes exactly one initial U+FEFF from this write. |
newline | boolean | Append a trailing newline (default true). |
kill
Kill a background session (and its whole process tree). Returns { sessionId, killed }.
| Parameter | Type | Description |
|---|---|---|
sessionId * | string | The id returned by start. |
list_sessions
List background sessions owned by this caller scope. Returns { sessions: [{ sessionId, command, running, exitCode, detached, startedAt, endedAt }] }.
release_owner
Kill and forget every non-detached background and terminal session owned by this caller scope. Idempotent. Sessions started with "detached": true are retained. FLUJO calls this when a run finishes; the scope is host-derived, so a caller can only release its own sessions. Returns { ownerScope, killedSessions, closedTerminals, retainedDetached }.