Skip to content
WayneVoyagerPublic

About

Temporary file transfer server for remote development — drag & drop in your browser, zero dependencies.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

English | 中文

AgentDrop

Temporary file transfer server for remote development — drag & drop in your browser, zero dependencies.

When you're SSH'd into a remote server running Claude Code, transferring files between your local PC and the server is painful. scp needs a second terminal, rz/sz is flaky, and rsync requires setup. AgentDrop spins up a temporary HTTP server with a secure random URL — open it in your browser, drag and drop. Done.

Zero dependencies. Pure Python standard library. Works anywhere Python 3.9+ is available.

Features

  • Zero dependency — Python standard library only, no pip install needed
  • Three transfer modes — upload-only, download-only, or both
  • Drag & drop upload — multi-file concurrent upload with progress bars (up to 3 parallel)
  • File browser — navigate directories, download individual files or entire folders as ZIP
  • Text file preview — click .md, .py, .json, .txt and 30+ text formats to preview in-browser, with Markdown rendering
  • Optional PIN protection — 4-digit numeric password with rate limiting (5 attempts per IP, auto-reset after 10 min)
  • Secure by default — random URL token, path traversal protection, dangerous directory blocking, HttpOnly session cookies
  • Auto-shutdown — configurable timeout (default 30 min) with graceful connection draining
  • Multi-threaded — ThreadingHTTPServer handles concurrent requests without blocking
  • Dark-themed UI — clean, responsive single-page frontend

Quick Start

# Share a directory (upload + download)
python3 scripts/file_transfer_server.py --path /your/project/dir

# Upload only (PC → server)
python3 scripts/file_transfer_server.py --path /your/project/dir --mode upload-only

# Download only (server → PC), with PIN protection
python3 scripts/file_transfer_server.py --path /your/project/dir --mode download-only --password 5678

The server prints a JSON object on startup:

{
  "status": "running",
  "url": "http://198.51.100.42:32800/aB3xK9mP_qR7wZ2y",
  "token": "aB3xK9mP_qR7wZ2y",
  "pid": 12345,
  "mode": "both",
  "path": "/your/project/dir",
  "timeout_seconds": 1800
}

Open the url in your browser. That's it.

To stop: kill <pid>

Installation as Claude Code Skill

Method 1: Git Clone

git clone https://github.com/anthropics/AgentDrop.git
mkdir -p .claude/skills/file-transfer
cp AgentDrop/SKILL.md .claude/skills/file-transfer/
cp -r AgentDrop/assets .claude/skills/file-transfer/
cp -r AgentDrop/scripts .claude/skills/file-transfer/

Method 2: Manual Copy

Download the files and place them in your project:

your-project/
└── .claude/
    └── skills/
        └── file-transfer/
            ├── SKILL.md
            ├── assets/
            │   └── index.html
            └── scripts/
                └── file_transfer_server.py

After Installation

Claude Code will automatically recognize trigger phrases like:

  • "help me transfer files" / "send file"
  • "upload files to server" / "download files"
  • "share this directory"
  • "传文件" / "上传" / "下载" / "共享文件"

The skill handles launching the server, generating the URL, and stopping the service when you're done.

CLI Reference

python3 scripts/file_transfer_server.py [OPTIONS]
Parameter Default Description
--path (required) Directory to share
--mode both upload-only / download-only / both
--port random 32768–33768 Server port
--bind 0.0.0.0 Bind address
--password (none) 4-digit numeric PIN
--timeout 1800 Auto-shutdown in seconds (0 = disabled)

API Routes

All routes are prefixed with /{token}:

Method Route Description
GET /{token} Main page (HTML)
GET /{token}/list[/{subpath}] File listing (JSON)
GET /{token}/download/{path} Download a file
GET /{token}/preview/{path} Preview text file content (JSON)
GET /{token}/zip[/{path}] Download directory as ZIP
POST /{token}/upload Upload files (multipart/form-data, max 500MB)
POST /{token}/auth Password authentication (JSON)

Security

Mechanism Details
URL Token secrets.token_urlsafe(16) — 22-char random token in every URL
PIN Protection Optional 4-digit numeric password; rate-limited to 5 attempts per IP with 10-min auto-reset
Session secrets.token_hex(32) session ID, HttpOnly cookie, SameSite=Strict
Path Traversal Path.resolve() + relative_to() — all file access confined to --path
Dangerous Dirs /, /root, /home, /etc, /var, /usr, /boot, /proc, /sys, /dev — always blocked
Upload Limit 500MB max per request
Auto Timeout Default 30 min; graceful shutdown waits for active transfers (hard limit 10 min)
XSS Protection Markdown preview sanitizes javascript: / data: URLs

Architecture

AgentDrop/
├── README.md
├── README_CN.md
├── SKILL.md
├── LICENSE
├── assets/
│   └── index.html                  # Single-file frontend (HTML + CSS + vanilla JS)
└── scripts/
    └── file_transfer_server.py     # Server (~690 lines, Python stdlib only)

Server components:

Component Responsibility
MultipartParser Parse multipart/form-data uploads without external libs
FileTransferHandler HTTP routing, file serving, upload handling, auth, preview
ThreadedHTTPServer ThreadingMixIn + HTTPServer for concurrent requests
ServerManager Lifecycle management, token/session state, graceful shutdown

Frontend (index.html, single file):

  • Template variables: {{TOKEN}}, {{MODE}}, {{HAS_PASSWORD}}, {{SHARED_PATH}}
  • Drag & drop upload with concurrent queue (max 3 parallel XHR)
  • File browser with breadcrumb navigation and directory ZIP download
  • Text file preview modal with Markdown rendering
  • 4-digit PIN modal with auto-submit and paste support

Requirements

  • Python 3.9+
  • No external packages

License

MIT

About

Temporary file transfer server for remote development — drag & drop in your browser, zero dependencies.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages