polaroid
v0.1.1Image hosting for agents to embed screenshots in GitHub issues, comments and PRs
Lets agents put images in GitHub issues, comments and PRs, which the GitHub API can't upload. Point a DNS record at the host, open ports 80 and 443, then: Caddy obtains the HTTPS certificate automatically (GitHub's camo image proxy requires HTTPS). Images live in the images volume, so back that up. Update with git pull && docker compose up -d --build.
Summary extracted from the README.
Lets agents put images in GitHub issues, comments and PRs, which the GitHub API can't upload.
Images are public to anyone holding the URL. The URLs are unguessable (128-bit random), but a leaked link exposes the image. Only uploading is gated: the uploader's GitHub token must have push access to the target repo.
Server
Point a DNS record at the host, open ports 80 and 443, then:
git clone https://github.com/marcreichel/polaroid.git && cd polaroid
echo DOMAIN=img.example.com > .env
docker compose up -d --build
Caddy obtains the HTTPS certificate automatically (GitHub's camo image proxy requires HTTPS). Images live in the images volume, so back that up. Update with git pull && docker compose up -d --build.
Behind an existing reverse proxy, run only the polaroid service and route the domain to port 3000. Allow request bodies of at least 10 MB.
| Env | Default |
|---|---|
PUBLIC_URL |
http://localhost:3000 |
DATA_DIR |
/data |
PORT |
3000 |
API: POST /upload?repo=owner/name with Authorization: Bearer <github token> and the raw image as the body. Accepts png, jpg, gif and webp (detected from the bytes), max 10 MB. Returns {"url": ...}. GET /<owner>/<repo>/<id>.<ext> serves the image.
MCP client (local, stdio)
{
"mcpServers": {
"polaroid": {
"command": "npx",
"args": ["-y", "@marcreichel/polaroid"],
"env": { "POLAROID_URL": "https://img.example.com" }
}
}
}
The token comes from GITHUB_TOKEN, falling back to gh auth token. Tool: upload_image(repo, path, alt?) returns Markdown ready to paste.