Tools
SFTP
Transfer files via SFTP (SSH File Transfer Protocol)
Upload, download, list, and manage files on remote servers via SFTP. Supports both password and private key authentication for secure file transfers.
Upload files to a remote SFTP server
| Parameter | Type | Required | Description |
|---|
host | string | Yes | SFTP server hostname or IP address |
port | number | Yes | SFTP server port (default: 22) |
username | string | Yes | SFTP username |
password | string | No | Password for authentication (if not using private key) |
privateKey | string | No | Private key for authentication (OpenSSH format) |
passphrase | string | No | Passphrase for encrypted private key |
remotePath | string | Yes | Destination directory on the remote server |
files | file[] | No | Files to upload |
fileContent | string | No | Direct file content to upload (for text files) |
fileName | string | No | File name when using direct content |
overwrite | boolean | No | Whether to overwrite existing files (default: true) |
permissions | string | No | File permissions (e.g., 0644) |
| Parameter | Type | Description |
|---|
success | boolean | Whether the upload was successful |
uploadedFiles | json | Array of uploaded file details (name, remotePath, size) |
message | string | Operation status message |
Download a file from a remote SFTP server
| Parameter | Type | Required | Description |
|---|
host | string | Yes | SFTP server hostname or IP address |
port | number | Yes | SFTP server port (default: 22) |
username | string | Yes | SFTP username |
password | string | No | Password for authentication (if not using private key) |
privateKey | string | No | Private key for authentication (OpenSSH format) |
passphrase | string | No | Passphrase for encrypted private key |
remotePath | string | Yes | Path to the file on the remote server |
encoding | string | No | Output encoding: utf-8 for text, base64 for binary (default: utf-8) |
| Parameter | Type | Description |
|---|
success | boolean | Whether the download was successful |
fileName | string | Name of the downloaded file |
content | string | File content (text or base64 encoded) |
size | number | File size in bytes |
encoding | string | Content encoding (utf-8 or base64) |
message | string | Operation status message |
List files and directories on a remote SFTP server
| Parameter | Type | Required | Description |
|---|
host | string | Yes | SFTP server hostname or IP address |
port | number | Yes | SFTP server port (default: 22) |
username | string | Yes | SFTP username |
password | string | No | Password for authentication (if not using private key) |
privateKey | string | No | Private key for authentication (OpenSSH format) |
passphrase | string | No | Passphrase for encrypted private key |
remotePath | string | Yes | Directory path on the remote server |
detailed | boolean | No | Include detailed file information (size, permissions, modified date) |
| Parameter | Type | Description |
|---|
success | boolean | Whether the operation was successful |
path | string | Directory path that was listed |
entries | json | Array of directory entries with name, type, size, permissions, modifiedAt |
count | number | Number of entries in the directory |
message | string | Operation status message |
Delete a file or directory on a remote SFTP server
| Parameter | Type | Required | Description |
|---|
host | string | Yes | SFTP server hostname or IP address |
port | number | Yes | SFTP server port (default: 22) |
username | string | Yes | SFTP username |
password | string | No | Password for authentication (if not using private key) |
privateKey | string | No | Private key for authentication (OpenSSH format) |
passphrase | string | No | Passphrase for encrypted private key |
remotePath | string | Yes | Path to the file or directory to delete |
recursive | boolean | No | Delete directories recursively |
| Parameter | Type | Description |
|---|
success | boolean | Whether the deletion was successful |
deletedPath | string | Path that was deleted |
message | string | Operation status message |
Create a directory on a remote SFTP server
| Parameter | Type | Required | Description |
|---|
host | string | Yes | SFTP server hostname or IP address |
port | number | Yes | SFTP server port (default: 22) |
username | string | Yes | SFTP username |
password | string | No | Password for authentication (if not using private key) |
privateKey | string | No | Private key for authentication (OpenSSH format) |
passphrase | string | No | Passphrase for encrypted private key |
remotePath | string | Yes | Path for the new directory |
recursive | boolean | No | Create parent directories if they do not exist |
| Parameter | Type | Description |
|---|
success | boolean | Whether the directory was created successfully |
createdPath | string | Path of the created directory |
message | string | Operation status message |
- Category:
tools
- Type:
sftp