Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
--cwdNoWorking directory for new sessions. Defaults to where the server was started. Example: `npx -y terminal-use --cwd /path/to/project`
--colsNoTerminal width (columns) for new sessions. Default is 120. Example: `npx -y terminal-use --cols 100`
--rowsNoTerminal height (rows) for new sessions. Default is 30. Example: `npx -y terminal-use --rows 40`
--loginNoStart shells as login shells, so your shell profile files (~/.zprofile, ~/.bash_profile, ~/.profile) are read and your PATH is set up. Off by default. Has no effect in PowerShell or cmd.exe.
--shellNoShell to run in new sessions. Defaults to `$SHELL` or `/bin/bash`; PowerShell on Windows. Example: `npx -y terminal-use --shell /bin/zsh`
--scrollbackNoLines of history kept. Default is 5000. Example: `npx -y terminal-use --scrollback 10000`

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}
resources
{
  "listChanged": true
}
extensions
{
  "io.modelcontextprotocol/skills": {}
}

Tools

Functions exposed to the LLM to take actions

NameDescription
terminal_batchA

Send a sequence of inputs in one call and get the screen back once at the end — for driving a full-screen program without a round trip per keystroke (open a menu, move down three, press Enter, type a name, confirm). Actions run in order, each given a moment to take effect before the next.

Each action is an object with a type and the fields that type uses:

  • type: text — typed as keystrokes; \n presses Enter.

  • paste: text — delivered as one bracketed paste where the program supports it.

  • press: key, optional count — same key specs as terminal_press.

  • click: col, row — left click, sent immediately with no preview; needs the program to track the mouse.

  • scroll: direction, optional amount, col, row — as terminal_scroll.

  • wait: ms for a fixed pause, or pattern (optional timeoutMs) to continue once a regex matches the screen.

The batch is validated before anything is sent. It stops at the first action that fails (a pattern that never appears, a click the program cannot receive, the process exiting) and reports how far it got, with the screen as it stands. Use it when you already know the steps; when you need to look between steps, use the individual tools.

terminal_clickA

Deliver a left mouse-button click at a cell in the terminal. Only works when the program currently in the foreground has opted into mouse tracking (vim with set mouse=a, fzf, lazygit, less with mouse mode, etc.) — at a plain shell prompt mouse mode is off and the click would just print escape sequences as text, so we refuse the actual click in that case.

Coordinates are 1-indexed and refer to the live screen viewport: col 1, row 1 is the top-left cell, and the bottom-right cell is (terminal width, terminal height) which you can see via terminal_read's state header.

PREVIEW MODE (default preview: true): does NOT click. Returns a PNG with a bright magenta ring + dot drawn around the target cell so you can verify your coordinates. Always do this first when you are not 100% sure where the click should land — TUIs often have destructive actions one click away (delete branch, kill process, etc.).

EXECUTE MODE (preview: false): actually sends the mouse press+release sequence and settles for output. Use this only after you've previewed and confirmed, or when you're confident.

CAVEATS: idleMs and maxWaitMs are ignored in preview mode (preview doesn't settle). When the target cell is near the right edge of the viewport, the coordinate label drawn next to the magenta ring may be clipped — the ring itself is always within frame, so trust it over the label.

terminal_createA

Spawn a new terminal session and return its sessionId. You must call this before any per-session tool — there is no shared default session. By default the session is an interactive shell. Pass command to run one program in the terminal instead (a TUI, a test run, a CLI under test): the session then lasts as long as that program, reports its exit status when it ends, and keeps its final screen readable until you destroy it. If the server already holds 50 live sessions, the least-recently-used one is evicted to make room (its sessionId is tombstoned and any later call against it will respawn with an 'evicted' notice).

terminal_destroyA

Kill a session and forget the sessionId entirely. The shell process is terminated and the sessionId is not tombstoned — future calls against it will error with "Unknown sessionId". Use this when you're explicitly done with a session. Tombstones (which auto-respawn on next access) only happen for system-driven terminations: idle-kill, eviction, or shell exit.

terminal_listA

List every active session and every tombstoned (recently-killed but reserved) sessionId. Tombstones are reservations: the shell is gone but the sessionId can still be called against — doing so respawns a fresh shell under the same id and surfaces the original termination reason (shell-exit, idle-killed, or evicted). Tombstones expire after 30 days; after that the id is gone.

terminal_pressB

Press a single named key or key combination. Examples of supported key values: Enter, Tab, Escape, Backspace, Space, ArrowUp / ArrowDown / ArrowLeft / ArrowRight, Home, End, PageUp, PageDown, Delete, Insert, F1..F12, Ctrl+C, Ctrl+D, Ctrl+L, Ctrl+A..Ctrl+Z, Shift+Tab, Alt+B, Ctrl+ArrowLeft, Ctrl+Shift+ArrowRight, etc. Same settle behavior as terminal_type.

terminal_readA

Read a window of the terminal buffer. The buffer is the full xterm-emulated state (scrollback + visible viewport) in one contiguous index space. The window is paged from the bottom upward in multiples of rows. rows defaults to the current screen height and is capped at 1000. page: 0 is the most recent screen-sized chunk; page: 1 is the screen before that, and so on. Trailing blank rows are trimmed implicitly.

terminal_resetA

Wipe the terminal buffer and scrollback. By default the shell process keeps running (env vars, cwd, history all preserved). Pass hardReset: true to kill the current shell and spawn a brand-new one — anything mid-execution gets killed. When hardReset: true, you can also override cols, rows, shell, and cwd. In a session created with command, a hard reset runs that command again.

terminal_resizeA

Change the terminal size. Both cols and rows are optional; omitting one preserves the current value. Resizes both the PTY and the emulator (so programs running inside see the change via SIGWINCH).

terminal_screenshotA

Render a screen-sized window of the terminal to a PNG. Height is always the current screen height (term.rows); use page to walk back through scrollback in screen-sized increments at the same dimensions as the live screen. If filePath is set, the PNG is written there and the path is returned. Large images (>2097152 bytes) are also spilled to a temp file automatically.

terminal_scrollA

Turn the mouse wheel over a cell of a full-screen program: scroll a pager, a file list, a log pane. Behaves as a terminal emulator does — programs that track the mouse receive wheel events at that cell (so the pane under it scrolls); full-screen programs that do not (less, man) receive arrow keys instead. At a plain shell prompt there is nothing to scroll and the call fails: earlier output is read with terminal_read and its page argument, not by scrolling.

terminal_typeA

Type literal characters into the terminal as if a human were pressing keys. Embedded \n is normalized to \r so "git push\n" actually submits. Always waits for the buffer to settle (or to time out) before returning. The wait is capped at 10s; for anything slower (builds, installs, test runs) follow up with terminal_wait, which blocks until the command actually finishes.

terminal_waitA

Block until the terminal reaches a state, instead of guessing with sleeps or polling terminal_read. Use it after terminal_type for anything that outlives the settle window: builds, installs, test runs, servers starting up.

DEFAULT (no pattern): waits for the running command to finish — i.e. for the shell to take the terminal's foreground back and its prompt to go quiet. This asks the kernel who owns the terminal, so it works with any prompt and stays correct while a command is silent (sleep 60) or chatty. Returns immediately if the shell is already at its prompt. On Windows this cannot be detected in a shell session: the call waits for a stretch of silence instead and says so — prefer pattern there. In a session created with command, it waits for that command to exit and reports its exit status. Background jobs (cmd &) do not count as running, and inside a nested program (ssh, a REPL, a TUI) the outer shell never regains the foreground until that program exits — use pattern there.

until: "quiet": waits until nothing has been printed for quietMs (default 1000), whatever owns the terminal. This is the same "settled" rule terminal_type uses, without its 10s cap — for nested programs where completion cannot be detected and no pattern fits.

WITH pattern: waits until the regex matches the text on screen (the viewport plus the 200 rows above it). Use this for servers that never exit ("Listening on"), REPL prompts, or TUI states. Text that is already on screen counts, so pick a pattern that only the new output can satisfy.

Returns the screen when the condition is met, or when timeoutMs runs out (not an error — the response says the command is still running). In a shell session this does not report an exit status; run echo $? afterwards if you need it.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription
terminal-useDrive interactive terminal programs through the terminal-use MCP tools (terminal_create, terminal_type, terminal_press, terminal_batch, terminal_wait, terminal_read, terminal_screenshot). Use when a task needs a real terminal rather than a one-shot shell command - full-screen or interactive programs (vim, less, htop, fzf, lazygit, REPLs, debuggers, installers, ssh, git rebase -i), testing a CLI or TUI end to end, or long-running commands and dev servers that have to be watched.
terminal-use/references/keys.mdSupporting file of the "terminal-use" skill.
terminal-use/references/recipes.mdSupporting file of the "terminal-use" skill.
terminal-use/references/troubleshooting.mdSupporting file of the "terminal-use" skill.

TDQS

A4.1/5.0

Scored across 13 tools

Disambiguation4/5

Each tool has a clearly distinct purpose: session lifecycle (create/destroy/list/reset/resize), input (type/press/click/scroll/batch), output (read/screenshot), and synchronization (wait). The main overlap is terminal_batch, which can perform everything type/press/click/scroll do, but descriptions explicitly steer the agent (batch for known sequences, individual tools when you need to look between steps), so confusion is limited.

Naming Consistency5/5

Every tool follows the same terminal_<verb> snake_case pattern (terminal_create, terminal_read, terminal_wait, etc.), with no deviations in case or verb style. The naming is entirely predictable.

Tool Count5/5

13 tools is comfortably within the ideal 3-15 range for a terminal automation server. Each tool maps to a genuine, non-redundant capability (session management, multiple input modalities, output capture, and blocking waits).

Completeness4/5

The surface covers the full session lifecycle (create/destroy/list/reset/resize) plus input, output, and synchronization primitives, which is close to complete for driving a terminal. Minor gaps remain, such as no standalone paste tool outside batch and no explicit signal/interrupt tool beyond terminal_press Ctrl+C.

Maintenance

ActivityMaintained
ResponsivenessUnresponsive