mcp-bash

v3.48.10
@mario.andreschak/mcp-bash Checked 3 hours ago Published 10 days ago

FLUJO'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.

ParameterTypeDescription
colsnumberInitial terminal columns (20-400, default 100).
cwdstringWorking directory. Defaults to the chat project folder (else the FLUJO data directory), which relative paths also resolve from; configured roots still apply.
detachedbooleanKeep the terminal alive after the run that opened it finishes (default false). Still bounded by the host session cap and the absolute max lifetime.
envobjectEnvironment variables to add or override for this command.
rowsnumberInitial terminal rows (5-200, default 30).
shellstringCommand 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.

ParameterTypeDescription
sessionId *string
cursornumberOutput cursor returned by the previous read.

terminal_write

Write raw keyboard or pasted input to an owner-scoped interactive terminal PTY.

ParameterTypeDescription
data *string
sessionId *string

terminal_resize

Resize an owner-scoped interactive terminal PTY.

ParameterTypeDescription
cols *number
rows *number
sessionId *string

terminal_close

Close an owner-scoped interactive terminal PTY.

ParameterTypeDescription
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.

ParameterTypeDescription
command *stringCommand text in the selected shell's syntax.
cwdstringWorking directory. Defaults to the chat project folder (else the FLUJO data directory), which relative paths also resolve from; configured roots still apply.
encodingstringHow to decode child output. "auto" (default) detects UTF-16LE (BOM or NUL-heavy) and otherwise uses UTF-8.
envobjectEnvironment variables to add or override for this command.
maxOutputCharsnumberCap the returned output (default and hard maximum 100000 characters). When exceeded, the head and tail are kept and the omitted middle is reported.
normalizeNewlinesbooleanIf true, CRLF/CR in the captured output are normalized to LF.
outputFilestringSpool the full merged output to this file (confined to the configured roots) while the result stays bounded.
shellstringCommand 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…
timeoutnumberBash-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.

ParameterTypeDescription
command *stringThe command line to execute in the background.
cwdstringWorking directory. Defaults to the chat project folder (else the FLUJO data directory), which relative paths also resolve from; configured roots still apply.
detachedbooleanSurvive 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…
encodingstringHow to decode child output. "auto" (default) detects UTF-16LE (BOM or NUL-heavy) and otherwise uses UTF-8.
envobjectEnvironment variables to add or override for this command.
maxOutputCharsnumberCap the returned output (default and hard maximum 100000 characters). When exceeded, the head and tail are kept and the omitted middle is reported.
outputFilestringSpool the full merged output to this file (confined to the configured roots) while the result stays bounded.
shellstringCommand 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 }.

ParameterTypeDescription
sessionId *stringThe 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.

ParameterTypeDescription
sessionId *stringThe id returned by start.
outputstringOutput 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…
timeoutnumberMax 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.

ParameterTypeDescription
seconds *numberFixed 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 }.

ParameterTypeDescription
data *stringText to encode as UTF-8 and write to stdin.
sessionId *stringThe id returned by start.
bomPolicystringLeading UTF-8 BOM policy. "preserve" is the default; "strip-leading" removes exactly one initial U+FEFF from this write.
newlinebooleanAppend a trailing newline (default true).

kill

Kill a background session (and its whole process tree). Returns { sessionId, killed }.

ParameterTypeDescription
sessionId *stringThe 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 }.