SmartCLI drive Tui logo

SmartCLI drive Tui

Drive interactive terminal programs through a PTY by reading screens, sending keys, and waiting for visible state changes.

Install SmartCLI drive Tui

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "smartcli-drive-tui": {
      "command": "uvx",
      "args": [
        "--from",
        "smartcli-toolkit",
        "smartcli-mcp"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

We couldn’t confirm it starts correctly

The install command started, but didn't respond the way we expected when we tried to talk to it.

uvx --from smartcli-toolkit smartcli-mcp

initialize succeeded but no response to tools/list.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked 5d ago.

Overview

The SmartCLI drive-tui MCP server drives interactive terminal programs through a PTY and reads their rendered screen state. It exposes operations for starting sessions, sending lines or keys, waiting for screen conditions such as regular expressions, and closing sessions. A pyte-based cell model lets agents react to menus, prompts, alternate screens, and highlighted rows instead of relying only on raw output or fixed delays. Reach for it when an agent must operate a TUI, REPL, editor, or menu-driven command-line application.

Use cases

  • Drive a Python REPL and verify its output
  • Navigate a lazygit interface with arrow keys
  • Edit and save a file through vim
  • Wait for prompts or menu states before sending input

Key features

  • PTY-based interactive session control
  • Cell-level terminal screen perception
  • Regex-based screen waiting
  • Keyboard and line input
  • Alternate-screen handling
  • Stdio MCP server

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked 1d ago

Recent health check succeeded.

6/6 checks healthy over the last 46d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 16d ago via OSV.dev · smartcli-toolkit (PyPI)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars5Stargazers on the source repository.
Last commit12d agoMost recent push to the default branch.
Install checkInconclusiveStarted but did not complete the MCP handshake in our test.
Directory activity2 viewsConfig copies, upvotes, and views on AllMCPs.

How SmartCLI drive Tui works

What the SmartCLI drive-tui MCP server does

The SmartCLI drive-tui MCP server gives an MCP client control of interactive terminal applications. It can launch a command inside a pseudo-terminal, inspect the terminal display, provide keyboard input, wait for a visible condition, and end the session. This makes it suitable for programs whose behavior depends on terminal modes, menus, cursor movement, or full-screen rendering.

The package is part of the Python-based SmartCLI project and is distributed on PyPI as smartcli-toolkit. The MCP entry point is smartcli-mcp. The same underlying drive-tui functionality is also available through the smartcli-tui command-line interface.

Typical targets include Python REPLs, vim, lazygit, htop, and other interactive programs. The README demonstrates navigating lazygit, opening a commit diff, highlighting a branch, and driving vim through editing and saving a file.

How it works

A session runs the target process under a PTY rather than treating it as a simple byte stream. SmartCLI feeds terminal output into a pyte screen model that represents the display as cells. Agents can therefore wait for what is visibly present on the screen, including a prompt, menu state, or other matching text.

The interaction pattern is perceive, act, and confirm: read the current screen, send input, then wait until the expected screen state appears. wait-regex is designed for this purpose and avoids depending on blind sleep intervals. The CLI example starts a Python REPL, waits for >>> , sends an expression, waits for 42, and then closes the session.

The PTY implementation is not tied to tmux. The project describes support for Windows through ConPTY using pywinpty, with POSIX PTYs or tmux available in other environments. The package requires Python 3.10 or newer.

Setup and configuration

Install the package with:

Terminal
pip install smartcli-toolkit

Start the stdio MCP server with:

bash
smartcli-mcp
bash
uvx --from smartcli-toolkit smartcli-mcp

Configure the selected command as a stdio MCP server in the client that will use it. For direct CLI use, smartcli-tui start accepts a command and terminal dimensions such as --cols 80 --rows 24; the returned session identifier is passed to later operations.

Tools and capabilities

The documented drive-tui operations include:

  • Start a persistent terminal session for a command.
  • Send a complete input line with send-line.
  • Send keyboard input through the driver’s key-sending operations.
  • Wait for a regular expression with wait-regex and an optional timeout.
  • Read the cell grid produced after a matching screen state.
  • Close a session with close.

The MCP version attaches the per-session token to these interactions. The screen model also accounts for alternate-screen behavior used by full-screen applications, allowing the driver to observe and restore the main screen when supported by the implementation.

Limitations and notes

The driver depends on the target application’s terminal behavior and on the PTY environment where it runs. It is intended for interactive terminal programs, not ordinary noninteractive commands that only need standard input and output.

The README emphasizes confirming state after input because rapid key sequences can arrive before an application has processed earlier keys. Waiting for a visible condition can expose that timing issue.

SmartCLI drive-tui is MIT-licensed. The PyPI distribution name is smartcli-toolkit, while the importable Python package is smartcli_core.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about SmartCLI drive Tui

SmartCLI drive-tui is an MCP server that connects AI clients to interactive terminal programs through a PTY. Its main tools start and close sessions, send lines or keys, inspect the rendered screen, and wait for conditions such as regular expressions. It supports REPLs, TUIs, editors, and menu-driven command-line applications.

Install it with `pip install smartcli-toolkit`, then run `smartcli-mcp` as a stdio MCP server. Python 3.10 or newer is required.

Yes, the README names Cursor as an MCP client that can run the same drive-tui verbs. Configure `smartcli-mcp` as a stdio server in Cursor, then use it to operate interactive terminal programs through PTY sessions.

It can control interactive programs such as Python REPLs, vim, lazygit, and htop. The driver is intended for TUIs, REPLs, menus, and other applications that require terminal input and screen-state awareness.

It reads the terminal through a pyte cell model and can wait for a matching screen condition, including a regular expression. This lets an agent confirm that a prompt, output, menu, or other visible state appeared instead of relying only on a fixed delay.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewSmartCLI drive Tui AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/smartcli-drive-tui?style=directory)](https://allmcps.com/mcp/smartcli-drive-tui)
HTML Embed
<a href="https://allmcps.com/mcp/smartcli-drive-tui"><img src="https://allmcps.com/api/badge/smartcli-drive-tui?style=directory" alt="SmartCLI drive Tui on AllMCPs" /></a>