upload-and-share

📁 merit-systems/x402scan-skills 📅 2 days ago
1
总安装量
1
周安装量
#47112
全站排名
安装命令
npx skills add https://github.com/merit-systems/x402scan-skills --skill upload-and-share

Agent 安装分布

mcpjam 1
claude-code 1
replit 1
windsurf 1
zencoder 1

Skill 文档

Upload and Share via agentupload.dev

Upload any local file to S3-backed cloud storage via x402 micropayments. Returns a permanent public URL. No API keys needed.

Workflow

1. Check wallet balance

mcp__x402__get_wallet_info()

Ensure sufficient USDC balance for the chosen tier. If balance is low, show the deposit link.

2. Determine the tier

Pick the smallest tier that fits the file. Check file size first with ls -la or wc -c.

Tier Max Size Cost
10mb 10 MB $0.10
100mb 100 MB $1.00
1gb 1 GB $10.00

3. Buy the upload slot

mcp__x402__fetch(
  url: "https://agentupload.dev/api/x402/upload",
  method: "POST",
  headers: {"Content-Type": "application/json"},
  body: {"filename": "<name>", "contentType": "<mime>", "tier": "<tier>"}
)

Content type guidance: Use the correct MIME type for the file. Common types:

  • text/csv, application/json, text/plain for data files
  • application/pdf for PDFs
  • image/png, image/jpeg for images
  • application/zip for archives
  • application/octet-stream as a fallback for unknown types

The response contains uploadUrl (temporary, 1hr TTL) and publicUrl (permanent for 6 months).

4. Upload the file via curl

Use Bash to PUT the file to the returned uploadUrl:

curl -s -X PUT "<uploadUrl>" -H "Content-Type: <mime>" --data-binary @/absolute/path/to/file

Critical: Use --data-binary (not -d) to preserve binary content. Use the absolute path.

5. Share the public URL

Present the publicUrl to the user. This URL is publicly accessible immediately and remains live for 6 months.

Listing Previous Uploads

To list uploads for the current wallet:

mcp__x402__fetch_with_auth(
  url: "https://agentupload.dev/api/x402/uploads",
  method: "GET"
)

This uses SIWX (Sign-In With X) authentication, not x402 payment.

Key Details

  • No API keys required – payment is the authentication
  • Upload URLs expire in 1 hour – upload promptly after buying the slot
  • Public URLs last 6 months from purchase date
  • Any file type accepted – contentType is advisory for the browser, not a restriction
  • Discovery endpoint: mcp__x402__discover_api_endpoints(url: "https://agentupload.dev") if you need to verify endpoints

Common Patterns

Upload a file the user just created: Skip discovery, go straight to wallet check + buy slot + upload.

Upload multiple files: Buy separate slots for each file. Slots can be purchased in parallel but uploads must use the correct uploadUrl for each.

User asks to “share” or “send” a file: Upload it and present the public URL. The URL can be shared anywhere.

Error Handling

  • Insufficient balance: Show the deposit link from get_wallet_info
  • File too large for tier: Suggest the next tier up
  • Upload URL expired: Buy a new slot (the previous payment is non-refundable)
  • curl fails: Verify the file path exists and the uploadUrl is correctly quoted