MCP server interactive-cli
Коммит 4 нояб. 2026 г.Позволяет ИИ-агентам взаимодействовать с процессами в терминале, используя псевдотерминал и headless xterm рендеринг для обработки интерактивных запросов и REPL.
Также известен как ohernandezdev/interactive-cli
- Звёзды
- 1
- Инструменты
- 9
- Загрузки, 30 дней
- —
- Последняя версия
- —
- Последний коммит
- 4 нояб. 2026 г.
- Лицензия
- MIT
Что такое interactive-cli MCP?
interactive-cli — это MCP server. Позволяет ИИ-агентам взаимодействовать с процессами в терминале, используя псевдотерминал и headless xterm рендеринг для обработки интерактивных запросов и REPL. Он предоставляет 9 инструментов, например spawn, send_input, send_keys.
Сводка сгенерирована из README проекта
О interactive-cli MCP server
Этот MCP server позволяет ИИ-агентам управлять интерактивными процессами в терминале, такими как установщики, SSH-сессии или REPL. В то время как стандартные инструменты командной строки часто приводят к зависанию агентов при ожидании ввода пользователя, этот сервер использует настоящий псевдотерминал и headless xterm рендеринг для предоставления чистого текстового представления экрана. Это позволяет агенту видеть запросы, перемещаться по меню и вводить ответы так же, как это делал бы человек.
Разработчики могут использовать это решение на macOS или Linux с любым MCP клиентом, поддерживающим stdio, включая Claude Code, Cursor, Windsurf и Codex. Сервер предоставляет специальные инструменты, такие как spawn для запуска процесса, send_keys для имитации навигации с клавиатуры и send_input для ввода текста в формы. Он также включает инструмент wait_for, который использует регулярные выражения для отслеживания определенных паттернов, например, завершения сборки или появления ошибок.
Поскольку сервер выполняет команды через вашу локальную оболочку, агент работает с вашими текущими правами доступа. Чтобы не перегружать клиент, объем снимков экрана ограничен 80 000 символами, а система поддерживает буфер прокрутки на 1 000 строк.
Что вы можете с ним делать
- 1Автоматизация сложных процессов сборкиВы можете дать агенту команду запустить сборку и ждать появления конкретного сообщения об успехе или ошибке.
Взято из README проекта. Каждый вариант использования проверен на соответствие цитате из него.
Инструменты interactive-cli MCP 9
Определено из READMEspawnsend_inputsend_keysget_screenwait_forwait_for_exitresizelist_sessionsclose
| spawn | — | |
| send_input | — | |
| send_keys | — | |
| get_screen | — | |
| wait_for | — | |
| wait_for_exit | — | |
| resize | — | |
| list_sessions | — | |
| close | — |
Автоматические проверки
Запущено 14 нояб. 2026 г.Полный отчёт →Еще не проверено. Для сервера требуется оценка 80, отсутствие серьезных проблем и достаточно данных для нашей проверки. Как работают проверки · Что исправить, чтобы получить больше баллов
- Связанный и доступный исходный репозиторийohernandezdev/interactive-cli is public and reachablegithub.com/ohernandezdev/interactive-cli ↗Пройдено
- Пакет указывает этот репозиторий как источникНе проверялось
- Происхождение сборки (аттестация Sigstore)Не проверялось
- Open source лицензия (OSI)MITspdx.org/licenses/MIT.html ↗Пройдено
- Коммит или релиз за последний годLast commit or release 2026-11-04github.com/ohernandezdev/interactive-cli ↗Пройдено
- OpenSSF ScorecardНе проверялось
- Имя пакета не похоже на популярный пакетНе проверялось
- Нет критических предупреждений в пакете или его зависимостяхНе проверялось
- Нет скрытых инструкций для модели9 tool descriptions and the README read; no override phrases, credential paths or hidden charactersПройдено
- Деструктивные инструменты помеченыNo tool named like delete, drop or execПройдено
- Удалённая конечная точка отвечает на рукопожатие MCPНе проверялось
README
Открыть на GitHubinteractive-cli
An MCP server that runs commands in a real pseudo-terminal and hands your AI agent the rendered screen, so it can answer prompts, pick menu items and drive REPLs, SSH and installers the way you would.
Site: https://ohernandezdev.github.io/interactive-cli/
Works with Claude Code, Codex, Cursor, Windsurf, or any MCP client that speaks stdio.
Why
A shell tool sends a command and waits for it to finish. An interactive command never finishes: it waits for a person. The agent hangs, times out or kills it, and you end up typing the answer yourself.
$ npm init
package name: (my-app)
waiting for input…
interactive-cli bridges that gap. It spawns the process in a PTY, renders the screen with xterm headless (clean text, no ANSI escape soup), and lets the agent send input or keys and wait for patterns.
Install
Requires Node 18 or later, on macOS or Linux.
Claude Code
claude mcp add interactive-cli -- npx -y interactive-cli-mcp
Codex CLI
codex mcp add interactive-cli -- npx -y interactive-cli-mcp
This writes [mcp_servers.interactive-cli] with command = "npx" and args = ["-y", "interactive-cli-mcp"] to ~/.codex/config.toml.
Cursor
Add this to ~/.cursor/mcp.json:
{
"mcpServers": {
"interactive-cli": {
"command": "npx",
"args": ["-y", "interactive-cli-mcp"]
}
}
}
Any MCP client
Point a stdio MCP client at:
npx -y interactive-cli-mcp
From source
git clone https://github.com/ohernandezdev/interactive-cli.git
cd interactive-cli
npm install && npm run build
claude mcp add interactive-cli -- node /absolute/path/to/interactive-cli/dist/index.js
What a session looks like
An illustrative eas build session. The agent calls the tools; the server answers with the rendered screen.
spawn("eas build --platform ios")
? Select a build profile ›
❯ development
preview
production
get_screen()
(same screen)
send_keys(["down", "down", "enter"])
✔ Selected profile: production
? Do you want to log in to your Apple account? › (Y/n)
send_input("y")
✔ Logged in
Building…
wait_for("Build complete|error", 600000)
✔ Build complete
close()
exit 0
(sessionId is omitted above for brevity; every call after spawn takes the id that spawn returned.)
Tools
| Tool | Parameters (defaults) | Read-only |
|---|---|---|
spawn |
command, cwd?, env?, cols = 120, rows = 30, waitMs = 2000 |
No |
send_input |
sessionId, text, pressEnter = true, waitMs = 2000 |
No |
send_keys |
sessionId, keys[], delayBetweenMs = 50, waitMs = 1500 |
No |
get_screen |
sessionId, search?, waitMs = 500 |
Yes |
wait_for |
sessionId, pattern, timeoutMs = 30000, intervalMs = 1000 |
No |
wait_for_exit |
sessionId, timeoutMs = 30000 |
No |
resize |
sessionId, cols, rows |
No |
list_sessions |
none | Yes |
close |
sessionId |
No |
spawnruns the command as$SHELL -c "<command>"(/bin/zshwhenSHELLis unset), so pipes, redirects and builtins work.envis merged with the current environment.waitMsis how long to wait for the first output.send_inputappends Enter unlesspressEnterisfalse, which types without submitting (useful for forms and password fields).send_keyssends the keys in order withdelayBetweenMsbetween them, then waitswaitMs.get_screenwaitswaitMsbefore capturing (default 500;0for an instant capture).searchis a regex: the result adds the matching lines with 2 lines of context.wait_fortakes a regex, matched case-insensitively. Use a longtimeoutMsfor builds.closesends SIGTERM, then SIGKILL if needed, and returns the final screen.spawn,send_input,send_keysandcloseare annotated as destructive, so clients such as Claude Code ask before using them.get_screenandlist_sessionsare annotated read-only.- Every result is JSON.
Keys
send_keys accepts: enter tab escape space up down left right backspace delete home end page_up page_down f1 to f12 ctrl+c ctrl+d ctrl+z ctrl+l ctrl+a ctrl+e ctrl+r ctrl+w ctrl+u ctrl+k ctrl+p ctrl+n y n 0 to 9
Resources
interactive-cli://sessions: JSON list of all sessionsinteractive-cli://sessions/{sessionId}/screen: live screen content of a session (text/plain)
Prompts
Prompt templates for common flows. In Claude Code they appear as slash commands (/mcp__interactive-cli__eas_build).
| Prompt | Arguments |
|---|---|
eas_build |
platform? (default ios), profile? (default production), cwd? |
ssh_session |
host (user@hostname), commands? (semicolon-separated) |
repl_session |
command (python3, node, psql, ...), setup? (semicolon-separated) |
docker_interactive |
image, shellCmd? (default /bin/sh) |
eas_build runs eas build --platform <platform> --profile <profile> --auto-submit. docker_interactive runs docker run -it <image> <shellCmd>.
How it works
graph LR
A[AI Agent] <-->|MCP Protocol| B[interactive-cli server]
B --> C[Session Manager]
C --> D[node-pty<br/><i>real PTY</i>]
C --> E[xterm headless<br/><i>screen render</i>]
C --> F[Truncation<br/><i>80K limit</i>]
D <--> G[Child Process<br/>ssh, eas, python...]
- node-pty spawns a real pseudo-terminal (
xterm-256color), so the child process behaves as it does in your terminal. - xterm headless keeps a virtual terminal (1,000 lines of scrollback) and renders it into a clean 2D text grid.
- Screens are capped at 80,000 characters, cut in the middle with a marker so the start and the end survive. Claude Code caps tool results at 100,000.
Typical flow:
sequenceDiagram
participant Agent as AI Agent
participant MCP as interactive-cli
participant PTY as Process (PTY)
Agent->>MCP: spawn("eas build --platform ios")
MCP->>PTY: Start process in PTY
PTY-->>MCP: Initial output
MCP-->>Agent: sessionId + screen
Agent->>MCP: send_keys(["down","down","enter"])
MCP->>PTY: ↓ ↓ ⏎
PTY-->>MCP: "✔ Selected profile: production"
MCP-->>Agent: updated screen
Agent->>MCP: wait_for("Build complete|error", 600000)
PTY-->>MCP: "✔ Build complete"
MCP-->>Agent: matched + screen
Agent->>MCP: close(sessionId)
MCP->>PTY: SIGTERM
MCP-->>Agent: final screen + exit code
Limits
- macOS and Linux only. Commands run through your shell (
$SHELL -c), and Windows is not supported. - Any screen in a result is capped at 80,000 characters.
- Scrollback is 1,000 lines.
- The agent runs commands with your permissions, in your shell. Review what your client approves.
Development
npm install
npm run build
node dist/index.js
Dependencies: @modelcontextprotocol/sdk, node-pty, @xterm/headless, zod.
License
MIT
Вопросы о interactive-cli MCP
Какие инструменты предоставляет interactive-cli MCP?
Он предоставляет 9 инструментов, включая spawn, send_input, send_keys, get_screen, wait_for.
Какие операционные системы поддерживаются?
Сервер работает только на macOS и Linux; Windows не поддерживается.
Может ли агент обрабатывать интерактивные запросы, такие как npm init?
Да, он запускает процессы в PTY и отрисовывает экран, чтобы агент мог отвечать на вопросы и выбирать пункты меню.
Как сервер обрабатывает большие объемы вывода терминала?
Размер экрана ограничен 80 000 символов, чтобы гарантированно уложиться в лимиты, а история прокрутки ограничена 1 000 строк.