interactive-process-mcp
interactive-process-mcp
MCP-сервер для управления интерактивными процессами. Позволяет ИИ-агентам (Claude Code и др.) запускать долгоживущие интерактивные программы — SSH-сессии, REPL, установщики, инструменты impacket — и взаимодействовать с ними в течение нескольких шагов с помощью операций чтения/записи.
Возможности
Режимы PTY и Pipe — режим PTY эмулирует настоящий терминал (программы вроде SSH, top, vim работают корректно); режим pipe предназначен для более простого взаимодействия через stdin/stdout
Мультисессионность — управление несколькими интерактивными процессами одновременно
Очистка ANSI — опциональное удаление escape-кодов терминала для получения чистого вывода
Неблокирующее чтение — агент считывает вывод в своем собственном темпе с настраиваемыми тайм-аутами
Корректное завершение — SIGTERM с настраиваемым периодом ожидания перед SIGKILL
Related MCP server: MCP Shell Server
Требования
Python >= 3.10
Linux (использует модуль
pty)
Установка
pip install -e .Или с зависимостями для разработки (для запуска тестов):
pip install -e ".[dev]"Конфигурация
Claude Code
command
claude mcp add --scope user interactive-process -- interactive-process-mcpИли
Добавьте в настройки MCP Claude Code (.claude/settings.json или .mcp.json на уровне проекта):
{
"mcpServers": {
"interactive-process": {
"command": "interactive-process-mcp"
}
}
}Или при установке из исходного кода:
{
"mcpServers": {
"interactive-process": {
"command": "python",
"args": ["-m", "interactive_process_mcp"]
}
}
}Другие MCP-клиенты
Любой MCP-клиент, поддерживающий транспорт stdio, может использовать этот сервер. Точка входа:
interactive-process-mcp
# or
python -m interactive_process_mcpИнструменты
start_process
Запуск интерактивного процесса и получение информации о сессии.
Параметр | Тип | Обязательный | По умолчанию | Описание | |
| string | да | — | Команда для выполнения | |
| string[] | нет |
| Аргументы команды | |
| "pty" | "pipe" | нет |
| Режим ввода/вывода |
| string | нет | auto | Читаемое имя сессии | |
| string | нет | inherit | Рабочая директория | |
| object | нет | inherit | Переменные окружения | |
| number | нет |
| Тайм-аут запуска (секунды) | |
| integer | нет |
| Строки PTY (режим pty) | |
| integer | нет |
| Столбцы PTY (режим pty) |
Возвращает: { session_id, pid, initial_output }
send_input
Отправка текста в запущенный процесс.
Параметр | Тип | Обязательный | По умолчанию | Описание |
| string | да | — | ID сессии |
| string | да | — | Текст для отправки |
| boolean | нет |
| Добавить символ новой строки |
Возвращает: { success: true } или { error: "..." }
read_output
Чтение нового вывода с момента последнего чтения. Если новых данных нет, ожидает до timeout секунд. Возвращает пустое значение по истечении времени (не является ошибкой).
Параметр | Тип | Обязательный | По умолчанию | Описание |
| string | да | — | ID сессии |
| boolean | нет |
| Удалить ANSI escape-коды |
| number | нет |
| Время ожидания (секунды) |
| integer | нет |
| Макс. строк (0 = без ограничений) |
Возвращает: { output, has_more, lines_returned, bytes_returned }
send_and_read
Атомарная операция отправки и чтения. Отправляет ввод, делает небольшую паузу, затем возвращает новый вывод.
Объединяет параметры из send_input и read_output.
list_sessions
Список всех активных сессий.
Возвращает: { sessions: [{ id, name, command, status, pid, created_at }] }
terminate_process
Завершение запущенного процесса.
Параметр | Тип | Обязательный | По умолчанию | Описание |
| string | да | — | ID сессии |
| boolean | нет |
| SIGKILL вместо SIGTERM |
| number | нет |
| Секунды до SIGKILL |
resize_pty
Изменение размеров PTY (только в режиме pty).
Параметр | Тип | Обязательный | По умолчанию | Описание |
| string | да | — | ID сессии |
| integer | нет |
| Количество строк |
| integer | нет |
| Количество столбцов |
get_session_info
Получение подробной информации о сессии.
Параметр | Тип | Обязательный | Описание |
| string | да | ID сессии |
Возвращает: { id, name, command, args, mode, status, exit_code, pid, created_at }
Примеры использования
SSH-сессия
1. start_process(command="ssh", args=["user@host"], mode="pty")
→ { session_id: "abc123", initial_output: "user@host's password: " }
2. send_input(session_id="abc123", text="mypassword", press_enter=true)
→ { success: true }
3. read_output(session_id="abc123", timeout=5)
→ { output: "Welcome to Ubuntu...\n$ " }
4. send_and_read(session_id="abc123", text="ls -la", press_enter=true, timeout=3)
→ { output: "total 32\ndrwxr-xr-x ...\n$ " }
5. terminate_process(session_id="abc123")
→ { success: true }Python REPL
1. start_process(command="python3", mode="pty")
→ { session_id: "def456", initial_output: ">>> " }
2. send_and_read(session_id="def456", text="print(2 + 2)", press_enter=true)
→ { output: "4\n>>> " }Интерактивный установщик
1. start_process(command="sudo", args=["apt", "install", "some-package"], mode="pty")
→ { session_id: "ghi789", initial_output: "Do you want to continue? [Y/n] " }
2. send_input(session_id="ghi789", text="Y", press_enter=true)
→ { success: true }
3. read_output(session_id="ghi789", timeout=30)
→ { output: "Setting up some-package ...\n" }Архитектура
MCP Server (main thread — JSON-RPC over stdio)
├── Session reader thread → ring buffer → agent reads
├── Session reader thread → ring buffer → agent reads
└── Session reader thread → ring buffer → agent readsКаждая сессия запускает собственный фоновый поток чтения, который непрерывно считывает вывод процесса в кольцевой буфер (макс. ~1 МБ). Агент потребляет вывод в своем темпе через read_output / send_and_read.
Тестирование
pip install -e ".[dev]"
pytest tests/ -vЛицензия
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that enables coding agents to execute and manage long-running shell commands asynchronously with capabilities for process monitoring, interaction, and lifecycle management.Last updated713MIT
- Alicense-qualityFmaintenanceA secure MCP server for shell operations, terminal management, and process control, enabling AI assistants to safely execute commands and manage interactive sessions.Last updated1564MIT
- AlicenseAqualityFmaintenanceMCP server that gives AI agents real interactive terminal sessions for running REPLs, SSH, database clients, and any interactive CLI with clean text output and smart completion detection.Last updated79718MIT
- Alicense-qualityDmaintenanceMCP server that enables AI agents to run fully interactive SSH sessions (via tmux) and execute commands like a human operator, with persistent sessions and multiple concurrent connections.Last updated6MIT
Related MCP Connectors
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Personal assistant MCP server with search, execute, packages, jobs, secrets, and integrations.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/UserB1ank/interactive-process-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server