SSH MCP Server
Execute commands and transfer files on remote servers via SSH
The SSH MCP server lets your workflows execute shell commands and transfer files on remote servers. It connects via SSH using either a private key or password authentication.
Setup
- Go to Settings > MCP Servers > Add Server.
- Select SSH.
- Configure the connection:
| Field | Required | Description |
|---|---|---|
host | Yes | Remote server hostname or IP address |
port | No | SSH port (default: 22) |
username | Yes | SSH username |
privateKey | One of these | SSH private key (PEM format) |
password | One of these | SSH password |
Either privateKey or password must be provided. Private key authentication is recommended.
- Click Save.
If your private key contains literal \n characters (common when pasting into form fields), they are automatically converted to real newlines.
Tools
ssh_exec
Execute a shell command on the remote server.
| Parameter | Type | Required | Description |
|---|---|---|---|
command | string | Yes | Shell command to execute |
timeout | number | No | Timeout in milliseconds (default: 30000, max: 300000) |
Returns stdout, stderr, and exitCode. Output is capped at 1MB.
ssh_upload
Upload text content to a file on the remote server via SFTP.
| Parameter | Type | Required | Description |
|---|---|---|---|
remote_path | string | Yes | Absolute path on the remote server (e.g., /home/user/file.txt) |
content | string | Yes | File content to upload |
ssh_download
Download a text file from the remote server via SFTP (max 1MB).
| Parameter | Type | Required | Description |
|---|---|---|---|
remote_path | string | Yes | Absolute path to the file on the remote server |
ssh_list_dir
List files and directories at a remote path.
| Parameter | Type | Required | Description |
|---|---|---|---|
remote_path | string | Yes | Absolute path to the directory |
Returns an array of entries with name, type (file/directory), size, and modifiedAt.
ssh_file_info
Get file or directory metadata.
| Parameter | Type | Required | Description |
|---|---|---|---|
remote_path | string | Yes | Absolute path to the file or directory |
Returns size, isDirectory, modifiedAt, and permissions.
Timeouts and Limits
- Connection timeout: 10 seconds
- Command timeout: Default 30 seconds, configurable up to 5 minutes (300,000 ms)
- Output limit: 1MB per command (truncated with a warning if exceeded)
Example Workflow
A deployment automation workflow:
- Trigger -- Webhook from CI/CD pipeline
- Agent -- Parse deployment payload, tools:
ssh:ssh_exec - The agent runs commands like
cd /app && git pull && npm install && pm restart - Logic -- Check exit code for success/failure
- Agent -- Send deployment status notification via Slack