Upload a local file to the server
ptero_upload_fileUpload binary files from your local machine to a Pterodactyl game server without data corruption. Handles jars, zips, and other non-text files byte-for-byte.
Instructions
Upload a file from the machine running this MCP server to the game server, BYTE FOR BYTE. This is the tool for binaries — plugin jars, zips, datapack archives, images, region files — anything ptero_write_file cannot carry because that tool is text-only and would corrupt non-UTF-8 bytes.
You pass a PATH, not content: local_path must be an absolute path to a file that already exists on the machine this server runs on, and the server reads the bytes itself. There is no way to hand it base64 or any other inline payload, so if the file only exists in this conversation, write it to local disk first and pass that path.
It uploads exactly one file and does not unpack anything: a .zip or .tar.gz arrives as an archive, still compressed. There is no decompress tool here.
Creating a NEW remote file runs immediately. OVERWRITING an existing one is destructive: the first call returns status "needs_confirmation" with a preview (remote path, current size, new size) and a confirmation_token, and an automatic backup is taken before the upload happens. Show that preview to the human and only call again with the token once they have agreed. Protected paths (PTERODACTYL_PROTECTED_PATHS) are refused outright, and files larger than 64 MiB are refused before anything is read or sent.
VERIFY AFTERWARDS. The panel hands out a short-lived signed URL and the node answers the upload with an empty 200 — that confirms receipt and nothing more. It does not tell you the file landed at the size you sent, and it never tells you whether the server will accept it. Call ptero_list_files on remote_dir and check the size against the bytes this tool reports. A new plugin jar also needs a server restart before it loads.
The file content is never written to the audit log — only its sha256 and length — and neither is the signed upload URL.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| server | No | Server short identifier (e.g. 1a2b3c4d). Omit to use PTERODACTYL_DEFAULT_SERVER. Call ptero_list_servers to discover valid identifiers. | |
| dry_run | No | When true, validate and preview the change without performing it. Nothing is modified and no confirmation token is issued. Use this to reason about an operation before committing to it. | |
| local_path | Yes | ABSOLUTE path on the machine running this MCP server, e.g. `/Users/me/build/MyPlugin-1.2.0.jar`. Must be an existing, readable, regular file (not a directory, not a device) of at most 64 MiB. Relative paths are refused: this process's working directory is not something you can see. | |
| remote_dir | No | Destination DIRECTORY on the game server, relative to the server root — not the destination file path. Defaults to `/` (the server root). Examples: `plugins`, `plugins/Geyser-Spigot`. The file name comes from `remote_name`/`local_path`. | / |
| remote_name | No | File name to use on the server. Defaults to the basename of `local_path`. This is a single name, not a path: it must not contain `/`. Use `remote_dir` to choose the directory. | |
| confirmation_token | No | Two-phase confirmation token. Leave this out on the first call: the tool will refuse to act and instead return a preview of exactly what would change, plus a single-use token that expires in 120 seconds. THE PREVIEW IS FOR THE HUMAN — show it to the user in your reply and let them decide. Do not silently round-trip the token back in an immediate second call. Only call again with the token once the user has seen the preview and approved it. The token is bound to a hash of these exact arguments, so changing any argument invalidates it. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Server-relative path the bytes were uploaded to. | |
| bytes | No | Size of the local file, in bytes, as sent. | |
| action | No | ||
| reason | No | Why the call was refused. | |
| server | Yes | ||
| sha256 | No | sha256 of the LOCAL file. Compare it against the uploaded file yourself if it matters. | |
| status | Yes | success = the change was made. refused = a guardrail blocked it (see reason/variable). dry_run = nothing changed; preview shows what would. needs_confirmation = nothing changed; SHOW the preview to the human and, only if they agree, call again with confirmation_token. | |
| message | No | ||
| preview | No | What would / did change. | |
| variable | No | Environment variable that caused the refusal. | |
| backup_id | No | UUID of the automatic pre-change backup, if one was taken. | |
| expires_in_s | No | ||
| confirmed_via | No | ||
| confirmation_token | No |