---
name: upload-github-asset
description: Upload a local image or video to a GitHub repository through the GitHub Assets MCP server and return its stable URL and Markdown. Use when the user asks to upload, host, publish, embed, or attach a local media file for GitHub.
---

# Upload a GitHub asset

Use the connected GitHub Assets MCP tools to complete the upload.

1. Obtain the local file path and target `OWNER/REPOSITORY`. Ask for either value when it is missing.

2. Treat every new upload as public so GitHub Camo can fetch embedded images. Do not ask for or send a visibility option.

3. Read the local file to determine its exact byte size and lowercase SHA-256 digest. Do not send file content while collecting this metadata.

4. Create the upload and follow the mode, part size, part count, URLs, and other capabilities returned by the server. Do not hardcode upload thresholds or multipart settings.

5. Transfer file bytes directly from the local filesystem to the returned signed R2 URLs. Never encode or send the complete file through MCP arguments or conversation context.

6. For multipart mode, upload the requested byte ranges, preserve every returned ETag, and submit the parts in ascending part-number order. Respect any concurrency guidance returned by the server.

7. Complete the upload and return the stable URL and Markdown supplied by the server. If transfer or completion fails, make a best-effort attempt to cancel the upload before reporting the failure.

8. Never ask the user for, inspect, expose, log, or return GitHub tokens, R2 credentials, signed-URL secrets, or upload capability tokens.
