Labsco
MCP SERVER

Headless Terminal (ht) MCP

by memextech

Give an assistant a real terminal session it can type into, snapshot, and keep open across several commands.

Editors, Terminals & Local Dev Environment
Summary
State survives between calls, which is what interactive programs need.

A stateless run-command tool cannot handle anything that asks a question — an ssh password prompt, a git rebase, an installer, vim. Here the session persists, so the pattern is execute, snapshot, look, send keys, snapshot again. Being able to watch the same session in a browser while the assistant drives it is more useful than it sounds when you are trying to work out what it just did.

What it is

A Rust MCP server that embeds ht, a headless terminal, and hands out sessions. The distinction that matters: this is not run-a-command-and-return-stdout. The session stays alive between calls, so the assistant can start something interactive, look at the screen, and type the next thing.

What you get
  • ht_create_session — a new terminal, optionally starting a command, optionally with the web server on
  • ht_execute_command — run a command in an existing session and read what came back
  • ht_send_keys — send keystrokes rather than a command line, which is how you answer a prompt or drive a full-screen program
  • ht_take_snapshot — the current terminal screen as text, so the assistant can see what a program is showing right now
  • ht_list_sessions and ht_close_session — several sessions at once, and cleanup when you are done
  • With the web server enabled, a session also has a live preview URL you can open in a browser and watch
  • Responses come back as readable text rather than JSON — a snapshot looks like a terminal, because that is what the model has to reason about
Requirements

Nothing but the binary — a single Rust executable with no Node.js or Python runtime behind it. Install with brew tap memextech/tap and brew install ht-mcp, download a release build for macOS, Linux or Windows, or cargo install ht-mcp. Building from source needs Rust 1.75 or later and a recursive clone, since ht comes in as a submodule. Windows support is marked experimental. Apache 2.0 licensed. Whatever the assistant runs, runs with your shell's permissions on your machine.

Setup effort

One command — brew install memextech/tap/ht-mcp