OctSSH
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., "@OctSSH run 'df -h' on web-server"
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.
OctSSH
I was just VibeCoding and suddenly thought: Why can't I just let my agent deploy code to the server for me?
So, I built OctSSH.
OctSSH is an MCP server that gives LLMs safe, controllable, and stateful access to shell environments.
Note
By default (stdio mode), OctSSH only connects to machines already configured in your local ssh_config for passwordless login.
So... what makes OctSSH special?
Async Support
OctSSH provides a complete set of async tools to prevent LLMs from timing out on long-running tasks:
Tool | Description |
| Run short commands synchronously |
| Run synchronously as root ( |
| Run long tasks in background (screen) |
| Run background tasks as root |
| Write to stdin of a running async task |
| Inspect async task output |
| Search task logs |
| Terminate a task |
| Pause (useful for polling) |
Note: In HTTP Serve mode, these tools operate directly on the local machine, and the
machineparameter is omitted.
Related MCP server: SSH MCP Server
Security Design
OctSSH features a Virtual Mode and Confirm Code verification flow:
π Safety Mechanism: Virtual Mode
We don't want AI to become a world-ending terminator, so we designed Virtual Mode.
When the AI attempts the following, OctSSH will not execute immediately, but instead returns a confirm_code:
π File Overwrite: Uploading to a path that already exists.
π High-Risk Commands:
rm -rfand similar "delete everything" commands.π Regex Blocklist: Custom sensitive patterns defined in config.
Execution Flow Example:
AI calls
exec("web", "rm -rf /var/www/html")π OctSSH intercepts: Recursive delete detected -> Returns
confirm_code: a1b2c3+ file impact preview.π€ User reviews and tells AI: "Confirm execution".
β AI calls
exec("web", "rm -rf /var/www/html", "a1b2c3")-> Actually executes.
Quick Start
Installation
npm install -g @aliyahzombie/octssh
octssh initUsage Modes
1. Default Client Mode (stdio)
Runs locally and controls remote machines via SSH (reads ~/.ssh/config):
octsshRemote command shell
Remote commands use sh -lc by default. Set OCTSSH_REMOTE_SHELL on the
OctSSH process to use another remote shell for synchronous, sudo, and async
commands:
export OCTSSH_REMOTE_SHELL=bash
octsshThe value may be an executable name or path, such as bash, /bin/bash, or
zsh. The selected shell must exist on every target machine and support the
-lc options. This setting only affects SSH client mode; HTTP Serve mode uses
OCTSSH_SHELL instead.
2. Streamable HTTP Server Mode (Local Control)
Install this on the target server. It exposes the server to LLMs via a secure HTTP interface. In this mode, OctSSH controls the local machine directly (no outbound SSH).
octssh serveDefault Listen:
127.0.0.1:8787(Override viaOCTSSH_SERVE_HOST/OCTSSH_SERVE_PORT)Auth: Prints a random key on startup. Clients must send header
X-OctSSH-Key: <key>.Set fixed key:
export OCTSSH_SERVE_KEY="my-secret"
Tool Changes: Tools run on this machine.
machineparameter is omitted. SSH transfer tools (upload/download) are disabled.
Windows notes (serve mode)
On Windows, OctSSH serve will auto-select a local shell in this order:
sh(if available, e.g. Git-Bash/MSYS)pwshpowershellcmd
Override with:
set OCTSSH_SHELL=powershellTool Prefix (optional)
To avoid tool name collisions when you run multiple OctSSH instances, you can prefix all exposed tools:
export OCTSSH_TOOL_PREFIX="us1_"Example: list becomes us1_list.
write-stdin (async interactive input)
write-stdin lets you send input to a running exec-async session.
Typical flow:
Start a long-running command that reads stdin (via
exec-async)Send data with
write-stdin(session_id, data)Poll output with
get-result(session_id)
Notes:
Default
append_newlineistrue.Max payload is 64KiB per call.
This is a streaming stdin: EOF is not sent. If the program exits on EOF, cancel the session instead.
If you set
OCTSSH_TOOL_PREFIX, tool names are prefixed too (e.g.us1_write-stdin).
MCP Client Configuration
General (stdio)
Add to your MCP client config:
{
"mcpServers": {
"octssh": {
"command": "octssh",
"args": [],
"env": {
"OCTSSH_REMOTE_SHELL": "bash"
}
}
}
}Claude Code CLI
claude mcp add octssh -- octsshOpenCode CLI
{
"mcp": {
"octssh": {
"type": "local",
"command": "octssh",
"args": [],
"enabled": true
}
}
}Or:
opencode mcp add octssh --command octsshThis project connects to real servers (or executes on the local machine). Please carefully review LLM operations. Using this project means you agree that the developer is not responsible for any accidental damage.
Available Tools
15 toolscancelCancel Async SessionB
Terminate a running async session by session_id (signal is optional).
Inputs: session_id (required), signal.
downloadDownload Files/DirectoryA
Download a file or directory from the remote machine. Never overwrites local files; on conflict, you must choose a new local directory.
Inputs: machine (required), localPath (required), remotePath (required).
download-asyncDownload AsyncB
Async download. Only creates a session if the transfer actually starts. Never overwrites local files.
Inputs: machine (required), localPath (required), remotePath (required).
execExecute CommandB
Execute a command on a machine (no sudo).
Inputs: command (required), machine (required), confirm_code.
exec-asyncExecute AsyncB
Execute a long-running command in background (remote screen session).
Inputs: command (required), machine (required), confirm_code.
exec-async-sudoExecute Async (sudo)C
Execute a long-running command in background using passwordless sudo.
Inputs: command (required), machine (required), confirm_code.
get-resultGet Async ResultB
Get async command status; optionally tail last N lines from logs.
Inputs: session_id (required), lines.
grep-resultSearch Async LogsC
Search async stdout/stderr logs by pattern.
Inputs: pattern (required), session_id (required), maxMatches, contextLines.
infoMachine InfoA
Get cached (or refreshed) extended info for a machine via SSH.
Inputs: machine (required), refresh.
listList SSH HostsA
List configured SSH hosts from local ssh_config. Optionally return cached extended fields.
Inputs: no named parameters.
sleepSleepA
Sleep for a duration (ms).
Inputs: time (required).
sudo-execExecute Command (sudo)B
Execute a command on a machine using passwordless sudo (sudo -n).
Inputs: command (required), machine (required), confirm_code.
uploadUpload Files/DirectoryA
Upload a file or directory to the remote machine. Refuses to overwrite unless confirm_code is provided after a conflict preview.
Inputs: machine (required), localPath (required), remotePath (required), confirm_code.
upload-asyncUpload AsyncB
Async upload. Only creates a session if the transfer actually starts. Uses the same overwrite confirmation logic as upload.
Inputs: machine (required), localPath (required), remotePath (required), confirm_code.
write-stdinWrite to Async stdinB
Write data to a running async session stdin. Works for exec-async sessions (remote screen).
Inputs: data (required), session_id (required), append_newline.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 15 tools
Most tools are clearly distinct: exec vs exec-async vs sudo variants separate sync/async and privilege. A few pairs could cause confusion, such as list vs info (both fetch host data) and get-result vs grep-result (both inspect async logs), but descriptions clarify their different purposes.
Tool names consistently use lowercase hyphenated words (exec-async, upload-async, get-result, write-stdin). However, the placement of 'sudo' varies: sudo-exec puts it first while exec-async-sudo puts it last, which is a minor inconsistency.
15 tools is well-scoped for an SSH server, covering synchronous/async execution, sudo variants, file transfer, session management, and host info. Each tool serves a clear purpose without feeling bloated or sparse.
The domain of remote SSH operations is fairly complete: exec, sudo, upload/download (sync and async), session status/log retrieval, and host listing. Minor gaps include no file-browsing or interactive shell, but core workflows are well covered.
Related MCP Connectors
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Scoped, audited SSH exec, sessions, and SFTP on your saved servers without exposing credentials
Work on your own computers from Claude or ChatGPT: run commands, edit and search files.
Let AI operate servers without SSH. Choose actions, approve risky changes, and audit every step.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables LLMs to interact with remote servers via SSH, supporting command execution, file upload/download, and directory listing.7MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to securely execute commands, transfer files, and manage port forwarding on remote servers via SSH.158 npm38Apache 2.0
- FlicenseAqualityCmaintenanceEnables LLMs to securely SSH into remote servers, execute commands, and manage files via SFTP including listing, reading, writing, deleting, and renaming files.11-
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to securely execute commands on remote hosts via SSH and SFTP, with persistent shells, file transfers, screenshots, and an audit log.5MIT