upload_file
Upload files to a remote server via SFTP using a local path relative to the transfer root. Existing regular files are overwritten; files over 100 MiB must use rsync or scp.
Instructions
Upload a file to a remote server via SFTP.
Files larger than 100 MiB are refused outright — use rsync or scp for those.
Args:
server: Server name (e.g. 'pro-dicentra').
local_path: Path to the local file, RELATIVE to the configured
transfer_root (see [settings] in servers.toml, or the
SSH_MCP_TRANSFER_ROOT environment variable). Absolute
paths, .., . components and embedded NUL bytes are
rejected, as is a symlink at ANY component of the path.
Sub-directories are allowed (e.g. 'reports/q1.csv'),
but every intermediate
directory must already exist under transfer_root —
upload_file does not create them. transfer_root itself must
be a real directory owned by the running user with mode 0700,
or every transfer fails.
remote_path: Destination path on the remote server — normally absolute,
though a relative path is not rejected, just resolved by the
remote SFTP server against the SSH login directory. Rejected if
it contains .. anywhere (even inside an otherwise legitimate
filename) or matches the sensitive-path denylist
(/etc/shadow, /etc/passwd, .ssh/*,
.aws/credentials, .kube/config, .netrc, …). An
existing REGULAR file at the destination is silently
OVERWRITTEN — unlike download_file, upload does not no-clobber;
an existing non-regular target (symlink, device, FIFO) is
refused.
Returns: Confirmation message with file size.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| server | Yes | ||
| local_path | Yes | ||
| remote_path | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |