MCP server that exposes TUI (terminal user interface) automation capabilities through an authenticated daemon interface. Allows driving interactive terminal programs via perceive-act-confirm loop with persistent sessions.
This MCP server implements a sophisticated terminal session management interface with 11 well-defined tools. Strengths: all tools have clear, detailed descriptions (100-300+ chars each) that explain what, when, and consequences; all parameters have type declarations and descriptions; tool names follow verb_noun conventions (start, snapshot, send_text, etc.); output schemas are implicitly documented through description text (e.g., snapshot returns {ok, alive, alt_screen, text, hash, visual_hash}). Weaknesses: output schemas are NOT formally declared in JSON Schema format (evident from missing 'output' or 'returns' field in tool definitions); some parameter descriptions lack explicit constraint documentation (e.g., no min/max for cols/rows beyond brief mention in 'start' description); error handling guidance is minimal, tools describe what they do but not how to recover from failure; composition could be optimized (e.g., snapshot + wait_change pattern suggests a missing 'wait_and_snapshot' convenience tool). The codebase is from FastMCP, which does NOT expose formal output schemas in its tool registration API, limiting what can be statically verified. Per-tool analysis shows consistent quality, averaging 72/100.
Check whether a session and its child process are still alive.
Terminate a session and its daemon. Always close sessions when done.
List active drive-tui sessions. Returns {"ok", "sessions"}: each entry carries "sid", "port", "pid", "cmd", "cols", "rows", "cwd" and "started".
Resize the session's terminal to new dimensions.
Send special keys (arrows, Enter, Tab, etc.) or raw escape sequences to the session.
Type text followed by Enter — the common 'run this command' action.
Output schemas not formally documented. Tool descriptions mention return fields (e.g., 'Returns {ok, alive, alt_screen, text, hash, visual_hash}' for snapshot) but do not declare them in formal JSON Schema. LLMs cannot programmatically parse what fields to expect without explicit output schema.
Parameter constraints not explicitly stated. 'start' tool mentions 'terminal size capped at 1000 cols x 500 rows' in description but does not declare min/max in schema. 'sid' parameter constraint '[A-Za-z0-9][A-Za-z0-9_.-]*' is documented in text but not in a regex pattern field. Constraints in natural language require the LLM to parse and validate; formal constraints (enum, minLength, pattern, minimum, maximum) are machine-parseable.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | C | 61 | 2026-07-28+ | v2 |
Type literal text into the session (no Enter). Use for filling fields.
Read a semantic snapshot of the session's current screen. Returns {"ok", "alive", "alt_screen", "text", "hash", "visual_hash"}: `alt_screen` is true while a full-screen program (vim, less, htop, ...) owns the screen — keys are commands to that program, not input to a shell, and `text` is its frame rather than scrollback. `text` is the rendered screen; `json` (the structured cell/cursor model) is included only when as_json=true. `hash` covers text content only — use it as the wait_change baseline; `visual_hash` also covers styling, selection and cursor state — use it as the wait_visual_change baseline. Don't mix the two. This is the 'perceive' step — always snapshot after acting rather than assuming an action landed.
Spawn a program in a new detached, persistent session and return its id. The session survives across tool calls (a localhost-only daemon owns the live PtySession). `cmd` is the command line to spawn, e.g. "python3" or "lazygit". `cwd` and `env` configure only the controlled child process. Returns {"ok", "sid"} on success. Use the returned sid for every other tool. Server-side limits (violations return an error): at most 8 concurrent sessions by default (tunable via SMARTCLI_MAX_SESSIONS); `sid` must be 1-64 chars matching [A-Za-z0-9][A-Za-z0-9_.-]*; `env` keys must be valid identifiers and may not start with SMARTCLI_TUI_; `cwd` must be an existing directory; terminal size is capped at 1000 cols x 500 rows (100000 cells). Note: `env` values pass through the process command line briefly (visible in `ps`) — avoid secrets.
Block until the session's screen text changes or times out.
Block until the session's visual state changes (styling, cursor, selection) or times out.
Error recovery guidance absent. Tools declare their risks (IRREVERSIBLE, DESTRUCTIVE, WRITE, READ_ONLY) but do not explain how an agent should recover if a call fails. E.g., if 'start' fails due to SMARTCLI_MAX_SESSIONS limit, the tool should suggest 'Call list_sessions() to see active sessions and close() the ones you no longer need.' Agents need actionable recovery paths.
Missing dry-run or confirmation for irreversible operations. 'close' tool terminates a session and its daemon permanently. No 'confirm_before_close' pattern or 'dry_run' parameter offered. Agents can mistake a close call and kill user-critical sessions without a safety gate.
Pagination not offered for list_sessions. Tool description says 'returns entries' but does not limit result count. If many sessions are active, returning all of them wastes tokens. Should accept 'limit' and 'offset' parameters and return a 'total' count.
Parameter descriptions for send_keys lack detail on valid key names. Description says 'key names (e.g. 'Up Down Enter Tab') or raw escape sequences' but does not enumerate all supported key names or explain escape sequence syntax. An agent must guess whether 'Home' or 'home' or 'HOME' is valid, or whether '\x1b[H' vs '\033[H' works.