SSH Remote MCP
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., "@SSH Remote MCPdiagnose my web server and verify nginx is listening on port 80"
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.
π‘οΈ SSH Remote MCP β Matlock Edition
"Never trust raw command piping. Verify state forensically. Contain the blast radius."
An enterprise-grade Model Context Protocol (MCP) server engineered with Grab's Matlock Agent Mindset for safe, deterministic, and audited remote infrastructure management.
β‘ The Problem with Commodity SSH MCPs
Traditional SSH MCPs treat the remote server like a dumb stdin/stdout pipe:
Blind Execution / Command Injection: Raw multiline scripts and unescaped quotes corrupt remote configuration files or cause hanging heredocs.
Zero Blast-Radius Control: A hallucinated
rm -rf /or recursive permission change runs unconditionally, permanently bricking nodes.No Forensic Verification: Commands returning exit code
0are assumed successful, even when background services fail to bind ports or immediately enter crash loops.Dangerous Remote File Mutations: Overwriting remote files without backup snapshots or unified diff inspection leads to silent data loss.
Session Hanging on Long Tasks: Builds, container pulls, or migrations cause client stdio timeouts.
Related MCP server: ssh-pro-mcp
ποΈ The Matlock Architecture
ββββββββββββββββββββββββββββββββββββββββββ
β AI Agent / Client β
βββββββββββββββββββββ¬βββββββββββββββββββββ
β JSON-RPC (MCP)
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SSH REMOTE MCP β
β β
β βββββββββββββββββββββββββ βββββββββββββββββββββββββββ βββββββββββββββββββββββββββ β
β β 3-Tier Blast Radius β β Forensic Assertion β β Safe SFTP Engine β β
β β Containment β β Engine β β (Atomic + Diff + Roll) β β
β β β β β β β β
β β β’ Tier 1: Safe Read β β β’ Port Listening Verify β β β’ Auto .matlock.bak β β
β β β’ Tier 2: Mutating β β β’ Process Liveness Checkβ β β’ Base64 Safe Transfer β β
β β β’ Tier 3: Block/Gate β β β’ File State Check β β β’ Unified Git Diffs β β
β β (Safety Bypass Tkn) β β β’ HTTP Health Probe β β β’ 1-Click Rollback β β
β βββββββββββββββββββββββββ βββββββββββββββββββββββββββ βββββββββββββββββββββββββββ β
β β
β ββββββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββββββββββ β
β β Background Task Envelope β β Multiplexed Session & Profile Store β β
β β (Detached + Poll + Kill) β β (~/.matlock/profiles.json) β β
β ββββββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββ
β SSH2 / SFTP Keepalive Pool
βΌ
βββββββββββββββββββββ
β Remote Host β
β (Homelab / Cloud) β
βββββββββββββββββββββπ§° Available Tools (10 Primitives)
1. Command Execution & Telemetry
Tool | Description | Matlock Feature |
| Executes shell commands on remote target. | 3-Tier classification ( |
| Gathers a full forensic host telemetry snapshot. | OS, kernel, uptime, load avg, memory (MB), disk usage, Docker containers, listening ports, top processes in 1 roundtrip. |
2. Long-Running Task Envelope
Tool | Description | Matlock Feature |
| Detaches long tasks into background runner subshells. | Generates task ID, runner script, captures exit codes to disk without hanging MCP stdio. |
| Polls background task status. | Process liveness check, exit code inspection, and real-time log tailing. |
| Signals or terminates background task. | Supports |
3. Safe Atomic SFTP Primitives
Tool | Description | Matlock Feature |
| Reads file content with line slicing. | Line range parameters ( |
| Atomic file write with automatic backup. | Creates |
| Restores modified file from backup. | Atomic restoration from |
| Structured directory file explorer. | Parsed permissions, owner, size, and modification timestamps. |
4. Profile, Key Bootstrap & Credential Isolation
Tool | Description | Matlock Feature |
| Manages saved hosts in | Zero raw private key transmission across MCP parameters; references credentials securely by profile name. |
| 1-Click Password to Key Setup. | Tα»± tαΊ‘o SSH key, kαΊΏt nα»i bαΊ±ng password, inject vΓ o |
| Universal Agent IDE Installer. | CΓ i ΔαΊ·t tα»± Δα»ng |
π 3-Tier Blast Radius Containment
Tier 1 (Safe / Telemetry): Read-only inspection (
ls,cat,df,free,ps,docker ps,ss). Automatically executed.Tier 2 (Mutating): System mutations (
mkdir,systemctl restart,docker compose up -d,apt install). Executed with pre/post flight forensic assertions.Tier 3 (Destructive): High-risk operations (
rm -rf /,mkfs,dd to /dev/sd*,shutdown,reboot,iptables -F,kill -9 1). Interpreted and BLOCKED before transmission unless explicitconfirmDangerToken: trueis supplied.
π 1-Click Universal Auto-Installer (CΓ i tα»± Δα»ng cho mα»i Agent IDE)
ssh-remote-mcp tΓch hợp sαΊ΅n bα» Auto-Installer thΓ΄ng minh, tα»± Δα»ng quΓ©t vΓ cΓ i ΔαΊ·t vΓ o mα»i Agent IDE cΓ³ trΓͺn mΓ‘y tΓnh cα»§a bαΊ‘n (Claude Desktop, VS Code Native MCP, Antigravity, Cursor, Windsurf, Cline, Roo Code, Continue, Zed):
# 1-Click CΓ i ΔαΊ·t tα»± Δα»ng qua NPX (tα»± Δα»ng nhαΊn diα»n IDE vΓ cαΊ₯u hΓ¬nh an toΓ n):
npx github:nguyenquocanhz/ssh-remote-mcp install
# HoαΊ·c cΓ i tα»« local repo:
node dist/index.js install
# Xem danh sΓ‘ch cΓ‘c IDE Δược phΓ‘t hiα»n trΓͺn mΓ‘y:
npx github:nguyenquocanhz/ssh-remote-mcp list
# CΓ i ΔαΊ·t Γ©p buα»c cho tαΊ₯t cαΊ£ IDE (kα» cαΊ£ chΖ°a khα»i tαΊ‘o config):
npx github:nguyenquocanhz/ssh-remote-mcp install --allβ¨ TΓnh nΔng an toΓ n cα»§a Auto-Installer:
KhΓ΄ng ghi ΔΓ¨ dα»― liα»u cΕ©: Giα»― nguyΓͺn 100% cΓ‘c MCP server Δang cΓ³ (
zmp-mcp,unityMCP,...).Tα»± Δα»ng sao lΖ°u: TαΊ‘o file snapshot
.matlock.bak.<timestamp>trΖ°α»c khi chα»nh sα»a.Hα» trợ Δa nα»n tαΊ£ng: Windows, macOS, Linux.
βοΈ CαΊ₯u hΓ¬nh thα»§ cΓ΄ng (Manual Configuration)
NαΊΏu bαΊ‘n muα»n cαΊ₯u hΓ¬nh thα»§ cΓ΄ng vΓ o file config cα»§a IDE:
CΓ‘ch 1: ChαΊ‘y trα»±c tiαΊΏp qua NPX tα»« GitHub:
{
"mcpServers": {
"ssh-remote-mcp": {
"command": "npx",
"args": [
"-y",
"github:nguyenquocanhz/ssh-remote-mcp"
]
}
}
}CΓ‘ch 2: ChαΊ‘y tα»« source code cα»₯c bα»:
cd D:\ssh-remote-mcp
npm install
npm run buildCαΊ₯u hΓ¬nh trong mcp_config.json:
{
"mcpServers": {
"ssh-remote-mcp": {
"command": "node",
"args": [
"D:\\ssh-remote-mcp\\dist\\index.js"
]
}
}
}π§ͺ Verification & Evidence
Run the integrated automated forensic test suite:
node test-matlock.jsVerified against Homelab Node (192.168.100.169):
β
ssh_host_diagnose: OS Ubuntu 24.04.5 LTS, 15 Docker containers detected (zaloapp-backendhealthy on port 8088).β
ssh_exec: Post-flight assertions verified Port 8088 listening andcloudflaredactive.β Blast-Radius: Destructive
rm -rf /blocked by Matlock guardrails.β Safe SFTP: Atomic backup created, unified diff generated, rolled back cleanly.
β Background Envelope: Detached runner script executed
for loop, polled output, and returned exit code 0.
Available Tools
12 toolsmcp_auto_installB
Automatically detect and install/configure ssh-remote-mcp (or any MCP server) into all Agent IDEs on this computer (Claude Desktop, VS Code, Cursor, Windsurf, Antigravity, Cline, Roo Code, Zed, Continue).
Inputs: mode, dryRun, forceAll, targetIdeIds.
sftp_list_dirB
List remote directory entries with structured file metadata (type, permissions, owner, size, modified date).
Inputs: dirPath (required), target.
sftp_read_fileB
Safely read remote file with line range slicing (startLine/endLine) and SHA-256 integrity checksum.
Inputs: filePath (required), target, endLine, maxBytes, +1 more.
sftp_rollback_fileC
Instantly rollback a modified remote file to its previous .matlock.bak snapshot.
Inputs: filePath (required), target, backupPath.
sftp_write_safeA
Safe atomic remote file write: creates automated remote backup (.matlock.bak.), writes atomically, and returns a unified diff patch and SHA-256 hashes.
Inputs: content (required), filePath (required), target, createBackup.
ssh_execB
Execute shell command on remote host with Matlock 3-Tier blast-radius containment and post-flight state assertions (verifies listening ports, process liveness, file existence). Blocks destructive operations unless confirmed.
Inputs: command (required), env, target, timeoutMs, +3 more.
ssh_exec_backgroundA
Launch long-running command in a detached background subshell (avoids client timeout). Returns a taskId to poll logs and status.
Inputs: command (required), target, taskTag, workingDir.
ssh_host_diagnoseB
Comprehensive host telemetry snapshot in a single round-trip: OS, Kernel, Uptime, Load Avg, RAM, Disk, Docker containers, Listening Ports, and Top Processes.
Inputs: target.
ssh_key_bootstrapA
1-Click SSH Key Bootstrap: If you only have a VPS password, this tool automatically generates a local SSH key pair, connects via password, securely installs the public key into ~/.ssh/authorized_keys, verifies key-based login, and saves a named profile so you never need to use passwords again.
Inputs: host (required), password (required), port, keyName, +2 more.
ssh_profile_manageB
List, save, or remove saved SSH host profiles in ~/.matlock/profiles.json.
Inputs: action (required), profile, profileName.
ssh_task_killC
Terminate or signal a running background task by taskId.
Inputs: taskId (required), signal, target.
ssh_task_pollA
Check status, exit code, and inspect log tail of a background task launched via ssh_exec_background.
Inputs: taskId (required), target, tailLines.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
12 tool updates
v1.0.0- First observed
mcp_auto_install - First observed
sftp_list_dir - First observed
sftp_read_file - First observed
sftp_rollback_file - First observed
sftp_write_safe - First observed
ssh_exec - First observed
ssh_exec_background - First observed
ssh_host_diagnose - First observed
ssh_key_bootstrap - First observed
ssh_profile_manage - First observed
ssh_task_kill - First observed
ssh_task_poll
TDQS
Scored across 12 tools
Tools are largely distinct by resource and action: foreground vs background execution, task lifecycle, SFTP file operations, diagnostics, profiles, and setup. Minor overlap exists between ssh_profile_manage and ssh_key_bootstrap (both can save profiles), and mcp_auto_install is tangential to remote SSH operations but clearly described.
All names use snake_case with consistent resource prefixes (ssh_, sftp_, mcp_). However action ordering varies (ssh_exec vs ssh_task_poll) and mcp_auto_install breaks the prefix-based pattern, so it is not perfectly uniform.
12 tools is well within the ideal range for an SSH remote management server, covering execution, background tasks, file transfer, diagnostics, profile management, and setup without bloat.
Core workflows are covered: command exec, background task lifecycle, file read/write/list/rollback, host diagnostics, profile management, key bootstrap, and installer. Missing explicit remote file delete/mkdir/chmod or connection tunneling, but those can be achieved via ssh_exec.
Maintenance
Related MCP Connectors
Let AI operate servers without SSH. Choose actions, approve risky changes, and audit every step.
Scoped, audited SSH exec, sessions, and SFTP on your saved servers without exposing credentials
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Manage remote servers, SSH terminals, files, databases and proxies with scoped access and approvals.
Related MCP Servers
- 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
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to manage remote servers via SSH, including command execution, multi-host batch operations, SFTP file transfer, background job handling, DevOps diagnostics, port tunneling, and safety guardrails like high-risk command blocking and read-only mode.MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to remotely execute shell commands and transfer files on SSH hosts, including jump-host tunneling, background tasks, resumable transfers, and optional approval of destructive commands, while SSH credentials remain in the local process. It runs over stdio or a streamable HTTP daemon and supports auditing, allow/deny lists, and multiple authentication methods.ISC
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to run shell and sudo commands on remote machines through profile-driven SSH sessions, with explicit target guards that prevent commands from hitting the wrong host. It offers bucketed inventory lookup, connectivity diagnostics, keepalive-based connection resilience, and credential-safe configuration management.16,179 npmMIT