tui-mcp

tui-mcp

What Chrome DevTools MCP is for the browser, tui-mcp is for the terminal. Launch any TUI app, take screenshots, send keystrokes, read text - works with any framework.

Category
Visit Server

README

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.

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

<a href="https://glama.ai/mcp/servers/nvms/tui-mcp"> <img width="380" height="200" src="https://glama.ai/mcp/servers/nvms/tui-mcp/badge" alt="tui-mcp MCP server" /> </a>

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.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured