Back to Home
nfshanq icon

ptyctl

Verified Safe

by nfshanq

Overview

Provides a Rust-based MCP server for remote interactive control over SSH and Telnet sessions, enabling agents to manage remote systems.

Installation

Run Command
ptyctl serve --transport stdio

Environment Variables

  • PTYCTL_TRANSPORT
  • PTYCTL_HTTP_LISTEN
  • PTYCTL_LOG_LEVEL
  • PTYCTL_CONTROL_SOCKET
  • PTYCTL_CONTROL_MODE
  • PTYCTL_AUTH_TOKEN
  • XDG_RUNTIME_DIR
  • PTYCTL_REPO

Security Notes

The server uses `portable-pty` to wrap the system's OpenSSH client. The `ssh_options.extra_args` parameter in `ptyctl_session` allows passing arbitrary arguments to the underlying `ssh` command, which could be a vector for exploitation if an untrusted client or an exploited LLM provides malicious arguments (e.g., `LocalCommand` directives in `ssh_config`). However, arguments are passed as a `Vec<String>`, mitigating simple shell injection within individual arguments. Temporary files for private keys are handled with correct permissions (0o600). HTTP transport includes bearer token authentication. The control socket is local and read-only by default. Overall, it's robust, but usage with untrusted inputs for `extra_args` requires caution.

Similar Servers

Stats

Interest Score0
Security Score7
Cost ClassLow
Avg Tokens2000
Stars0
Forks0
Last Update2026-01-19

Tags

SSHTelnetMCPRemote ControlInteractive