mcp-ssh
Summary
This server enables cross-platform remote management over SSH, including command execution, file transfer, key-based authentication setup, and Windows-specific GUI launching.
Test SSH connectivity and detect the target OS (
ssh_test_connection).Execute arbitrary commands on remote hosts, with options for Windows desktop session launch and automatic handling of long PowerShell scripts (
ssh_exec).Set up passwordless login by deploying an ed25519 public key to Linux or Windows hosts (
ssh_setup_passwordless).Revoke passwordless access by removing a specific key or clearing all authorized keys (
ssh_remove_passwordless).Transfer files bidirectionally via SFTP (
ssh_upload_file,ssh_download_file).Generate a one-liner script to install OpenSSH server on a Windows host via RDP (
ssh_generate_rdp_bootstrap).Manage known_hosts by clearing stale entries (
ssh_clear_known_hosts).Use profiles for reusable connection settings, with secure environment variable resolution for passwords.
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., "@mcp-ssh SSH into 192.168.1.50 and run `df -h`"
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.
sshctl-mcp
Cross-platform SSH remote execution engine, passwordless key manager, Windows Session 0 desktop launcher, SFTP client, and Model Context Protocol (MCP) server for AI coding agents.
Architecture
Terminal / Human (CLI) AI Agent (Claude / Antigravity / Cursor)
│ │
▼ ▼
sshctl (CLI binary) MCP Protocol (stdio JSON-RPC)
│ │
└──────────────────┬──────────────────────┘
▼
Core SSH Engine
│
┌───────────────┼───────────────┐
▼ ▼ ▼
Connection Pool PowerShell/UTF-16LE SFTP Channel
(60s idle reuse) (Session 0 / 8K limit) (FastPut / FastGet)
│ │ │
└───────────────┼───────────────┘
▼
Remote Target Host
(Windows / Linux / macOS)Related MCP server: SSH MCP Server
Key Capabilities
Zero Local Client Shell Dependencies: Pure TypeScript built on
ssh2. Executes uniformly across Windows (cmd, PowerShell), macOS, and Linux without requiring OpenSSH client binaries, WSL, Git Bash,sshpass, oriconv.Native Windows Host Engineering: Automatically encodes Windows PowerShell commands into Base64 UTF-16LE (
powershell.exe -EncodedCommand) to eliminate quote escaping bugs. Automatically falls back to SFTP script upload when command payloads exceedcmd.exe's 8,191-character boundary limit.Windows Session 0 Desktop Handoff (
--desktop/desktop: true): Solves the classic limitation where SSH-spawned GUI processes run invisibly in Session 0. Automatically hands off GUI processes to the active user's interactive desktop (Session 1) via Task Scheduler.AI Agent Native (MCP Protocol): Exposes 9 first-class tools with rich parameter metadata, annotations (
readOnlyHint,idempotentHint), token-efficient smart output capping (head/tail/compact), and prompt templates.Transport Connection Pooling: Reuses underlying SSH2 connections per
user@host:portwith a 60-second idle timeout, eliminating handshake latency across multi-step agent workflows.Secure Profile Management: Store targets in
~/.sshctl/profiles.jsonwith environment variable indirection (env:VAR_NAME) so secret passwords are never leaked into agent conversation transcripts.
Installation & Setup
As an MCP Server (Recommended)
No manual clone or build required. You can run sshctl-mcp directly via npx.
1. Claude Code CLI
claude mcp add sshctl -- npx -y sshctl-mcp2. Claude Desktop (claude_desktop_config.json)
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"sshctl": {
"command": "npx",
"args": ["-y", "sshctl-mcp"]
}
}
}3. Cursor / Windsurf / Cline (mcp.json)
{
"mcpServers": {
"sshctl": {
"command": "npx",
"args": ["-y", "sshctl-mcp"]
}
}
}4. Google Antigravity
Add to ~/.gemini/config/mcp_config.json:
{
"mcpServers": {
"sshctl": {
"command": "npx",
"args": ["-y", "sshctl-mcp"]
}
}
}For Antigravity lazy-loading tool schemas, run npm run export:schemas from a local clone.
As a Global CLI Tool
Install globally via npm:
npm install -g sshctl-mcpOnce installed, both sshctl and sshctl-mcp commands are available globally.
Alternatively, execute one-off commands without installing:
npx sshctl-mcp --helpFrom Source (Development)
git clone https://github.com/nguyenvanhuy0612/sshctl.git
cd sshctl
npm install
npm test # 50 unit and integration tests (100% pass)
npm run buildConnection Profiles (~/.sshctl/profiles.json)
To avoid specifying credentials on every command or leaking passwords into agent conversation transcripts, define named profiles in ~/.sshctl/profiles.json:
{
"win-host": {
"host": "192.168.1.100",
"port": 22,
"username": "Administrator",
"privateKeyPath": "~/.ssh/id_ed25519",
"targetOs": "windows",
"description": "Windows QA workstation"
},
"linux-box": {
"host": "10.0.0.15",
"port": 22,
"username": "deploy",
"password": "env:DEPLOY_PASSWORD",
"targetOs": "linux",
"description": "Linux CI runner"
}
}Values prefixed with
env:are resolved dynamically from process environment variables at runtime.Ensure profile permissions are restricted:
chmod 600 ~/.sshctl/profiles.json.
CLI Command Reference
# List configured profiles
sshctl profiles
# Probe connectivity, target OS, and authentication
sshctl test win-host
# Execute remote command
sshctl exec win-host "Get-Process | Select-Object -First 10"
# Launch GUI app interactively on active Windows desktop (Session 1 bypass)
sshctl exec win-host "notepad.exe" --desktop
# Transfer files via SFTP
sshctl push win-host ./local-package.zip C:/Deploy/package.zip
sshctl pull win-host C:/Deploy/output.log ./output.log
# Generate Windows OpenSSH Server 1-liner bootstrap for RDP
sshctl bootstrap-rdp --admin
# Clear stale or changed host key from known_hosts
sshctl clear-hosts 192.168.1.100
# Start stdio MCP JSON-RPC server manually
sshctl mcpMCP Tools Reference
Tool | Read-Only | Description |
| Yes | List saved connection profiles from |
| Yes | Probe connectivity, detect remote OS ( |
| No | Remove stale host entries from |
| No | Execute remote command with Base64 UTF-16LE encoding, 8K boundary fallback, and optional Session 1 GUI bypass. |
| No | Generate local |
| No | Remove deployed public key from remote target with automatic backup file creation. |
| No | Upload local file to remote destination over SFTP with automatic ancestor directory creation. |
| No | Download remote file to local destination over SFTP with parent directory creation. |
| Yes | Generate a self-contained PowerShell one-liner to install and configure OpenSSH on Windows over RDP. |
Technical Documentation
docs/TOOLS.md: Parameter matrices, tool annotations, hints, and AI agent workflow patterns.
docs/REFERENCE.md: Deep architectural dive into PowerShell Base64 encoding, the 8,191-character boundary fallback, Windows Session 0 bypass mechanism, and exit code tables.
License
MIT © 2026 Nguyen Van Huy
Available Tools
8 toolsssh_clear_known_hostsA
Remove stale/changed host entries from local ~/.ssh/known_hosts file.
Inputs: host (required).
ssh_download_fileB
Download a remote file to local host via SFTP channel.
Inputs: host (required), username (required), localPath (required), remotePath (required), +3 more.
ssh_execA
Execute remote commands over SSH. Supports Base64 UTF-16LE, Session 0 bypass (--desktop), 8191 char limit bypass, and dual auth.
Inputs: host (required), command (required), username (required), port, +5 more.
ssh_generate_rdp_bootstrapA
Generate 1-liner PowerShell script to copy-paste into an RDP session to install OpenSSH server on Windows target.
Inputs: host, userType.
ssh_remove_passwordlessA
Remove public key entry or clear ALL keys from authorized_keys on remote host, revoking passwordless SSH login.
Inputs: host (required), username (required), port, password, +4 more.
ssh_setup_passwordlessA
Deploy ed25519 public key to Linux (~/.ssh/authorized_keys) or Windows (administrators_authorized_keys with ACLs) and verify key login.
Inputs: host (required), password (required), username (required), port, +3 more.
ssh_test_connectionA
Test SSH connection & probe target OS. If server is unreachable/uninstalled, outputs RDP 1-liner script.
Inputs: host (required), username (required), port, password, +1 more.
ssh_upload_fileB
Upload a local file to remote host via SFTP channel.
Inputs: host (required), username (required), localPath (required), remotePath (required), +3 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool targets a distinct SSH operation: connection testing, command execution, passwordless setup/removal, file transfer, known hosts management, and RDP bootstrap. No two tools overlap in purpose, making selection unambiguous.
All tools share the ssh_ prefix and mostly follow verb_noun pattern (clear_known_hosts, upload_file, setup_passwordless). The exception is ssh_exec, which is verb-only but still clear and consistent in style.
Eight tools is well-scoped for an SSH management server, covering core operations without bloat. Each tool has a clear role, and the count is typical for a focused utility server.
The toolset covers the primary SSH lifecycle: connection, execution, file transfer, key management, and known hosts. Minor gaps exist (e.g., no explicit tool to list known hosts or manage port forwarding), but the core workflows are complete.
Related MCP Connectors
- browser-sshDeprecatedcom.browserssh
Scoped, audited SSH exec, sessions, and SFTP on your saved servers without exposing credentials
Securely control computers you explicitly pair through files, terminals, processes, screenshots, desktop UI/input, clipboard, browser automation, diagnostics, and document tools.
Manage remote servers, SSH terminals, files, databases and proxies with scoped access and approvals.
Secure AI access to Windows, macOS, Linux computers and a hosted Cloud Browser.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables secure SSH connections to multiple remote servers with support for command execution, file transfers (SFTP), directory listing, and both password and key-based authentication.717 PyPIMIT
- AlicenseAqualityDmaintenanceEnables remote server management through SSH and SFTP, supporting command execution, file transfers, and interactive shell sessions. It allows for multiple concurrent connections using either password or SSH key authentication.1122 npm5MIT
- AlicenseAqualityNot gradedmaintenanceEnables persistent SSH sessions and SFTP file transfers with native GUI credential prompts for secure remote server management. It supports background command execution, session pooling, and automatic connection reuse across multiple commands.7-
- FlicenseBqualityDmaintenanceEnables secure remote and local command execution via SSH, with session management and environment variable support.13-