dropbox
# Dropbox Manager Skill
What this skill does
# Dropbox Manager Skill
Manage Dropbox files via MCP server and CLI. Swift-native implementation using SwiftyDropbox SDK with OAuth 2.0 PKCE and secure Keychain token storage.
## Setup
### Prerequisites
```bash
# Clone and build Dropbook
git clone https://github.com/RyanLisse/Dropbook.git
cd Dropbook
make build
```
### Authentication
#### Option 1: OAuth Login with Keychain (Recommended)
Use the interactive OAuth flow with secure Keychain storage:
```bash
export DROPBOX_APP_KEY="your_dropbox_app_key"
export DROPBOX_APP_SECRET="your_dropbox_app_secret"
make login
# or: swift run dropbook login
```
This will:
1. Generate PKCE code verifier and challenge (SHA256, RFC 7636)
2. Open an authorization URL with state parameter (CSRF protection)
3. Prompt you to paste the authorization code
4. Exchange code for access and refresh tokens
5. **Save tokens to macOS Keychain** (hardware-backed encryption)
6. Fall back to `~/.dropbook/auth.json` if Keychain unavailable
7. Enable automatic token refreshing
**Security Features (RFC 9700 compliant):**
- PKCE with S256 challenge method
- State parameter for CSRF protection
- Keychain storage with `kSecAttrAccessibleWhenUnlocked`
- CryptoKit for cryptographic operations
#### Option 2: Environment Variables (Legacy)
```bash
export DROPBOX_APP_KEY="your_dropbox_app_key"
export DROPBOX_APP_SECRET="your_dropbox_app_secret"
export DROPBOX_ACCESS_TOKEN="your_dropbox_access_token"
```
**Note**: Manual tokens don't support automatic refreshing. Use OAuth login for production use.
### Logout
Clear stored tokens from both Keychain and file storage:
```bash
make logout
# or: swift run dropbook logout
```
## MCP Server (Recommended)
Start the MCP server:
```bash
make mcp
# or: ./.build/debug/dropbook mcp
```
### MCP Tools
| Tool | Description |
|------|-------------|
| `list_directory` | List files and folders in a Dropbox directory |
| `search` | Search for files by name or content |
| `upload` | Upload a file to Dropbox |
| `download` | Download a file from Dropbox |
| `delete` | Delete a file or folder (moves to trash) |
| `get_account_info` | Get account name and email |
| `read_file` | Read contents of a text file |
#### list_directory
List files and folders in a Dropbox directory.
**Parameters:**
- `path` (string, optional): Directory path. Default: "/"
**Response:**
```json
{
"files": [
{"type": "file", "name": "doc.pdf", "path": "/Docs/doc.pdf", "size": 1024},
{"type": "folder", "name": "Projects", "path": "/Projects"}
]
}
```
#### search
Search for files by name or content.
**Parameters:**
- `query` (string, required): Search term
- `path` (string, optional): Path to search within. Default: "/"
**Response:**
```json
{
"count": 2,
"results": [
{"matchType": "filename", "metadata": {"name": "report.pdf", "path": "/Docs/report.pdf"}}
]
}
```
#### upload
Upload a file to Dropbox.
**Parameters:**
- `localPath` (string, required): Absolute path to local file
- `remotePath` (string, required): Destination in Dropbox
- `overwrite` (boolean, optional): Replace if exists. Default: false
**Response:**
```json
{
"uploaded": true,
"name": "file.txt",
"path": "/Uploads/file.txt",
"size": 5000
}
```
#### download
Download a file from Dropbox.
**Parameters:**
- `remotePath` (string, required): File path in Dropbox
- `localPath` (string, required): Local destination path
**Response:**
```json
{
"downloaded": true,
"to": "/tmp/report.pdf"
}
```
#### delete
Delete a file or folder from Dropbox (moves to trash).
**Parameters:**
- `path` (string, required): Path to delete in Dropbox
**Response:**
```json
{
"deleted": true,
"path": "/Docs/old-file.pdf"
}
```
#### get_account_info
Get Dropbox account information.
**Parameters:** None
**Response:**
```json
{
"name": "Ryan Lisse",
"email": "[email protected]"
}
```
#### read_file
Read and return the contents of a text file from Dropbox.
**Parameters:**
- `path` (string, required): Path to file in Dropbox
**Response:**
Returns the file contents as text. Only works with UTF-8 encoded text files.
## CLI Commands
```bash
# Authentication
make login # OAuth login with Keychain storage
make logout # Clear stored tokens
# File operations
make list # List root directory
swift run dropbook list /path
# Search files
swift run dropbook search "query" [path]
# Upload file
swift run dropbook upload /local/path /remote/path [--overwrite]
# Download file
swift run dropbook download /remote/path /local/path
# Start MCP server
make mcp
```
## MCP Client Configuration
### Claude Code (Project-level)
The project includes a `.mcp.json` file that configures the MCP server:
```json
{
"mcpServers": {
"dropbox": {
"command": "/path/to/Dropbook/.build/debug/dropbook",
"args": ["mcp"],
"env": {
"DROPBOX_APP_KEY": "${DROPBOX_APP_KEY}",
"DROPBOX_APP_SECRET": "${DROPBOX_APP_SECRET}"
}
}
}
}
```
Enable project MCP servers in Claude Code settings.json:
```json
{
"enableAllProjectMcpServers": true
}
```
### Claude Desktop
```json
{
"mcpServers": {
"dropbox": {
"command": "/path/to/dropbook/.build/debug/dropbook",
"args": ["mcp"],
"env": {
"DROPBOX_APP_KEY": "${DROPBOX_APP_KEY}",
"DROPBOX_APP_SECRET": "${DROPBOX_APP_SECRET}"
}
}
}
}
```
## Error Handling
| Error | Cause | Solution |
|-------|-------|----------|
| `notConfigured` | Missing env vars | Set DROPBOX_APP_KEY, DROPBOX_APP_SECRET |
| `invalidArguments` | Missing required params | Check tool parameters |
| `notFound` | Path doesn't exist | Use `list_directory` to verify paths |
| `itemNotFound` | No token in Keychain | Run `make login` to authenticate |
## Architecture
```
Dropbook/
├── Sources/
│ ├── DropbookCore/ # Business logic (actor-based)
│ │ ├── Auth/ # Keychain & file token storage
│ │ ├── Config/ # Configuration management
│ │ ├── Models/ # Domain models
│ │ └── Services/ # DropboxService actor
│ ├── DropbookCLI/ # CLI adapter
│ │ └── Commands/ # Login, logout, file commands
│ └── DropbookMCP/ # MCP server
├── dropbox-skill/ # Skill documentation
├── Makefile # Build automation
├── .mcp.json # MCP server configuration
└── Package.swift
```
## Bulk Operations with rclone
For large-scale operations like backups, syncing, or bulk transfers, use [rclone](https://rclone.org/) - a powerful cloud sync tool with native Dropbox support.
### Install rclone
```bash
brew install rclone
```
### Configure rclone for Dropbox
```bash
# Interactive setup (opens browser for OAuth)
rclone authorize dropbox
# Save the token output to config
mkdir -p ~/.config/rclone
cat > ~/.config/rclone/rclone.conf << 'EOF'
[dropbox]
type = dropbox
token = {"access_token":"...paste token here..."}
EOF
```
### Backup to Network Drive / Time Capsule
```bash
# Full backup with progress
rclone copy dropbox: /Volumes/TimeCapsule/Dropbox-Backup \
--progress \
--transfers 4 \
--checkers 8 \
--retries 10 \
--log-file /tmp/dropbox-backup.log
# Sync (mirror - deletes files not in source)
rclone sync dropbox: /Volumes/Backup/Dropbox --progress
# Check what would be copied (dry run)
rclone copy dropbox: /Volumes/Backup --dry-run
```
### Common rclone Commands
```bash
# List remote contents
rclone lsd dropbox: # List directories
rclone ls dropbox: # List all files
rclone size dropbox: # Calculate total size
# Copy operations
rclone copy dropbox:folder /local/path # Download folder
rclone copy /local/path dropbox:folder # Upload folder
# Sync (bidirectional)
rclone bisync dropbox: /local/path --resync
# Mount as filesystem (macOS - requires macFUSE)
rclone mount dropbox: /mnt/dropbox --vfs-cache-mode full
`Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.