forgejo-mcp/operation/params
Christoph Görn 03aaf58679
feat: ✨ add issue & comment attachment tools (closes #106)
Implements 12 new MCP tools for full CRUD on issue and comment
attachments via a new raw-HTTP helper, bypassing the SDK gap.

New packages:
- pkg/forgejo/rawhttp.go: DoJSON, DoJSONList, DoMultipart, DoRaw
  with 1 MiB inline cap (ErrPayloadTooLarge sentinel), auth-header
  propagation, and 401/403/404 error sentinels
- operation/attachment/attachment.go: 12 tools registered under the
  new "attachment" CLI domain

Key design decisions (see docs/plans/issue-attachments.md):
- Files < 1 MiB: inline as BlobResourceContents + metadata JSON
- Files >= 1 MiB: metadata + browser_download_url only; caller fetches
  with Authorization: token (verified live against Codeberg API)
- Always includes browser_download_url regardless of size
- 404 on list endpoints treated as empty array, not error

Also:
- operation/params/params.go: attachment param descriptions
- operation/operation.go + cmd/cli.go: registration wired
- README.md: tool table updated
- demos/issue-attachments.md + demos/comment-attachments.md added
2026-04-26 13:10:49 +02:00
..
params.go feat: ✨ add issue & comment attachment tools (closes #106) 2026-04-26 13:10:49 +02:00