ssh-mcp-server
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-mcp-server Run uptime and df -h on my-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.
SSH MCP Server
English | 中文
Secure SSH access for MCP clients. ssh_mcp lets Claude Desktop, VS Code Copilot, Augment, and other MCP-compatible agents run remote commands through a safety-first SSH proxy with OpenSSH config compatibility, connection pooling, and output guardrails.
Project health
Related MCP server: ssh-bridge-mcp
Why developers pick this project
Use the SSH config you already know: standard OpenSSH fields like
Host,HostName,User,Port,IdentityFile, andProxyJumpSafer than a raw shell bridge: built-in dangerous command blocking, per-host allowlists/denylists, output caps, and secret redaction
Fast for multi-step agent sessions: pooled SSH connections reduce reconnect overhead
Works with real MCP workflows: designed for Claude Desktop, VS Code Copilot, Augment, and any MCP-compatible client
Flexible for teams: merge project-level and user-level configs so shared hosts stay global while project overrides stay local
Great fit for
AI-assisted production troubleshooting
Safe observability and read-only operations on remote servers
DevOps and platform engineering copilots
Internal tooling that needs SSH access without handing an agent unlimited shell freedom
Quick start
1. Install and build
npm install
npm run build2. Add the server to your MCP client
See the ready-to-copy examples in:
examples/mcp-config.claude.example.jsonexamples/mcp-config.vscode.example.json
Minimal Claude Desktop / Augment example:
{
"mcpServers": {
"ssh": {
"command": "node",
"args": [
"/absolute/path/to/ssh-mcp-server/dist/index.js",
"--project-root",
"/path/to/your/project"
],
"env": {}
}
}
}Minimal VS Code MCP example:
{
"servers": {
"ssh": {
"command": "node",
"args": [
"/absolute/path/to/ssh-mcp-server/dist/index.js",
"--project-root",
"${workspaceFolder}"
]
}
}
}3. Configure SSH hosts
Copy examples/ssh.config.example to ssh.config in your project root, or initialize one through the MCP tool:
Use tool: ssh_init_config with scope="project"Minimal example:
Host my-server
HostName 192.168.1.100
User ubuntu
Port 22
IdentityFile ~/.ssh/id_rsa
# mcp-ssh:denylist = rm -rf,mkfs,dd,shutdown,reboot4. Try a few prompts in your MCP client
"List all configured SSH hosts."
"Test the SSH connection to
my-server.""Run
uptime && df -honmy-server.""Show me the merged SSH config for
my-server."
Core features
Dual-scope configuration: project-level (
ssh.config) + user-level (~/.config/mcp-ssh/config) with automatic mergingConnection pooling: reuse SSH connections across commands with idle cleanup
Per-host security policy: allowlists, denylists, max timeout, and max output size
Output management: automatic truncation to protect LLM context windows
Sensitive data protection: private keys and sensitive environment values are sanitized in output
OpenSSH compatibility: keep using your normal host aliases and SSH habits
Configuration
Config file locations
Scope | Path | Purpose |
Project |
| Hosts specific to the current project |
User |
| Shared hosts across projects |
Merge rule: project-level settings override user-level settings for hosts with the same name.
Security annotations
Add policies as comments inside a Host block:
# mcp-ssh:denylist = cmd1,cmd2 # Block these command patterns
# mcp-ssh:allowlist = cmd1,cmd2 # Only allow these command patterns
# mcp-ssh:maxTimeoutMs = 30000 # Max execution timeout for this host
# mcp-ssh:maxOutputChars = 5000 # Max output characters for this hostAuthentication order
Private key from
IdentityFileSSH agent via
SSH_AUTH_SOCK(Unix) or Pageant (Windows)Password via environment variable
SSH_PASSWORD_<HOST>
Example: for host my-server, set SSH_PASSWORD_MY_SERVER=secret.
Why this is better than a plain SSH wrapper
Plain remote exec bridge | SSH MCP Server |
Often exposes a full shell with little policy control | Supports per-host allowlists / denylists |
Reconnects for every agent step | Reuses pooled connections |
Easy to overflow model context with huge outputs | Truncates output automatically |
Custom host definitions | Works with familiar OpenSSH config syntax |
Secrets may leak into logs | Sanitizes output and hides sensitive values |
MCP tools
Tool | Description | Parameters |
| List all available SSH hosts | — |
| Execute a command on a remote host |
|
| Initialize SSH config file |
|
| Get config for a specific host |
|
| Test connectivity to a host |
|
| Disconnect one host or all active sessions |
|
MCP resources
URI | Description |
| JSON list of all configured SSH hosts |
Security-first defaults
Dangerous commands such as
rm -rf /,mkfs,dd if=,shutdown, andrebootare blocked by defaultPrivate key material and sensitive env values are redacted from outputs
Commands are sanitized before execution
Concurrent connection count and idle lifetime are limited
Recommended for production:
Prefer
IdentityFileover password authUse
# mcp-ssh:allowlistfor production hostsAdd
ssh.configto.gitignoreif it contains sensitive hostnamesEnable
--strict-host-keyin productionUse SSH certificates or pinned
known_hostsentries when possible
CLI options
ssh-mcp-server [options]
--project-root <path> Project root directory (for project-level ssh.config)
--user-config <path> Custom user config path (default: ~/.config/mcp-ssh/config)
--strict-host-key Enable strict host key checking
--no-strict-host-key Disable strict host key checking (default)
--timeout <ms> Default command timeout in ms (default: 60000)
--max-output <chars> Maximum output characters per stream (default: 10000)
--max-connections <n> Maximum concurrent SSH connections (default: 5)
--idle-timeout <ms> Connection idle timeout in ms (default: 600000)Development
# Install dependencies
npm install
# Run in dev mode
npm run dev -- --project-root .
# Build
npm run build
# Run the built server
npm start -- --project-root .
# Debug with MCP Inspector
npm run inspectContributing
Issues and pull requests are welcome. If you want support for more MCP clients, stronger security policies, or better SSH ergonomics, open an issue and share the workflow you want to enable.
For contributor workflow details, see CONTRIBUTING.md.
Community
Please follow the expectations in CODE_OF_CONDUCT.md
For security issues, use SECURITY.md instead of filing a public bug report
License
MIT — see LICENSE.
Available Tools
6 toolsssh_disconnectA
Disconnect SSH session(s). Specify a host to disconnect one, or omit to disconnect all.
Inputs: host.
ssh_execB
Execute a command on a remote SSH host. The host must be defined in the SSH configuration.
Inputs: host (required), command (required), timeout_ms.
ssh_get_configB
Get the full SSH configuration for a specific host (merged from project + user level)
Inputs: host (required).
ssh_init_configB
Initialize an SSH configuration file (project-level or user-level)
Inputs: scope (required), hosts, project_root.
ssh_list_hostsA
List all available SSH hosts from merged configuration (project + user level)
Inputs: no named parameters.
ssh_test_connectionB
Test SSH connectivity to a configured host
Inputs: host (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool maps to a distinct operation: listing hosts, executing commands, initializing config, reading config, testing connectivity, and disconnecting. There is no overlap between ssh_exec and ssh_test_connection since one runs commands and the other verifies reachability. An agent can select the right tool from the names alone.
All six tools use the same ssh_ prefix followed by a clear verb_noun or verb pattern (list_hosts, exec, init_config, get_config, test_connection, disconnect). The convention is uniform and predictable across the entire surface.
Six tools is well-scoped for an SSH configuration and execution server, with each tool earning its place. There is no redundant or filler tool, and the set stays comfortably within the ideal 3-15 range.
The core lifecycle is covered: initialize config, read config, list hosts, test connectivity, execute commands, and disconnect. Minor gaps exist around modifying existing host entries (add/update/remove host) and file transfer operations, but agents can work around these by editing config or using ssh_exec.
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.
Termalin's hosted MCP server. Claude, ChatGPT or any MCP client runs commands, moves files over SFTP, queries databases and reads server metrics and monitoring alerts on your servers, keylessly through Termalin Connectors: no SSH key is handed over and no inbound port is opened. Per-host command policy and an audit log. Needs a termal.in Pro or Team account (new accounts start with a 14-day Pro trial).
- browser-sshDeprecatedcom.browserssh
Scoped, audited SSH exec, sessions, and SFTP on your saved servers without exposing credentials
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceAn MCP server that enables AI to execute SSH commands on remote servers using the host's OpenSSH client, supporting both configured targets and dynamic connections with request-scoped credentials.-
- AlicenseAqualityDmaintenanceLets MCP-capable AI clients run commands and manage files on remote machines over SSH without installing anything remotely.6MIT
- 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
- AlicenseAqualityBmaintenanceEnables MCP clients to store encrypted SSH host credentials and execute remote commands over pooled SSH connections, including single commands, prompt-answering interactive runs, and multi-step playbooks. Hosts can be listed, created, updated, and deleted through tools, with credentials kept server-side and never echoed back.839 npm1MIT