
raychao-oao/pty-mcp
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
インタラクティブなターミナルセッション用のMCPサーバー — ローカルシェル、SSH、シリアルポート、永続的なリモートセッション
概要
AIエージェントのインタラクティブなターミナルセッション — ローカルシェル、SSH、シリアルポート、および接続解除を存続する持続的なリモートセッションを提供する MCP (Model Context Protocol) サーバー。 実際のサーバーやデバイス管理、コード生成だけでなく、AIが実現したい人のために構築されました。 AIエージェントは、非インタラクティブなシェルでコマンドを実行します。 それらは: - SSHをサーバーにし、実行中のプロセスとやりとりすることができます - シリアルコンソールを介してルータまたはスイッチに接続 - モニターログと特定のイベントが発生したときに反応する - セッション状態を複数のコマンドに保つ - バックアップされたときにサーバーが再起動して検出するのを待ちます pty-mcp は、MCP 上で実際の PTY セッションを提供することで、これらすべてを解決します。 pty-mcp がなければ、AI エージェントは 30 の &&& check status ループをスリープし、CPU サイクルを燃焼し、物事を待ち受ける API 呼び出しをします。 wait for では、イベントが起きるまで、エージェントはサーバー側をブロックします。 ポーリングが少なく、エネルギーが少なく、極端の負担が良くなります.
概要(AI 翻訳)
AIエージェントのインタラクティブなターミナルセッション — ローカルシェル、SSH、シリアルポート、および接続解除を存続する持続的なリモートセッションを提供する MCP (Model Context Protocol) サーバー。
AIが、コード生成だけでなく、実際のサーバーやデバイス管理を手伝ってみたいな**sysadminとネットワークエンジニアのために構築されました。
なぜ
AIエージェントは、非インタラクティブなシェルでコマンドを実行します。 それらはできない:
- サーバーに SSH を入れ、実行中のプロセスとやり取り
- シリアルコンソールを介してルータまたはスイッチに接続
- 特定のイベントが発生したときにログを監視し、反応する
- 複数のコマンドを渡るセッション状態を保って下さい
- バックアップ時にサーバーを再起動して検出するのを待ちます
pty-mcp は、MCP 上で実際の PTY セッションを提供することで、これらすべてを解決します。
pty-mcp がなければ、AI エージェントは sleep 30 && check_status] ループに頼りに、CPU サイクルを燃焼させ、物事を待ち受ける API 呼び出しを行います。 [wait_for] で、イベントが起こるまでエージェントブロックサーバー側。 ポーリングが少なく、エネルギーが少なく、極端の負担が良くなります。 お問い合わせ
ユースケース
サーバー管理
ネットワークデバイス管理
ログ監視と警告
断線を乗り越える長時間のタスク
##特徴
| 特集 | 概要 |
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
pty-mcp
An MCP (Model Context Protocol) server that gives AI agents interactive terminal sessions — local shells, SSH, serial ports, and persistent remote sessions that survive disconnects.
Built for sysadmins and network engineers who want AI to help with real server and device management, not just code generation.
Why
AI agents run commands in non-interactive shells. They can’t:
- SSH into a server and interact with running processes
- Connect to routers or switches via serial console
- Monitor logs and react when a specific event occurs
- Keep session state across multiple commands
- Wait for a server to reboot and detect when it’s back up
pty-mcp solves all of these by providing real PTY sessions over MCP.
Without pty-mcp, AI agents resort to sleep 30 && check_status loops — burning CPU cycles and API calls waiting for things to happen. With wait_for, the agent blocks server-side until the event occurs. Less polling, less energy, better for polar bears. 🐻❄️
Use Cases
Server administration
# Reboot a server and wait until it's back online
create_local_session("ping myserver")
read_output(wait_for: "bytes from", timeout: 300)
→ blocks until server responds after reboot (~80s, one tool call)
Network device management
# Connect to a router via serial console
create_serial_session(port: "/dev/ttyUSB0", baud: 9600)
send_input("show interfaces status")
read_output(wait_for: "\\$")
Log monitoring and alerting
# Watch logs and act when something happens
create_ssh_session(host: "prod", user: "admin")
send_input("tail -f /var/log/app.log")
read_output(wait_for: "ERROR|CRITICAL", timeout: 3600)
→ returns the error line + context when it appears
Long-running tasks that survive disconnects
create_ssh_session(host: "server", user: "admin", persistent: true)
send_input("apt upgrade -y")
detach_session() → close Claude Code, task continues
# Reconnect later to check result
Features
| Feature | Description |
|---|---|
| Local terminal | Interactive bash/python/node sessions on local machine |
| SSH sessions | Connect to remote hosts with key/password auth, SSH config support |
| Serial port | Connect to devices via serial (IoT, embedded, network gear) |
| Persistent sessions | Sessions survive SSH disconnects via ai-tmux daemon |
| Attach/Detach | Detach from a running session, reconnect later |
| Control keys | Send ctrl+c, ctrl+d, arrow keys, tab, escape |
| Settle detection | Waits for output to settle before returning (smart timeout) |
| Pattern matching | wait_for blocks until a regex pattern appears in output (v0.2.0) |
インストール
This server does not publish a one-line install command.
Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →