terminal_run
Runs a command in an existing shell, or creates a terminal for it. Without session, a foreground run is ephemeral.
commandRequired shell commandsessionOptional existing terminal; omit to create oneshellCreation shell; bash by default, also zsh, fish, shcwd, envWorking directory and environment for a new terminalstdinData piped into a subshell that runs the commandtimeoutForeground wait in seconds, default 120backgroundDefault false; true leaves the terminal for observationmaxOutputBytesInline preview budget; by default a short head and tailcommandsessionshellbash by default, also zsh, fish, shcwd, envstdintimeoutbackgroundmaxOutputBytesForeground results include runId, session, exitCode, output, duration, timedOut and ephemeral. An ephemeral capture can be read back with terminal_read in run_output mode while the service still keeps it.
terminal_open
Creates a terminal, changes one you own, or attaches an eligible detached persistent terminal.
sessionChange your own terminal first; otherwise try detached attachment by identifierattachWith tags and no identifier, request attachment by tagname, groupName on creation or change; group on creationsizeColumns and rows, default 80 by 24shell, command, cwd, envCreation shell, initial command, directory and environmenttagsTags on creation, added tags on change, or search keys for attachmentpersistentDefault false; set on creationwebTrue exposes or rotates the browser token; false removes itsessionattachtags and no identifier, request attachment by tagname, groupsizeshell, command, cwd, envtagspersistentwebThe response reports action (created, mutated or attached) and the terminal session. Read the screen to see when the program is ready.
terminal_send and terminal_read
terminal_send takes session or group, text, enter, ordered named keys, the ctrl, alt and shift modifiers, and an optional await of stable, prompt, pattern or none. It reports input delivery; read the screen for the application's response.
terminal_read supports these modes:
screenThe current view (default)tailThe bottom rows of the viewincrementalFinalized lines after the shared cursorscrollbackRetained history, by line count or ordered rangeregionA rectangle of the current screenframesRetained screen-change frames, after enabling a frame watchrun_outputA stored foreground capture, by runIdscreentailincrementalscrollbackregionframesrun_outputrunIdOutput formats are text, ansi and lines.
terminal_watch, terminal_stats, terminal_list, terminal_close
- terminal_watch selects one output mode (
frame,idleor incremental output) and optionally aresourcewatcher with CPU and memory thresholds.off: truecancels both. - terminal_stats returns process-tree samples for a
sessionorgroup;detail: trueadds the top processes, whose arguments can contain private data. CPU is normalized to total machine capacity. - terminal_list lists terminals visible to this session, filtered by
session,group,stateortags;detailadds working directory and execution history. - terminal_close selects
session,grouporall: true;forceorsignalchoose forceful removal, anddetach: truehands a single terminal off.
Installation settings
MCP_CONSOLE_MAX_TERMINALS50Terminal admission check per client sessionMCP_CONSOLE_MAX_ATTACHED_IDLE3600 secondsIdle threshold for attached terminalsMCP_CONSOLE_MAX_DETACH_DURATION86400 secondsExpiry threshold for detached persistent terminalsMCP_CONSOLE_RESOURCE_INTERVAL_MS2000Default resource watch intervalMCP_CONSOLE_RESOURCE_DEFAULT_SUSTAINED_MS15000How long a threshold breach lasts before an alertMCP_CONSOLE_WEBOffEnables the browser bridgeMCP_CONSOLE_WEB_ADDRDerived address, port 7680Bind and advertised address for the bridgeMCP_CONSOLE_WEB_MAX_CONN4Concurrent browser connections per terminalMCP_CONSOLE_MAX_TERMINALSMCP_CONSOLE_MAX_ATTACHED_IDLEMCP_CONSOLE_MAX_DETACH_DURATIONMCP_CONSOLE_RESOURCE_INTERVAL_MSMCP_CONSOLE_RESOURCE_DEFAULT_SUSTAINED_MSMCP_CONSOLE_WEBMCP_CONSOLE_WEB_ADDRMCP_CONSOLE_WEB_MAX_CONNCoordinate changes with the installation owner.