network-terminal-mcp
Manages persistent interactive SSH, Telnet, and local serial terminals through MCP.
Open sessions with SSH, Telnet, or serial commands; SSH uses local config, agent, keys, and options.
Write commands, pager keys, single keys, and control bytes to a live terminal, optionally without Enter.
Read only new terminal output with optional timeout; continue truncated output using offsets.
Read buffered output from a default or independent named cursor.
Send secrets via value, environment variable, or file, with redaction and no audit of secret values.
Inspect session state, command, timestamps, idle time, warnings, and exit status.
Close sessions while retaining final status.
Enables persistent interactive terminal sessions with Cisco IOS/IOS-XE network devices, including older 29xx/35xx hardware, over SSH, Telnet, TCP console, or local serial. Supports running commands, using CLI context help, and nested SSH/Telnet within the same session.
Enables persistent interactive terminal sessions with Huawei VRP devices and Huawei OLT platforms over SSH, Telnet, TCP console, or local serial. Allows command execution and nested session interactions without one-off scripts.
Enables persistent interactive terminal sessions with MikroTik RouterOS devices over standard SSH, allowing CLI command execution and session interaction through the MCP server.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@network-terminal-mcp open SSH session to 10.0.0.1 and run show ip interface brief"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
network-terminal-mcp
Локальный MCP-сервер для постоянных интерактивных терминалов. Модель открывает
сессию привычной командой ssh, telnet или serial, затем пишет в живой
поток команды, ?-подсказки, pager keys и вложенные ssh, а читает только
новый вывод.
Статус: 0.5.0 — command-only API, настоящий OpenSSH/Telnet в POSIX PTY,
локальный serial, конкретные ошибки, ограниченная по времени запись, метрики
простоя и секреты без обязательного pass.
В 0.3.0 ответы MCP стали компактнее; клиенты, использующие удалённые поля
ответов 0.2.1, необходимо адаптировать. Полные данные сессии — в session_status.
SSH/Telnet автоматически отвечают на запрос позиции курсора (DSR). Enter
отправляет \r; при необходимости точного \n используйте enter=false.
Подробности и ограничения — в
руководстве.
Открытие сессии
Единственный аргумент:
{"command": "ssh -J operator@bastion.example.net operator@192.0.2.10"}{"command": "telnet 192.0.2.30 23"}{"command": "serial /dev/ttyUSB0 115200"}SSH использует локальные ~/.ssh/config, agent, ключи, ProxyJump, ProxyCommand
и любые опции OpenSSH. Аргументы передаются клиенту без фильтрации; shell не
используется. ready означает, что процесс запущен, а не что логин завершён:
banner и prompt читаются через terminal_read.
Related MCP server: shell-session-mcp
Основной цикл
open_session("ssh operator@192.0.2.10")
terminal_read(session_id) # banner / login prompt
terminal_write(session_id, "show version")
terminal_read(session_id)
terminal_write(session_id, "show interface brief")
terminal_read(session_id)
close_session(session_id)terminal_readвозвращает только новый вывод и не повторяет историю.При
truncated=trueпродолжайте сnext_output_offsetчерезread_output.terminal_write(..., enter=false)отправляет одиночные клавиши и control bytes.Пароли и passphrase вводятся только через
terminal_write_secretс одним источником:value,envилиfile.
Нестабильные соединения
ready означает, что жив локальный процесс клиента, а не что удалённая
сторона отвечает. Для SSH добавляйте контроль связи:
ssh -o ConnectTimeout=10 -o ServerAliveInterval=15 -o ServerAliveCountMax=3 operator@192.0.2.10После сна ноутбука, смены Wi-Fi/VPN или долгой паузы закройте и переоткройте
подозрительные сессии: запись в полуразрушенное TCP-соединение может выглядеть
успешной. terminal_read ограничен timeout, terminal_write — 10 секундами;
session_status показывает last_output_at и idle_seconds. Подробнее:
эксплуатация.
Для одноразового ssh host 'command' обычный shell остаётся проще. MCP нужен
для живого терминала, pager, нескольких команд с сохранением состояния,
password prompts, вложенных переходов и Serial.
Установка
uv tool install network-terminal-mcp
network-terminal-mcp checkОбновление:
uv tool upgrade network-terminal-mcpПроверка показывает версию, наличие ssh/telnet, pyserial и доступность
audit-каталога. Обязательных конфигурационных файлов нет.
OpenCode V2
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"servers": {
"network-terminal": {
"type": "local",
"command": ["/home/USER/.local/bin/network-terminal-mcp"],
"codemode": false,
"disabled": false
}
}
}
}codemode: false оставляет все инструменты, включая open_session, в native
tool list. Если ~/.local/bin уже в PATH, достаточно
["network-terminal-mcp"].
Документация
Текущая документация — архитектура, эксплуатация, безопасность, тесты и результаты проверок.
Инструкция для модели — MCP instructions и ресурс
network-terminal://usage.Backlog — только необязательные направления после реальной эксплуатации.
История — завершённые планы и реализация 0.1.x, не руководство.
Разработка
Требуются Python 3.12+, uv и POSIX/Linux.
uv sync
uv run ruff check .
uv run mypy src
uv run pytestНе добавляйте в репозиторий реальные адреса, hostnames, usernames, fingerprints, секреты или production transcripts.
Available Tools
7 toolsclose_sessionB
Close the terminal and child process, retaining its final status.
Inputs: session_id (required). Returns: error, state, exit_code
open_sessionA
Open a persistent terminal: ssh, telnet, or serial DEVICE [BAUDRATE].
No shell is involved. SSH uses the local client, config, agent and keys.
Inputs: command (required). Returns: error, state, warnings, session_id
read_outputC
Read buffered output from the default or an independent named cursor.
Inputs: session_id (required), limit, offset, reader_id. Returns: offset, output, truncated, next_offset, +1 more
session_statusC
Return state, command, timestamps, idle time, warnings, and exit status.
Inputs: session_id (required). Returns: Serializable session metadata returned by MCP tools.
terminal_readB
Read only new output until quiet or timeout; no prompt shape required.
If truncated, continue with read_output or next_output_offset.
Inputs: session_id (required), timeout. Returns: output, truncated, next_output_offset
terminal_writeA
Write input, appending a line terminator unless enter=false.
Input is audited after known-secret redaction; use terminal_write_secret for passwords. Timeout fails the session and may mean a partial write.
Inputs: data (required), session_id (required), enter. Returns: ok, state
terminal_write_secretA
Send a secret from exactly one source: value, env, or file.
Prefer env or file; plaintext value remains in client history. The server redacts known secrets and never returns or audits the secret value.
Inputs: session_id (required), env, file, value. Returns: ok, state
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool maps to a distinct operation (open, close, status, write, secret write, read), but terminal_read and read_output both read output and only their descriptions distinguish incremental-vs-buffered semantics. The terminal_read description explicitly redirects to read_output for truncation, which mitigates most of the confusion.
Most names follow verb_noun, but the set mixes a 'terminal_' prefix (terminal_write, terminal_read, terminal_write_secret) with unprefixed session verbs (open_session, close_session) and an unprefixed read (read_output). session_status breaks the verb_noun pattern entirely, though all names remain readable and domain-specific.
Seven tools is well-scoped for persistent terminal session management: lifecycle, I/O, secret-safe input, and status each earn a slot with no filler.
The session lifecycle (open, write, read, status, close) is fully covered, including a thoughtful secret-handling path. Gaps are minor: no explicit signal/interrupt or resize operation, and no way to enumerate multiple concurrent sessions even though named read cursors are supported.
Maintenance
Related MCP Connectors
Protocol-native energy infrastructure orchestration for AI data centers. Provides 46 MCP tools across 8 grid protocols (IEC-61850, DNP3, Modbus, OCPP, OpenADR, IEEE 2030.5, IEC 60870-5-104, ICCP) with 5 core API primitives: connect, dispatch, settle, comply, and intel. Enables AI agents to programmatically interact with substations, grid interfaces, and energy assets for real-time workload-grid coordination.
Connect ChatGPT and Claude to your Mac, Windows or Linux with secure MCP remote access.
Termalin's hosted MCP server. Claude, ChatGPT or any MCP client runs commands, moves files over SFTP, queries databases and reads server metrics and monitoring alerts on your servers, keylessly through Termalin Connectors: no SSH key is handed over and no inbound port is opened. Per-host command policy and an audit log. Needs a termal.in Pro or Team account (new accounts start with a 14-day Pro trial).
Secure and manage MCP servers through the Speakeasy AI Control Plane from your agent.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceTerminal-first SSH access for MCP clients and AI agents, enabling interactive remote sessions, file uploads, and stateful workflows.18 npm1MIT
- AlicenseNot gradedqualityDmaintenanceProvides persistent interactive shell sessions via pseudo-terminals for MCP agents, enabling bidirectional communication, incremental reads, and stateful command execution across steps.9 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to have persistent, fully interactive SSH sessions into remote hosts, behaving like a local terminal.15 npm2MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to interact with real terminal sessions across local and remote hosts, driving multi-turn interactive programs like TUIs, REPLs, and SSH prompts through MCP.68MIT