MCP server/other

TUI MCP Server

Launch any TUI app, take screenshots, send keystrokes, and read text.

★ 12nvms/tui-mcp ↗by nvmsupdated
1

Add it to Claude Code

claude mcp add tui-mcp -- npx -y tui-mcp
2

Make your agent remember this setup

tui-mcp's config, env vars, and the gotchas you hit — recalled in every future Claude Code, Cursor, and Codex session.

npx conare@latest

Free · one command · indexes the sessions already on disk. Set up in the browser instead →

What it does

  • Maintains persistent, interactive terminal sessions
  • Renders full-screen TUI interfaces into readable text or PNG screenshots
  • Supports complex conversational flows like SSH logins and interactive installers
  • Provides real-time terminal monitoring and interaction
  • Uses xterm-headless to parse ANSI escape codes accurately

Tools 13

launchSpawn a TUI app in a managed pty
killTerminate a session
list_sessionsList active sessions
resizeResize the terminal
screenshotCapture terminal as PNG
snapshotCapture terminal as plain text
read_regionRead a rectangular area of the buffer
cursorGet cursor position
send_keysSend a keystroke or combo
send_textType a string of characters
send_mouseSend mouse events
wait_for_textWait for a regex pattern to appear
wait_for_idleWait until the terminal stops changing

Try it

Launch htop in a new session and take a screenshot to show me the current system resource usage.
Open a new session running 'mysql -u root -p', wait for the password prompt, and then type my password.
List all active terminal sessions and tell me which one is currently running a dev server.
Send 'Ctrl+C' to the session running the build process and wait for it to return to the command prompt.
Read the text output from the current session to check if the deployment log shows any errors.
Original README from nvms/tui-mcp

tui-mcp

What Chrome DevTools MCP is for the browser, tui-mcp is for the terminal.

Launch any terminal app in a managed pty, take screenshots, read text, send keystrokes. The app thinks it's running in a real terminal. Works with any TUI framework or no framework at all - vim, htop, bubbletea, textual, ink, inquirer, trend, ncurses, whatever.

<a href="https://glama.ai/mcp/servers/nvms/tui-mcp"> </a>

How is this different from a bash tool?

A bash tool runs discrete commands - each invocation is fire-and-forget. The process exits, the output comes back. tui-mcp maintains a persistent, interactive session. The pty stays alive between calls. This matters when:

  • The tool has state - you're in a mysql shell, you've USEd a database, you're in a transaction. A bash tool can't hold that session open between calls.
  • The tool has UI - htop, vim, k9s, lazygit. A bash tool gets garbage back because these apps paint full-screen interfaces with ANSI escape codes. tui-mcp renders them into a readable screenshot or text snapshot through xterm emulation.
  • The interaction is multi-step - SSH prompts for a password, then a 2FA code, then you're in. An interactive installer asks questions. git rebase -i drops you into an editor. These are conversational flows that a stateless bash tool can't handle.
  • You need to watch something - tail a log, monitor a build, wait for a deploy to finish. The session stays open, the agent can snapshot whenever it wants to check progress.
  • The tool requires a TTY - some CLIs behave differently (or refuse to run) without a real terminal. node-pty gives them a real pty with xterm-256color, so everything works as expected.

A bash tool is exec(). tui-mcp is "sit down at a terminal and use it like a human." One runs commands, the other operates software.

Some example outputs of the screenshot tool:

trend dashboard lore htop

Setup

claude mcp add --scope user tui-mcp -- npx tui-mcp

Tools

Tool Description
launch Spawn a TUI app in a managed pty
kill Terminate a session
list_sessions List active sessions
resize Resize the terminal
screenshot Capture terminal as PNG
snapshot Capture terminal as plain text
read_region Read a rectangular area of the buffer
cursor Get cursor position
send_keys Send a keystroke or combo (Enter, Ctrl+C, Up, q)
send_text Type a string of characters
send_mouse Send mouse events
wait_for_text Wait for a regex pattern to appear
wait_for_idle Wait until the terminal stops changing

Interesting use cases

  • remote ops: agent SSHs into a production box, tails logs, greps for errors, restarts a service, watches it come back up. it's reading the same terminal output a human SRE would see. no custom APIs needed.
  • legacy system interaction: ncurses admin panels, mysql cli, redis-cli, psql - the agent can drive all of these. stuff that will never get a REST API.
  • multi-session orchestration: agent launches 3-4 sessions simultaneously. one running a dev server, one running tests, one tailing logs, one in a debugger. it's basically pair programming with an extra set of hands.
  • interactive debuggers: gdb, lldb, pdb, node --inspect. the agent can set breakpoints, step through code, inspect variables.
  • infrastructure as conversation: kubectl, terraform, docker, aws cli. agent doesn't need the kubernetes MCP server or the AWS MCP server. it just uses the CLIs directly, same as a human would.

Most MCP servers wrap one specific tool or API. tui-mcp wraps the terminal itself, which is the universal interface that all tools already speak. It's MCP's eval().

Monitor

Watch all active sessions in real-time from your terminal:

npx tui-mcp monitor

Session list on the left, live ANSI-rendered terminal preview on the right. j/k to navigate sessions, Enter to toggle fullscreen, q to quit. Requires the MCP server to be running.

How it works

your app  <-->  node-pty  <-->  xterm-headless  <-->  MCP tools
                (pty)        (terminal emulator)    (screenshot, send_keys, etc.)

The app runs in a real pseudo-terminal via node-pty. Its output is parsed by xterm-headless (the same terminal emulator that powers VS Code's terminal, but without a DOM). The MCP tools read and interact with that parsed buffer.

Frequently Asked Questions

What are the key features of TUI MCP?

Maintains persistent, interactive terminal sessions. Renders full-screen TUI interfaces into readable text or PNG screenshots. Supports complex conversational flows like SSH logins and interactive installers. Provides real-time terminal monitoring and interaction. Uses xterm-headless to parse ANSI escape codes accurately.

What can I use TUI MCP for?

Remote operations: SSH into production boxes to tail logs and restart services. Interacting with legacy admin panels like ncurses, mysql, or psql. Multi-session orchestration for running dev servers, tests, and debuggers simultaneously. Driving interactive debuggers like gdb, lldb, or node --inspect. Managing infrastructure via CLIs like kubectl, terraform, or aws cli.

How do I install TUI MCP?

Install TUI MCP by running: claude mcp add --scope user tui-mcp -- npx tui-mcp

What MCP clients work with TUI MCP?

TUI MCP works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Conare · memory for coding agents

Turn this server into reusable context

Keep TUI MCP docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Set up free$npx conare@latest