Skip to main content

network-terminal-mcp

PyPI CI License: MIT

Локальный MCP-сервер для постоянных интерактивных терминалов. Модель открывает сессию привычной командой ssh, telnet или serial, затем пишет в живой поток команды, ?-подсказки, pager keys и вложенные ssh, а читает только новый вывод.

Статус: 0.2.0 — command-only API, настоящий OpenSSH/Telnet в POSIX PTY, локальный serial, конкретные ошибки и секреты без обязательного pass.

Открытие сессии

Единственный аргумент:

{"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.

Основной цикл

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.

Для одноразового 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
      }
    }
  }
}

codemode: false оставляет все инструменты, включая open_session, в native tool list. Если ~/.local/bin уже в PATH, достаточно ["network-terminal-mcp"].

Документация

Разработка

Требуются Python 3.12+, uv и POSIX/Linux.

uv sync
uv run ruff check .
uv run mypy src
uv run pytest

Не добавляйте в репозиторий реальные адреса, hostnames, usernames, fingerprints, секреты или production transcripts.

Metadata

Release files for network-terminal-mcp 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for network-terminal-mcp 0.2.0
File Size Uploaded Provenance Actions
network_terminal_mcp-0.2.0.tar.gz 147.9 kB With provenance Details for network_terminal_mcp-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for network-terminal-mcp 0.2.0
File Interpreter ABI Platform Actions
network_terminal_mcp-0.2.0-py3-none-any.whl Python 3 none any Details for network_terminal_mcp-0.2.0-py3-none-any.whl

Total release size: 176.1 kB

Release files / network_terminal_mcp-0.2.0.tar.gz

Download URL network_terminal_mcp-0.2.0.tar.gz
Size 147.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a2f7a435f49f27e987d7e5542cb92c83ceb845abd9655b9436f777c03c8b4c7e
BLAKE2b-256 checksum
How to use checksums
e441b254046ed7e5781e8e9507407e2b1d1f99799d6e2e946b35f48a12d62cf0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / network_terminal_mcp-0.2.0-py3-none-any.whl

Download URL network_terminal_mcp-0.2.0-py3-none-any.whl
Size 28.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3448c0a7d3e92653c8d2d9207e213b2963ea8a671397562fef4be126569622df
BLAKE2b-256 checksum
How to use checksums
63905b0ab5c9dbe6bdb979b1f0fad8c5fc19051255a0a44c883a2bf51269fc91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Security for network-terminal-mcp 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for network_terminal_mcp-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page