# tui-mcp

> tui-mcp is an open-source MCP server for developer tools. MCP server that lets AI agents run and operate terminal apps in a persistent pty. It is available on CLI and Self-hosted.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, Self-hosted
- **Repository:** https://github.com/nvms/tui-mcp
- **GitHub stars:** 15
- **License:** MIT
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-01

## About

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.

## Features

- **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

## Tools

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_sessions` (name suggests: reads): List sessions, including recently exited ones
- `status` (name 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_region` (name suggests: reads): Read a rectangular area of the buffer
- `cursor`: Get cursor position
- `send_keys` (name suggests: changes): Send a keystroke or combo
- `send_text` (name suggests: changes): Type a string of characters
- `send_mouse` (name 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

## 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.

## Alternatives

- [Terminal MCP Server](https://ai-powered.com/mcp/terminal-mcp-server): Terminal MCP Server is an open-source MCP server for developer tools.
- [Terminal MCP](https://ai-powered.com/mcp/terminal-mcp): Terminal MCP is an open-source MCP server for developer tools.
- [mcp-tmux](https://ai-powered.com/mcp/mcp-tmux-2): mcp-tmux is an open-source MCP server for developer tools.
- [pty-mcp](https://ai-powered.com/mcp/pty-mcp): pty-mcp is an open-source MCP server for developer tools.
- [tmux-mcp](https://ai-powered.com/mcp/tmux-mcp): tmux-mcp is an open-source MCP server for developer tools.
- [Interactive Terminal](https://ai-powered.com/mcp/interactive-terminal): Interactive Terminal is an open-source MCP server for developer tools.
- [MCP Console Automation](https://ai-powered.com/mcp/mcp-console-automation): MCP Console Automation is an open-source MCP server for browser automation.
- [tmux](https://ai-powered.com/mcp/tmux): tmux is an open-source MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/tui-mcp
