Pty MCP logo

Pty MCP

by raychao-oao

Interactive MCP terminal sessions for local shells, SSH hosts, serial devices, and persistent remote workloads.

Install Pty MCP

Pick your client, then add it in one click or paste the config.

No confirmed install command yet

We only publish a config when the install details come from the project itself — its README, its docs, or a verified owner. We haven’t found those for raychao-oao/pty-mcp, and we’d rather show nothing than a guess you’d paste into your client.

Open setup steps on GitHub

Overview

raychao-oao/pty-mcp exposes interactive PTY sessions to AI agents over MCP, covering local shells, SSH connections, serial ports, and persistent remote sessions. A single Go binary communicates over JSON-RPC stdio and provides tools for sending input, reading settled or pattern-matched output, sending control keys, resizing terminals, and managing sessions. Persistent SSH sessions use an optional ai-tmux daemon so work can continue after detachment or client restarts. Reach for it when an agent must operate interactive terminals, monitor long-running commands, manage network devices over serial, or wait for remote events without polling.

Use cases

  • Open interactive local shells and language REPLs
  • Manage remote servers through persistent SSH sessions
  • Connect to routers and embedded devices over serial
  • Wait for log patterns or services to return after a reboot
  • Run long remote tasks that survive agent disconnection

Key features

  • Interactive local, SSH, and serial PTY sessions
  • Persistent remote sessions through ai-tmux
  • Pattern-based output waiting with timeouts and context
  • Control-key input and terminal resizing
  • GUI-mediated secret entry excluded from AI output
  • Optional redacted audit logging

Tools12

What Pty MCP lets your agent do. Expand a tool for its parameters.

Self-reported~210 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked 1d ago

Recent health check succeeded.

8/11 checks healthy over the last 79d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars20Stargazers on the source repository.
Last commit7d agoMost recent push to the default branch.
Tools exposed12Callable tools this server registers over MCP.
Directory activity9 viewsConfig copies, upvotes, and views on AllMCPs.

How Pty MCP works

What raychao-oao/pty-mcp does

raychao-oao/pty-mcp gives MCP-compatible AI agents access to interactive pseudo-terminals instead of one-shot command execution. It can open a local shell or interpreter, connect to a remote host through SSH, or attach to a serial device such as a router, switch, embedded system, or other hardware console.

The server is suited to workflows that require session state and live interaction: entering commands into a REPL, interrupting a running process, watching a log until a pattern appears, waiting for a reboot to complete, or running a task that must continue after the agent disconnects. Its send_secret operation displays a native prompt for the human operator and sends the entered value directly to the PTY; the secret is not returned to the AI context or written to logs.

How it works

The server runs as a single Go executable and exposes its MCP interface through JSON-RPC over stdio. A session manager maintains local, SSH, serial, and remote persistent session types. Local PTYs use the host system, SSH sessions use remote PTYs, and serial sessions communicate with a selected device port.

Output can be read after it settles or held until a regular-expression pattern appears. wait_for accepts a timeout and can return surrounding context or only the most recent lines, which supports log monitoring and long waits without repeated sleep-and-check calls. Session output uses bounded buffering to avoid unbounded memory growth during long-running activity.

Persistent mode connects over SSH to ai-tmux, whose remote daemon owns the PTY. Detaching the MCP session leaves that remote process running; a later session can list and reattach to it. Terminal dimensions can be changed for local, SSH, serial, and persistent sessions.

Setup and configuration

Claude Code can install the binary and register the MCP server through the project’s plugin marketplace:

Terminal
claude plugin marketplace add raychao-oao/pty-mcp
claude plugin install pty-mcp@pty-mcp

After installation, Claude Code must be restarted twice: once for the binary download and again to activate it. Updates use claude plugin marketplace update pty-mcp followed by claude plugin update pty-mcp@pty-mcp, with the same restart sequence.

A manual installation is also available for macOS, Linux, and WSL2. The installation script can place the executable at /usr/local/bin/pty-mcp, after which it can be registered with:

Terminal
claude mcp add pty-mcp -- /usr/local/bin/pty-mcp

Release binaries are provided for macOS Apple Silicon, macOS Intel, Linux x86_64, and Linux ARM64. Building from source requires Go 1.25 or later. Persistent remote sessions additionally require the ai-tmux binary on the target host.

Tools and capabilities

  • create_local_session starts an interactive local terminal, including bash, Python, or Node sessions.
  • create_ssh_session opens an SSH PTY, supports SSH config aliases, and can request persistent mode.
  • create_serial_session connects to a serial port with a selected baud rate.
  • send_input writes commands or interaction text and waits for output to settle.
  • read_output reads buffered output and can wait for a pattern with timeout, context-line, and tail-line options.
  • send_control sends control characters and terminal keys such as Ctrl-C, Ctrl-D, arrows, Tab, and Escape.
  • send_secret collects a value through a native GUI prompt and sends it without exposing the value to the AI.
  • list_sessions, close_session, detach_session, and resize_session manage active sessions.
  • list_remote_sessions finds persistent sessions on a remote host.

Optional audit logging can record send_input operations for review. Credentials, authentication headers, and PEM keys are redacted before being written to that log.

Limitations and notes

Persistent sessions depend on installing and running ai-tmux on the remote server. The documented installation flow targets macOS, Linux, and WSL2, with platform-specific release binaries. send_secret requires a supported native dialog environment, including macOS system dialogs, Windows credential prompts through WSL2, or Linux zenity/kdialog.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Pty MCP

raychao-oao/pty-mcp is an MCP server that connects AI agents to local shells, SSH hosts, serial devices, and persistent remote PTYs. Its main tools create sessions, send input or control keys, read settled or pattern-matched output, handle operator-entered secrets, resize terminals, and list, detach, reattach, or close sessions.

Install it through the Claude Code plugin marketplace or download a release and register the executable with `claude mcp add`. The project also provides an installation script for macOS, Linux, and WSL2, while source builds require Go 1.25 or later.

Yes. raychao-oao/pty-mcp uses the standard MCP stdio transport, so it can be configured in Cursor as a local MCP server. The documented setup specifically shows Claude Code registration, while other clients require their usual stdio-server configuration.

Create the SSH session with persistent mode enabled, then call `detach_session`. The remote PTY continues under an `ai-tmux` daemon, and you can later use `list_remote_sessions` and reconnect with the existing session identifier. `ai-tmux` must be installed on the remote host.

Yes. Call `send_secret` when the PTY requests a credential. A native GUI dialog collects the value from the human operator, sends it directly to the session, and returns only success and length information rather than the secret itself.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewPty MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/raychao-oao-pty-mcp?style=directory)](https://allmcps.com/mcp/raychao-oao-pty-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/raychao-oao-pty-mcp"><img src="https://allmcps.com/api/badge/raychao-oao-pty-mcp?style=directory" alt="Pty MCP on AllMCPs" /></a>