
tui-mcp
MCP server that lets AI agents run and operate terminal apps in a persistent pty
The repository was last updated 124 days ago and is published under MIT.
tui-mcp is an open-source MCP server for developer tools. It is available on CLI and Self-hosted.
- Pricing
- Open source
- Platforms
- CLI, Self-hosted
- What it can do
- Can change data (3 tools)
- GitHub stars
- 15
- Last commit
Similar MCP servers
About tui-mcp
Gives an AI agent a live terminal session it can drive over MCP. A program is started inside a managed pseudo-terminal that stays open between calls, so the agent can wait for prompts, send keystrokes, and read what is on screen as a PNG screenshot or plain text snapshot.
Under the hood the app runs through node-pty, and its output is parsed by xterm-headless, so full-screen interfaces that paint with ANSI escape codes come back as readable screen contents rather than raw noise. Sessions can be resized, scrolled back through, and read by region, and the agent can block until a regex appears, the screen settles, or the process exits.
The package also includes a terminal monitor that lists sessions across every running tui-mcp server on the machine, shows a live preview, and lets a person attach to or kill a session. It suits developers and ops engineers who want agents to work with interactive tools such as database shells, debuggers, editors, and SSH logins.
Tools this server provides (17)
Taken from the project documentation; the running server may differ.
From the tool list in its README, going by the names, 3 of 17 tools change data; 11 names don't say.
From the server's own tool labels and tool names; not verified by us.
- launch
- Spawn a TUI app in a managed pty
- kill
- Terminate a session
- list_sessionsName suggests: reads
- List sessions, including recently exited ones
- statusName suggests: reads
- Get one session's state and exit code
- resize
- Resize the terminal
- screenshot
- Capture terminal as PNG
- snapshot
- Capture terminal as plain text
- scrollback
- Read the buffer including scrolled-off history
- output
- Read the raw pty byte stream (escape sequences included)
- read_regionName suggests: reads
- Read a rectangular area of the buffer
- cursor
- Get cursor position
- send_keysName suggests: changes
- Send a keystroke or combo
- send_textName suggests: changes
- Type a string of characters
- send_mouseName suggests: changes
- Send mouse events
- wait_for_text
- Wait for a regex pattern to appear
- wait_for_idle
- Wait until the terminal stops changing
- wait_for_exit
- Wait for the process to exit and get its exit code
What it does
- Persistent interactive sessions
- Programs stay alive across tool calls so state such as an open database shell or transaction is preserved.
- Screenshot and text snapshots
- Captures the terminal as a PNG image or as plain text, with escape sequences already rendered.
- Keystroke and mouse input
- Sends key combinations, typed strings, and mouse events to the running program.
- Wait conditions
- Waits for a regex match, for the screen to become idle, or for the process to exit with its code.
- Scrollback and region reads
- Reads scrolled-off history, rectangular screen areas, the cursor position, or the raw byte stream.
- Session monitor
- A terminal UI lists sessions across servers, previews them live, and allows attach, launch, and kill.
Good for
- Driving interactive CLIs such as mysql, psql, or redis-cli from an agent
- Watching a build, test run, or log tail while other work continues
- Stepping through a program in gdb, lldb, pdb, or node --inspect
- Operating remote servers over SSH, including password and 2FA prompts
- Running kubectl, terraform, or cloud CLIs in a session that needs follow-up input
- Answering the questions of an interactive installer or git rebase -i
Pricing
Open source
Free and MIT licensed.
tui-mcp FAQ
How do I install tui-mcp for Claude?
Run claude mcp add --scope user tui-mcp -- npx tui-mcp.
How is tui-mcp different from a bash tool?
A bash tool runs discrete commands that exit. tui-mcp keeps a pty session alive between calls and renders full-screen interfaces into readable snapshots.
Which terminal emulator does tui-mcp use?
Output is parsed by xterm-headless, the emulator behind VS Code's terminal, running on a node-pty pseudo-terminal.
How do I watch sessions from my terminal?
Run npx tui-mcp monitor to see sessions from all running servers, with attach, launch, and kill controls.
Is tui-mcp free?
Yes. tui-mcp is open source, so you can use and self-host it for free.
What are the best alternatives to tui-mcp?
The closest alternatives to tui-mcp are Terminal MCP Server, Terminal MCP, mcp-tmux, pty-mcp and tmux-mcp.
Where this comes from
- Description: written from the project's README.


