rhost
Enables agents and scripts to operate SSH-reachable Linux hosts over standard OpenSSH, including foreground command execution, recoverable background Runs, bounded file reads/search, compare-and-swap file edits with rollback, file transfers, and persistent tmux sessions.
Manages persistent tmux sessions on remote hosts, providing stateful shells, REPLs, and debuggers that survive disconnects through CLI, JSON, and MCP session operations.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
rhost
Operate SSH-reachable Linux hosts from coding agents or scripts over standard OpenSSH.
rhost gives coding agents (Claude Code, Codex, or any stdio MCP client) and CLI scripts local-like execution semantics over your existing OpenSSH setup: foreground commands, recoverable background Runs, compare-and-swap file edits with rollback, and persistent tmux sessions—backed by one capability layer (CLI, schema-v8 JSON, and stdio MCP), with zero remote daemon and zero remote Python.
Claude Code / Codex / CLI / JSON (schema v8)
-> local OpenSSH (~/.ssh/config, ssh-agent, host keys, ControlMaster)
-> standalone C99 remote helper / tmux (recoverable Runs, CAS files, PTYs)Why it's built this way
OpenSSH instead of a custom SSH stack: Reuses
~/.ssh/config(aliases,ProxyJump,Match),ssh-agent, strict host-key verification, andControlMaster(ControlPersist=15m).rhostnever prompts for passwords, stores keys, or weakens host-key checks.Survives disconnects and timeouts: Long-running jobs (
run start/rhost_run) execute under a standalone remote monitor with durable state under~/.local/state/rhost/v5(RHOST_REMOTE_STATE). Client timeouts or cancellations only stop local observation, and uncertain submissions deduplicate safely.Bounded reads and safe file edits: File reads default to 8 KiB (
8192bytes) and Run/session log previews default to 4 KiB (4096bytes) with byte cursors (run watchfollows both streams) instead of flooding agent context. File replacements verify whole-file SHA-256 and record changesets for rollback (fs undo).C99 helper instead of remote Python: Native file operations and recoverable Runs run through a standalone C99 binary (
helper/) cached privately at~/.cache/rhost/helper/. Preparation reuses a valid cache, compiles with an existing remote C99cc, or uploads a SHA-256-verified static Linux musl release binary (linux-x86_64,linux-aarch64), with no remote daemon and no package installs.
Related MCP server: cokacremote
Install
Release binaries (macOS and Linux on amd64/arm64; requires local Python 3.11+, verifies SHA-256 before atomic replacement):
curl -fsSL https://raw.githubusercontent.com/starfield17/rhost/main/scripts/install.sh | bashUse RHOST_VERSION to pin a release or RHOST_INSTALL_DIR to set the binary directory (defaults to ~/.local/bin, or an existing writable standalone rhost / Homebrew bin on macOS PATH). Run rehash or hash -r if an open shell cached a prior path.
From source (Rust 1.88.0+):
git clone https://github.com/starfield17/rhost.git
cd rhost
make build-release
install -m 755 target/release/rhost ~/.local/bin/rhostmake build-release runs cargo build --locked --release --bin rhost and stamps commit/build date into rhost version --json; make build builds the debug binary.
Connect an agent
Ensure noninteractive OpenSSH works first using an SSH alias, user@example-host, or hostname:
claude mcp add --transport stdio --scope local rhost -- rhost mcp
codex mcp add rhost -- rhost mcpGeneric stdio clients launch rhost with ["mcp"] (use an absolute path if a GUI client's PATH differs). Filter advertised tools at startup with rhost mcp --tools runs,files (default all; groups: runs, files, sessions, diagnostics).
Install the optional Agent Skill to load workflow and recovery guidance on demand:
npx skills add starfield17/rhost --skill rhostplugin.json and .codex-plugin/plugin.json package skills/rhost/SKILL.md; they require the rhost CLI separately and do not register MCP. See MCP setup guide for client configuration, SSH_AUTH_SOCK, tool schemas, and cancellation semantics.
Quick examples
# Inspect host readiness (read-only) and read or patch a remote file with CAS protection
rhost brief gpu --json
rhost fs read gpu ~/work/project/config.toml --json
rhost fs patch gpu ~/work/project/config.toml --from - --json <<'EOF'
{"edits":[{"old_text":"batch_size = 16","new_text":"batch_size = 32"}]}
EOF
# Start a recoverable background Run and follow output across reconnects
rhost run start gpu --cwd '~/work/project' --command 'cargo test --locked' --json
rhost run watch gpu <run_id> --json
# Device Mode: push a local tree, run remotely, and pull artifacts without remote Git
rhost push ./project gpu --name demo
rhost run --at demo --hosts gpu --command 'make test'
rhost pull gpu output.json ./output.json --at demo
# Foreground command execution
rhost exec gpu --cwd '~/work/project' --command 'uname -a'Single closed JSON requests (schema_version: 8, matching MCP structuredContent) work via stdin:
rhost request --from - <<'EOF'
{"schema_version":8,"operation":"fs.read","host":"gpu","params":{"path":"~/work/project/config.toml","max_bytes":4096}}
EOFOperations and references
Need | Interface | Reference |
Bounded read/search, CAS edit, changesets | CLI, JSON, MCP | |
Recoverable work surviving CLI/MCP exit | CLI, JSON, MCP | |
Stateful shell, REPL, debugger ( | CLI, JSON, MCP | |
Foreground command, transfers, Device Mode, tunnels | CLI ( | |
Host brief, aliases, diagnosis, MCP setup | CLI, JSON, MCP | |
Helper cache/build policy, | Policy & recovery tables |
Diagnosis vs. preparation:
rhost doctorprobes shell tools and resolvedcommand -vpaths (ok:truemeans the probe completed; inspectcapabilities). Nativefs.*andrun.*prepare the C99 helper automatically;rhost helper preparereturnsgeneration,remote_time_unix, and helper identity explicitly (rhost helper statusreads an existing namespace without creating one).Remote requirements:
execanddoctorrequire/bin/sh,bash,ps,base64, and eithersetsidor Perl withPOSIX::setsid.sessionrequiresbash,tmux,flock(session attachis refused withUSAGE_ERROR); resumable/checksum transfers requirersync; nativefs.*andrun.*require only POSIXshutilities to bootstrap the C99 helper (no remote Python ortmux).Schema and boundaries: Public JSON uses schema v8 (
v7.1.0+); branch onerror.codeanderror.recovery, not prose. See state discovery and retention forrun.list,fs.changeset.list,state.list,state.usage, andstate.prune.rhostdoes not manage SSH credentials, system packages, Git branches/worktrees, or job scheduling.
Docs, schemas, and verification
make test-smoke # offline Rust black-box suite (no network)
make check # fmt, clippy, unit/contract/structure/portability/packaging checks
# Manual pre-release real-SSH suites (require an explicit target)
RHOST_TEST_HOST=<user>@<host> RHOST_BIN=./target/debug/rhost make test-live
RHOST_TEST_HOST=<user>@<host> RHOST_BIN=./target/debug/rhost make test-live-session
RHOST_TEST_HOST=<user>@<host> RHOST_BIN=./target/debug/rhost make test-live-allmake test-smoke and make check run offline; CI builds the shipping Linux helpers and verifies them against disposable strict-host-key sshd fixtures. Real-host test-live* and test-live-helper runs are optional manual pre-release verification; see Maintenance policy.
License
rhost is released under the BSD 3-Clause License.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
SSH client, server management and one remote MCP URL for your machines, with human approvals.
Remote MCP access to user-authorized Linux, Windows and Intel Mac devices for AI assistants.
Linux server administration over OAuth MCP: shell, Docker, systemd, files and monitoring.
Manage servers through SSH.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceRemote Linux operations via SSH, exposed as an MCP server, with tools for filesystem, systemd, Docker, network, and more, using per-user AD authentication and optional sudo elevation.1MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI clients to operate on a remote Linux server over MCP, allowing shell command execution, file editing, package installation, project builds, and service management.MIT
- AlicenseNot gradedqualityBmaintenanceEnables coding agents to treat a remote Linux host over SSH as a local working tree, exposing editor-semantics operations, background job management, artifact transfer, and guard hooks through MCP.2MIT
- AlicenseNot gradedqualityCmaintenanceEnables MCP clients to list SSH hosts, test reachability, retrieve Linux resource metrics, index and search project files, and run remote SSH commands when allowed, with local-first and safety-focused operations.MIT