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.
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
mysqlshell, you'veUSEd 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 -idrops 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:

<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.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。