mcp-ssh
Click on "Install 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-sshSSH into 192.168.1.50 and rundf -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.
mcp-ssh
A production-grade Model Context Protocol (MCP) server for cross-platform SSH remote execution, automated passwordless key management, Windows Session 0 interactive desktop process launching, and SFTP file transfers.
How It Works
Agent (Claude / Antigravity / Custom Script)
│ stdio JSON-RPC (MCP Protocol)
▼
mcp-ssh Server (Node.js + TypeScript)
│ Native SSH2 / SFTP Streams
▼
Remote Target Machine
├─ Windows (Win32-OpenSSH, Base64 UTF-16LE, Session 0 Bypass, Administrators ACLs)
├─ Linux (OpenSSH, bash, ~/.ssh/authorized_keys)
└─ macOS (systemsetup remotelogin, zsh/bash)The agent connects over standard stdio JSON-RPC. mcp-ssh encapsulates all platform matrix quirks, UTF-16LE PowerShell encoding, Session 0 Task Scheduler handoffs, 8,191-character command line walls, and key ACL permissions ngầm in code so the agent receives clean, predictable, structured JSON results.
Related MCP server: SSH MCP Server
Core Capabilities
Zero Local Client Shell Dependencies: Written in pure TypeScript with
ssh2. Does not require WSL, Git Bash,sshpass,iconv, or localsshbinaries on Windows or macOS clients.Automated PowerShell Command Encoding: Converts Windows command bodies to Base64 UTF-16LE strings (
powershell.exe -EncodedCommand), removing all nested quote escaping errors.Session 0 Desktop Handoff (
desktop: true): Solves the classic Win32-OpenSSH issue where GUI apps launch invisibly in Session 0. Resolves owner of activeexplorer.exeand schedules a temporary Task Scheduler job withLogonType Interactiveto launch GUI apps on the user's active desktop (Session 1).8,191-Character Boundary Auto-Fallback: Automatically detects when encoded PowerShell payloads exceed the 8,000-character cmd.exe length limit wall, seamlessly uploading a UTF-8 BOM temporary script via SFTP and executing it with
powershell -File.First-Connect & Key Lifecycle:
Connection probe with target OS auto-detection.
Generates OpenSSH RDP Bootstrap 1-liners when target SSH is uninstalled or port 22 is closed.
Clears stale entries from
~/.ssh/known_hostswhen hosts are re-imaged (REMOTE HOST IDENTIFICATION HAS CHANGED).Deploys
ed25519key pairs with OS-strict ACLs (icacls SYSTEM:F Administrators:Fon Windows;chmod 600on Unix).Revokes key access or clears authorized keys via
ssh_remove_passwordless.
Quick Start
1. Build the MCP Server
cd claude/mcp-ssh
npm install
npm run build2. Register with Claude Desktop / Claude Code
Claude Code CLI:
# Windows:
claude mcp add ssh -- node "C:/path/to/my_notes/claude/mcp-ssh/dist/index.js"
# macOS / Linux:
claude mcp add ssh -- node "/absolute/path/to/my_notes/claude/mcp-ssh/dist/index.js"Claude Desktop Configuration (claude_desktop_config.json):
{
"mcpServers": {
"ssh": {
"command": "node",
"args": [
"/absolute/path/to/my_notes/claude/mcp-ssh/dist/index.js"
]
}
}
}Tool Reference
ssh_test_connection
Probes SSH connectivity, authenticates, and auto-detects target OS (windows, linux, mac). If target port 22 is closed, outputs an OpenSSH RDP bootstrap script.
Parameter | Type | Required | Description |
| string | Yes | Target hostname or IP address |
| string | Yes | SSH username |
| string | No | SSH password |
| string | No | Path to private key file |
| number | No | SSH port (default: |
ssh_clear_known_hosts
Removes stale host key entries matching host from ~/.ssh/known_hosts to resolve host key collision errors.
Parameter | Type | Required | Description |
| string | Yes | Hostname or IP to clear |
ssh_exec
Executes remote commands over SSH across Windows, Linux, and macOS.
Parameter | Type | Required | Description |
| string | Yes | Target host IP or domain |
| string | Yes | SSH username |
| string | Yes | Command line or script body |
| string | No | SSH password |
| string | No | Path to private key file |
| enum | No |
|
| boolean | No | Windows only: launch in Session 1 interactive GUI desktop ( |
| number | No | Windows only: force specific session ID |
| number | No | SSH port (default: |
Response Format:
EXIT CODE: 0
--- STDOUT ---
WindowsProductName OsVersion OsArchitecture
------------------ --------- --------------
Windows 10 Enterprise 10.0.26200 64-bit
--- STDERR ---
(empty)ssh_setup_passwordless
Generates an ed25519 key pair locally if missing, deploys public key to target host with strict ACLs, and verifies key login.
Parameter | Type | Required | Description |
| string | Yes | Target host IP |
| string | Yes | Target username |
| string | Yes | Password required for initial key copy |
| string | No | Private key path (defaults to |
| enum | No |
|
| number | No | SSH port (default: |
ssh_remove_passwordless
Removes a specific public key entry or clears all public key entries from the target authorized keys file, revoking key-based login.
Parameter | Type | Required | Description |
| string | Yes | Target host IP |
| string | Yes | Target username |
| string | No | SSH password |
| string | No | Private key path |
| string | No | Local public key path to remove |
| boolean | No | Clear ALL authorized keys on target ( |
| number | No | SSH port (default: |
ssh_upload_file / ssh_download_file
Uploads or downloads files over native SFTP streams.
Parameter | Type | Required | Description |
| string | Yes | Target host IP |
| string | Yes | SSH username |
| string | Yes | Local file path |
| string | Yes | Remote target path |
| string | No | SSH password |
| string | No | Private key path |
ssh_generate_rdp_bootstrap
Generates a self-contained 1-liner PowerShell script to paste into an RDP session to install Win32-OpenSSH, open firewall port 22, and set autostart services.
Parameter | Type | Required | Description |
| string | No | Target host IP or hostname |
| enum | No |
|
Status & Verification
TypeScript Compilation: Clean build (
npm run build, 0 errors).Live Verification against Windows Host: Tested against live Windows 10 Enterprise target:
ssh_test_connection: Passed (connected, target OS auto-detected as WINDOWS).ssh_exec: Passed (Base64 UTF-16LE executedGet-ComputerInfo, exit code 0).ssh_exec(desktop: true): Passed (Session 1 task scheduled for activeexplorer.exeowner, executed and cleaned up without trace).
Security Model
Trusted Local Engine: Designed for single-user internal developer and QA automation workflows.
Credential Protection: Passwords and private keys remain in memory within the stdio MCP process during execution and are never logged to stdout or stored in command line histories.
Strict Key Permissions: Automatically enforces OpenSSH ACL requirements on target machines (
SYSTEM:F+Administrators:Ffor Windowsadministrators_authorized_keys;chmod 600for Unixauthorized_keys).
License
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
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.7MIT
- 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.11103MIT
- AlicenseAquality-maintenanceEnables 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
- AlicenseBqualityDmaintenanceEnables secure SSH connections to remote servers for executing shell commands and managing active sessions. It supports authentication via passwords or private keys and provides optional host-based access control.4196MIT
Related MCP Connectors
Let AI operate servers without SSH. Choose actions, approve risky changes, and audit every step.
Operate your Linux servers from your LLM. Every action runs through an auditable allowlist.
Eyes and hands on real Windows PCs — observe, click, type via Glasswarp API.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/nguyenvanhuy0612/mcp-ssh'
If you have feedback or need assistance with the MCP directory API, please join our Discord server