Skip to main content
Glama
hugo94z

mcp-interactive-terminal

by hugo94z

mcp-interactive-terminal

CI License: MIT Python 3.10+

A Model Context Protocol server that gives AI agents a real interactive terminal on Windows: launch PowerShell, PowerShell 7 or CMD, type into it, read what happens, answer prompts, interrupt processes and resize the window — across multiple sessions that stay alive between tool calls.

Most "terminal" tools for LLMs run a command and return its output. That is not a terminal. Anything that asks a question, shows a menu, draws a progress bar or waits for a keypress is out of reach. This server runs the shell inside a ConPTY (Windows pseudo-console), so the agent talks to a genuine terminal session, exactly like a human.

agent ── MCP (stdio) ──> session manager ── ConPTY ──> powershell.exe / pwsh.exe / cmd.exe
                             │
                             ├─ raw output ring buffer (cursor based reads)
                             └─ VT emulator (rendered screen, like a human sees it)

Features

  • Real PTY sessions — ConPTY under the hood, not pipes. Prompts, TUIs, colors and interactive programs work.

  • Live interaction — send text and named keys (enter, tab, ctrl-c, up, f1…), read incrementally.

  • Rendered screen — an internal VT100 emulator turns cursor movements and repaints into clean, readable text.

  • Blocking waits — wait for a regex, for output to go quiet, for the process to exit, or for a timeout. No polling.

  • Multiple sessions — independent shells running in parallel, each with its own buffer, screen and size.

  • One-shot shortcut — terminal_exec for commands that only need output and an exit code.

  • UTF-8 everywhere — accents and non-ASCII output are handled for PowerShell and CMD.

  • Token friendly — incremental reads, grep/tail filters, head+tail truncation with an explicit omission marker.

Related MCP server: Interactive Terminal MCP Server

Requirements

  • Windows 10 (1809+) or Windows 11 — ConPTY is required.

  • Python 3.10+.

  • An MCP client (Claude Desktop, Cursor, opencode, Cline, any SDK-based agent).

Install

pip install git+https://github.com/hugo94z/mcp-interactive-terminal

Or from a clone:

git clone https://github.com/hugo94z/mcp-interactive-terminal
cd mcp-interactive-terminal
uv venv .venv
uv pip install --python .venv\Scripts\python.exe -e .

The mcp-interactive-terminal command starts the server on stdio.

Configure your MCP client

opencode (~/.config/opencode/opencode.jsonc)

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "servers": {
      "interactive-terminal": {
        "type": "local",
        "command": ["mcp-interactive-terminal"]
      }
    }
  }
}

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "interactive-terminal": {
      "command": "mcp-interactive-terminal"
    }
  }
}

Cursor (.cursor/mcp.json)

{
  "mcpServers": {
    "interactive-terminal": {
      "command": "mcp-interactive-terminal"
    }
  }
}

If the command is not on your PATH, use the absolute path to the entry point, for example:

{
  "command": "C:\\Users\\you\\project\\.venv\\Scripts\\mcp-interactive-terminal.exe"
}

Tools

Tool

Description

terminal_start

Start a session (powershell, pwsh, cmd, or any executable), with cwd, env, cols, rows, name, replace, args. Returns the id, pid and initial screen.

terminal_send

Send text, named keys, enter=true, repeat.

terminal_read

Incremental raw output since the last read (or an explicit since cursor). Optional grep, tail, strip_ansi.

terminal_wait

Block until until regex matches, output is quiet for quiet_ms, the session exits, or timeout_ms. Provide until and/or quiet_ms.

terminal_screen

Rendered VT screen with cursor position — the authoritative view.

terminal_interrupt

Ctrl+C, then terminate the child process tree if the command is still running. The shell survives.

terminal_resize

Resize the pseudo-terminal (columns × rows).

terminal_list

Active sessions, state, pid, cwd, size, idle time.

terminal_stop

Close a session (force to kill the tree).

terminal_exec

One-shot command: output, exit_code, timed_out, duration.

Keys accepted by terminal_send

enter tab backtab esc space backspace up down left right home end pageup pagedown insert delete f1…f12 ctrl-a…ctrl-z ctrl-space ctrl-break, plus text:<literal> for arbitrary text.

Example

terminal_start(shell="powershell", cwd="C:/work/api")
-> session_id: "t1", screen: "PS C:\\work\\api> "

terminal_send(session_id="t1", text="python -m http.server 8080", enter=True)
terminal_wait(session_id="t1", until="Serving HTTP on", timeout_ms=15000)
-> reason: "matched"

terminal_exec(command="curl.exe -s -o NUL -w '%{http_code}' http://localhost:8080")
-> output: "200", exit_code: 0

terminal_interrupt(session_id="t1")
-> sent: true, running: true      # back to the prompt

terminal_send(session_id="t1", text="exit", enter=True)
terminal_stop(session_id="t1")

Why terminal_screen and terminal_read both exist

PowerShell uses PSReadLine, which redraws the current line with absolute cursor movements every time a character is typed. Raw output therefore contains fragments such as \x1b[1;58He, \x1b[1;58Hec, \x1b[1;58Hech… Stripping ANSI codes gives unreadable text.

terminal_screen feeds that stream into a VT100 emulator (via pyte) and returns what a human would actually see. terminal_read is still useful for exact incremental output (logs, byte streams, detecting events) and never returns the same bytes twice.

terminal_wait matches against the rendered screen and the raw output, and ignores the echo of the command you just typed by default (ignore_echo).

Design notes

  • One reader thread per session pushes output into a bounded ring buffer and the VT screen under a single lock.

  • Reads are cursor-based (buffer end offset), so nothing is duplicated and nothing is lost silently.

  • terminal_wait sleeps on a condition variable — no busy loop, negligible CPU.

  • Sessions are closed on exit (atexit, EOF on stdio, or explicit terminal_stop); forced stops use taskkill /T /F on the process tree.

  • PowerShell sessions are started with -NoExit -Command to force UTF-8 console encoding before the first prompt.

  • CMD sessions run chcp 65001 at startup.

Notes on Windows behaviour

  • Ctrl+C in a pseudo-console is not delivered as a console control event to native child processes: the control character reaches the console input buffer, but the child process group does not receive CTRL_C_EVENT. terminal_interrupt therefore sends Ctrl+C and then terminates the remaining child process tree while keeping the shell alive. Processes that trap Ctrl+C gracefully get the chance to run their handler first.

  • Resizing the pseudo-console can make some shells drop the next write. See Known limitations.

Known limitations

  • Windows only. ConPTY does not exist on Linux or macOS, so there is no POSIX backend yet.

  • terminal_resize works, but some shells need a moment to redraw after a size change; give the next command a short delay if you resize in the middle of a session.

  • The rendered screen shows the visible window only. Use terminal_read for full scrollback (bounded by the 500k-character ring buffer).

  • Interactive programs that require raw mouse events or bracketed paste are not emulated.

Security

This server executes arbitrary commands with the privileges of the user running it. There is no sandbox, no allowlist and no confirmation prompt. Only connect it to MCP clients you trust, and treat its tools with the same care as a shell running on your machine.

Development

uv venv .venv
uv pip install --python .venv\Scripts\python.exe -e ".[dev]"
.venv\Scripts\python.exe -m pytest -q

The test suite covers the ring buffer, VT rendering, key mapping, truncation, real PowerShell/CMD sessions (interactive prompt, Ctrl+C, resize, exit codes) and a full MCP client handshake over stdio.

Roadmap

Known limitations, root causes and the prioritised backlog live in ROADMAP.md. It includes file-level pointers for each improvement, a guide for adding a tool or a shell, and a debugging checklist.

License

MIT — see LICENSE.

Available Tools

10 tools
terminal_execA

Run a one-shot command to completion and return its output and exit code.

Use this for non-interactive commands. Use terminal_start + terminal_send for programs that need input, a TUI, or a persistent shell.

Args: command: Command line to execute. shell: "powershell", "pwsh" or "cmd". cwd: Working directory. Defaults to the server's current directory. env: Extra environment variables. timeout_ms: Kill the command after this long. max_chars: Maximum output characters returned.

Returns: output, exit_code, timed_out, duration_ms, truncated.

ParametersJSON Schema
NameRequiredDescriptionDefault
cwdNo
envNo
shellNopowershell
commandYes
max_charsNo
timeout_msNo

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does well: it discloses the return fields (output, exit_code, timed_out, duration_ms, truncated), that timeout_ms kills the command, and that max_chars can truncate output. It does not discuss permissions, side effects of arbitrary command execution, or whether partial output survives a timeout kill.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the one-shot semantics before the routing advice, then uses compact Args/Returns lists with no filler. The Returns line is terse (bare field names) but earns its place since no output schema exists.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a six-parameter, unannotated, output-schema-less command runner this covers purpose, routing, all parameters, and the return shape. Remaining gaps are edge cases: partial-output behavior on timeout and environment merge semantics.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate, and it does: it names all six parameters, states cwd defaults to the server's directory, and supplies the shell enum values ('powershell', 'pwsh', 'cmd') that the schema omits. It stops short of details like whether env is merged with or replaces the inherited environment.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Run a one-shot command to completion') plus the return artifacts, and explicitly separates itself from the persistent-shell siblings. An agent can choose between terminal_exec and terminal_start/terminal_send without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

'Use this for non-interactive commands. Use terminal_start + terminal_send for programs that need input, a TUI, or a persistent shell' gives both the when and the when-not with named alternatives. Nothing about routing is left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

terminal_interruptA

Stop the command running in a session, keeping the shell alive.

Sends Ctrl+C first. Native Windows programs often ignore the control character inside a pseudo-console, so any child process still running after a short grace period is terminated together with its own children. The shell itself is preserved.

Args: session_id: Session returned by terminal_start. force: Skip the grace period and terminate child processes immediately.

Returns: session_id, sent, running and the list of terminated pids.

ParametersJSON Schema
NameRequiredDescriptionDefault
forceNo
session_idYes

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does well: it discloses the Ctrl+C-first sequence, the Windows pseudo-console limitation, the grace-period cascade termination of children, and that the shell is preserved. It stops short of covering failure modes (e.g. no process running) or any permission requirements.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the one-line purpose, followed by the mechanism paragraph and clean Args/Returns sections. Every sentence adds operational information; nothing is restated from the schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, and the Returns section compensates by listing session_id, sent, running and terminated pids. Combined with the behavioral paragraph and parameter notes, an agent has enough to call it correctly, though the terminal_stop relationship and no-op/error case are left implicit.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate, and it documents both parameters: session_id is tied to its producer ('Session returned by terminal_start') and force is explained as skipping the grace period for immediate termination. That is complete for a two-parameter tool.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Stop the command running in a session') and immediately scopes it with 'keeping the shell alive', which is precisely what separates it from terminal_stop. An agent can pick between interrupt and stop without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The opening clause gives clear context for when to reach for this tool (kill the running command, preserve the interactive shell) and the force arg note indicates the escalation path. It never names terminal_stop explicitly or states what happens when no command is running, so the exclusion is implied rather than spelled out.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

terminal_listB

List active sessions with their state, pid, cwd, size, idle time and buffer size.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations exist, so the description carries the full burden. It does usefully disclose the returned attributes (state, pid, cwd, size, idle time, buffer size), which implies a read-only introspection call, but it says nothing about scoping, pagination, or what 'active' means, and doesn't confirm the operation is non-mutating.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single compact sentence with the verb and resource front-loaded and no filler. The enumerated attribute list is informative rather than padding, though the near-duplicate 'size' and 'buffer size' is slightly redundant.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description compensates by naming the fields returned, which is the key missing piece for a listing tool. Remaining gaps are minor: what counts as 'active' and whether sessions from other workspaces are included.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool takes zero parameters, so there is no parameter meaning to convey and the baseline is 4. The description's field list is about return values, not inputs, so it neither helps nor hurts here.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (List) and resource (active sessions), and enumerates the attributes returned. It is clearly distinguishable in substance from siblings like terminal_read or terminal_screen, though it never names or contrasts them explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives no when-to-use guidance, no prerequisites, and no mention of alternatives such as terminal_screen or terminal_read. The agent must infer that this is a discovery/overview call from the verb alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

terminal_readA

Read incremental raw output from a session, without duplicates.

Each call returns only what arrived after the previous read. Use the returned cursor with since to resume from an explicit position.

Args: session_id: Session returned by terminal_start. since: Absolute character offset to read from. Defaults to the last read position. max_chars: Maximum characters returned (head+tail with an explicit omission marker). grep: Keep only lines matching this regular expression. tail: Keep only the last N lines (applied after grep). strip_ansi: Remove ANSI escape sequences.

Returns: text, cursor (pass as since), dropped, truncated, running, exit_code.

Note: PowerShell (PSReadLine) repaints the current line with cursor movements, so raw output contains fragments. Use terminal_screen for an authoritative view.

ParametersJSON Schema
NameRequiredDescriptionDefault
grepNo
tailNo
sinceNo
max_charsNo
session_idYes
strip_ansiNo

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does well: it discloses incremental/deduplicated semantics, that max_chars returns head+tail with an explicit omission marker, and that dropped/truncated/running/exit_code flags exist. The PSReadLine repaint caveat is genuinely useful behavioral context a schema could not convey.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded core sentence, then an Args/Returns/Note structure that is scannable and every line earns its place. Slightly verbose relative to the simple read operation, but the added detail is functional rather than filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Although there is no output schema, the Returns line names the returned fields (text, cursor, dropped, truncated, running, exit_code), and the body explains the cursor resume workflow and the authoritative-view caveat. Nothing an agent needs to invoke this correctly appears to be missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate fully, and it does: every one of the six parameters (session_id, since, max_chars, grep, tail, strip_ansi) is given meaning beyond its name, including precedence ('tail applied after grep') and the head+tail truncation behavior of max_chars.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource (read incremental raw output) and immediately sharpens it with the scoping constraint 'without duplicates' and 'only what arrived after the previous read'. It also names the distinguishing sibling, terminal_screen, for authoritative views, so an agent can tell it apart from the other terminal tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides clear operational context: use the returned cursor with `since` to resume, and use terminal_screen rather than raw reads when an authoritative view is needed due to PowerShell repaint. It names the key alternative and its trigger condition, though it doesn't enumerate the remaining siblings (terminal_exec, terminal_wait, etc.).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

terminal_resizeA

Resize the pseudo-terminal (affects wrapping and full-screen programs).

Args: session_id: Session returned by terminal_start. cols: New width, 2..1000. rows: New height, 2..500.

ParametersJSON Schema
NameRequiredDescriptionDefault
colsYes
rowsYes
session_idYes

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Since no annotations are provided, the description carries the full behavioral burden. It discloses the tool's effect on the environment (wrapping and full-screen programs) and provides critical operational constraints—the strict minimum and maximum range limits for cols (2..1000) and rows (2..500), which define acceptable input behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The definition is highly efficient. It begins with a clear summary, followed immediately by an easy-to-parse argument list that integrates both semantic meaning and functional constraints without unnecessary padding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The definition is exceptionally complete for a tool with no output schema or annotations. It provides the required inputs, the operational constraints for those inputs, and the necessary linkage to the terminal session lifecycle.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema coverage is noted as 0%, meaning the description must compensate heavily. The description excels by defining the unit (width/height) and providing explicit bounds for both `cols` and `rows`, which is critical semantic and validation information absent from the bare input schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (Resize) and the resource (pseudo-terminal). It provides specific functional consequences (affects wrapping and full-screen programs), clearly distinguishing its purpose from sibling tools like terminal_start or terminal_exec.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It provides an essential prerequisite condition by stating that the required session_id must be 'Session returned by terminal_start.' This guides the agent on the correct workflow and dependency, although it does not explicitly state when *not* to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

terminal_screenA

Return the rendered terminal screen (VT emulation) with cursor position.

This is the clean view: cursor moves, erases and color codes are applied, so it shows exactly what a human would see, including the current prompt or TUI.

Args: session_id: Session returned by terminal_start. max_chars: Maximum characters returned (head+tail with an omission marker).

Returns: text, cursor {x,y}, cols, rows, running, exit_code.

ParametersJSON Schema
NameRequiredDescriptionDefault
max_charsNo
session_idYes

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does well: it discloses VT emulation semantics (cursor moves, erases, color codes applied), the truncation strategy for max_chars (head+tail with an omission marker), and the return shape including running and exit_code state. It does not address whether reading is side-effect-free or how errors surface, but the core behavioral picture is solid.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the one-line purpose, then Args and Returns blocks that are easy to scan. Every sentence contributes, though the section scaffolding is slightly heavier than strictly necessary.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, but the Returns block enumerates the fields (text, cursor, cols, rows, running, exit_code), and both parameters are documented. For a two-parameter read tool this is nearly complete, with only edge cases like reading a finished session left unaddressed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate, and it does: session_id is tied to 'Session returned by terminal_start', and max_chars is explained as a head+tail truncation with an omission marker, which is meaningful behavior beyond the bare schema default.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Return the rendered terminal screen (VT emulation) with cursor position') and the phrase 'This is the clean view' implicitly differentiates it from a raw-output sibling like terminal_read. However, it never names terminal_read, so the agent must infer the distinction rather than being routed explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives clear usage context: use it to see 'exactly what a human would see, including the current prompt or TUI', which tells the agent when a rendered view is preferable to raw bytes. There are no explicit exclusions and no named alternative, so it stops short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

terminal_sendA

Send text and/or named keys to a session.

Args: session_id: Session returned by terminal_start. text: Literal text to type (not followed by Enter unless enter=true). keys: Named keys, e.g. ["ctrl-c"], ["up"], ["tab"], ["f5"], ["text:abc"]. Supported: enter, tab, backtab, esc, space, backspace, up, down, left, right, home, end, pageup, pagedown, insert, delete, f1..f12, ctrl-a..ctrl-z, ctrl-space, ctrl-break. enter: Append a carriage return after text/keys. repeat: Repeat the whole sequence 1..100 times.

Returns: session_id, sent_chars and running state.

ParametersJSON Schema
NameRequiredDescriptionDefault
keysNo
textNo
enterNo
repeatNo
session_idYes

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full behavioral burden. It usefully discloses that text is not followed by Enter unless enter=true, the full supported key set, and the 1..100 repeat bound, but says nothing about blocking behavior, error handling on a dead session, permissions, or rate limits for a mutation-style tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded summary followed by tight Args/Returns sections; every element earns its place. The enumerated key list is long but not present in the schema, so it is justified rather than padding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, and the description compensates by naming the returned fields (session_id, sent_chars, running state). Combined with the thorough parameter documentation, an agent has enough to invoke it correctly, though side-effect and failure behavior remain unstated.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, and it largely does: it names the origin of session_id, explains text vs keys, enumerates the valid named keys, and gives the repeat range. Only minor gaps remain, such as how text and keys interact when both are supplied.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first line gives a precise verb+resource: send text and/or named keys to a session, and the Args section elaborates the two input channels. It does not, however, differentiate itself from siblings like terminal_exec or terminal_interrupt, which an agent must choose between for the same session.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied by the parameter semantics (type literal text with text, send control sequences with keys). There is no explicit statement of when to prefer this over terminal_exec, nor any prerequisite or exclusion guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

terminal_startA

Start an interactive terminal session and return its id plus the initial screen.

Args: shell: "powershell" (Windows PowerShell 5.1), "pwsh" (PowerShell 7), "cmd", or an absolute path to any executable. cwd: Working directory. Defaults to the server's current directory. env: Extra environment variables merged into the inherited environment. cols: Terminal width in columns (default 120). rows: Terminal height in rows (default 30). name: Session id. Auto-generated (t1, t2, ...) when omitted. replace: Kill an existing session with the same name and start a fresh one. args: Extra arguments passed to the shell or executable.

Returns: session_id, shell, cwd, pid, size, ready reason and the rendered screen.

ParametersJSON Schema
NameRequiredDescriptionDefault
cwdNo
envNo
argsNo
colsNo
nameNo
rowsNo
shellNopowershell
replaceNo

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It does disclose the destructive side of replace ('Kill an existing session with the same name') and enumerates the return fields including a 'ready reason', which is genuinely useful. It says nothing about session lifetime/persistence, cleanup responsibilities, or failure behavior, which are significant for a long-lived stateful resource.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded in one sentence, then cleanly separated into Args and Returns blocks. Nothing is padded and the parameter list is justified because the schema itself provides no descriptions.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 8-parameter, stateful, no-annotation tool with no output schema, the description covers parameters and return shape well. It stops short of telling the agent how this session relates to the other session tools (send/read/stop) or how long the session lives, which is the main remaining gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, and it does: all eight parameters are explained with concrete values ('powershell', 'pwsh', 'cmd', or an absolute path), defaults (120 cols, 30 rows, server cwd), and semantics (env is merged into the inherited environment, name auto-generates as t1/t2, args are extra shell arguments).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('Start an interactive terminal session') and the return payload, so the agent knows exactly what the tool does. It does not, however, contrast itself with the closest sibling, terminal_exec, which an agent could reasonably confuse it with for command execution.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied rather than stated: 'interactive terminal session' versus terminal_exec/terminal_send, and the replace flag's kill-and-restart behavior hint at when to use it. There is no explicit when-to-use/when-not-to-use guidance or named alternative anywhere in the text.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

terminal_stopB

Close a session and free its process.

Args: session_id: Session returned by terminal_start. force: Kill the whole process tree instead of requesting a graceful stop.

ParametersJSON Schema
NameRequiredDescriptionDefault
forceNo
session_idYes

TDQS

B3.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden, and it does disclose a genuine behavioral trait: force kills the whole process tree rather than requesting a graceful stop. However, it omits the consequences of a non-forced close, error behavior for unknown sessions, and whether the call blocks.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded in one sentence, followed by a compact args block. Nothing is padded, though the args header formatting is slightly heavier than the content warrants.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple two-parameter stop tool with no annotations and no output schema, this covers the essentials but leaves gaps: no relationship to terminal_interrupt, no statement of what happens to the session's output or files, and no failure semantics. Adequate but not complete for a destructive operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, and it does: session_id is tied back to terminal_start, and force is explained as graceful-stop vs process-tree-kill. Both parameters gain meaning the schema alone does not provide.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a specific verb and resource: 'Close a session and free its process.' This is clear and concrete, but it does not explicitly differentiate from siblings like terminal_interrupt, which an agent might reasonably confuse with stopping a session.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no when-to-use guidance or statement of alternatives. The sibling set contains terminal_interrupt, and an agent gets no help deciding between an interrupt and a full stop. The force note explains a parameter choice, not when to reach for this tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

terminal_waitA

Block until output matches a regex, becomes quiet, the session exits, or timeout.

Args: session_id: Session returned by terminal_start. until: Case-insensitive regular expression to wait for, e.g. "PS C:\|>>>|Done". quiet_ms: Return when no output arrived for this long (0 disables quiet detection). Provide at least one of until or quiet_ms. timeout_ms: Give up after this long. ignore_echo: Ignore the echo of the last command line when matching until (prevents matching the command text itself).

Returns: reason: "matched" | "quiet" | "exited" | "timeout", matched, running, exit_code, and the rendered screen.

ParametersJSON Schema
NameRequiredDescriptionDefault
untilNo
quiet_msNo
session_idYes
timeout_msNo
ignore_echoNo

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden, and it does well: it discloses blocking behavior, the four termination reasons, the disabling semantics of quiet_ms=0, and the echo-matching pitfall that ignore_echo exists to avoid. It does not address whether the wait consumes buffered output or how it interacts with concurrent reads, which is the main remaining behavioral gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The single-sentence purpose is front-loaded and the Args/Returns blocks are compact. The Args list restates parameter names already visible in the schema, which is mild redundancy, but each line still adds semantics that the schema does not carry.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, so the description proactively documents the return fields (reason, matched, running, exit_code, screen), which is exactly the right compensation. It is nearly complete for a 5-param tool; the missing piece is the relationship to terminal_read/terminal_screen regarding whether waited-for output is consumed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate entirely, and it does: all five parameters get meaning, not just names – a regex example for `until`, the 0-disables rule for `quiet_ms`, and the rationale for `ignore_echo`. `session_id` is tied back to terminal_start, which is the only cross-tool linkage the schema lacks.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (block/wait) and the exact four conditions under which it returns: regex match, quiet, session exit, or timeout. The blocking semantics immediately separate it from the immediate-read siblings terminal_read and terminal_screen, so an agent can pick it without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives one concrete usage rule – 'Provide at least one of `until` or `quiet_ms`' – which is genuinely useful constraint guidance. However, it never says when to choose this tool over terminal_read or terminal_screen, nor when a quiet wait is preferable to a regex wait. Usage is implied rather than stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 10 tool updatesv0.1.0
    • First observedterminal_exec
    • First observedterminal_interrupt
    • First observedterminal_list
    • First observedterminal_read
    • First observedterminal_resize
    • First observedterminal_screen
    • First observedterminal_send
    • First observedterminal_start
    • First observedterminal_stop
    • First observedterminal_wait

TDQS

A4.1/5.0

Scored across 10 tools

Disambiguation5/5

Each tool has a clearly distinct role: lifecycle (start/stop/list/resize), input (send/interrupt), and output (read/screen/wait/exec). The potentially overlapping read vs. screen and wait vs. read pairs are explicitly differentiated in their descriptions (raw incremental vs. rendered VT view; blocking vs. immediate).

Naming Consistency5/5

Every tool follows the same terminal_<verb> snake_case pattern with no exceptions. The verb choices are predictable and consistent across the set.

Tool Count5/5

Ten tools is well-scoped for interactive terminal control, with each one covering a necessary operation (lifecycle, input, output, waiting, rendering). No redundant or filler tools.

Completeness4/5

The surface covers the full interactive lifecycle: start/stop, send/interrupt, read/screen/wait, resize, plus a one-shot exec for non-interactive commands. Minor gaps exist, such as no session rename or explicit scrollback/buffer clearing, but core workflows are fully covered.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables AI assistants to fully interact with console applications, monitor output, detect errors, and automate terminal workflows across multiple sessions. Similar to how Playwright works for web browsers but for command-line interfaces.
    138 npm
    52
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Provides AI agents with fully interactive terminal sessions, including TUI support, keyboard control, and screen capture across Windows, Linux, and Mac.
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    A PTY-based MCP server providing persistent, interactive shell sessions with strong Windows support, enabling AI agents to run commands, handle interactive tools, and manage large output across MCP-compatible clients.
    303 npm
    12
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables AI agents to interact with interactive CLI processes via a real PTY, allowing them to send keystrokes, read screen output, and handle interactive prompts.
    4 npm
    1
    MIT