feat(server): add issue-attachment tools (upload/list/download/delete) #20

Merged
David merged 1 commit from feat/issue-attachment-tools-FJMCP-17 into main 2026-06-20 14:40:41 +02:00
Owner

Adds four MCP tools so an agent can attach and retrieve evidence (screenshots, logs) on a Forgejo issue without leaving the MCP for the web UI: list_issue_attachments (READ), add_issue_attachment (EDIT), download_issue_attachment (READ), and delete_issue_attachment (DELETE). Each wraps the fj_core::issues attachment functions that landed in forgejo-cli FJCLI-43, per the repo rule to wire fj_core::* rather than call forgejo-api directly.

add_issue_attachment takes the file as either a server-side file_path (stdio transport) or base64 content with filename (HTTP transport, where the server cannot read the caller's files); exactly one is required. Forgejo infers the MIME type from the name's extension server-side, and rejects an oversized upload with the instance's size-limit error, which propagates as an internal error. download_issue_attachment resolves the asset by id, fetches its browser_download_url with the host bearer token (issue attachments expose only metadata through forgejo-api, so the byte download goes through fj_client::download_attachment), and writes the bytes to a local file returning { path, bytes, filename } like the release-archive tools rather than streaming bytes through the text channel.

Bumps the fj-core/fj-client pin to forgejo-cli main 8f27115 (the FJCLI-43 merge) and adds a direct base64 dependency for content decoding. README tool tables and the server instructions list the new tools.

#FJMCP-17

Adds four MCP tools so an agent can attach and retrieve evidence (screenshots, logs) on a Forgejo issue without leaving the MCP for the web UI: list_issue_attachments (READ), add_issue_attachment (EDIT), download_issue_attachment (READ), and delete_issue_attachment (DELETE). Each wraps the `fj_core::issues` attachment functions that landed in forgejo-cli FJCLI-43, per the repo rule to wire `fj_core::*` rather than call `forgejo-api` directly. add_issue_attachment takes the file as either a server-side `file_path` (stdio transport) or base64 `content` with `filename` (HTTP transport, where the server cannot read the caller's files); exactly one is required. Forgejo infers the MIME type from the name's extension server-side, and rejects an oversized upload with the instance's size-limit error, which propagates as an internal error. download_issue_attachment resolves the asset by id, fetches its browser_download_url with the host bearer token (issue attachments expose only metadata through `forgejo-api`, so the byte download goes through `fj_client::download_attachment`), and writes the bytes to a local file returning { path, bytes, filename } like the release-archive tools rather than streaming bytes through the text channel. Bumps the fj-core/fj-client pin to forgejo-cli main 8f27115 (the FJCLI-43 merge) and adds a direct base64 dependency for content decoding. README tool tables and the server instructions list the new tools. #FJMCP-17
feat(server): add issue-attachment tools (upload/list/download/delete)
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 38s
Create release / Create release from merged PR (pull_request) Has been skipped
089d71d51b
Adds four MCP tools so an agent can attach and retrieve evidence (screenshots, logs) on a Forgejo issue without leaving the MCP for the web UI: list_issue_attachments (READ), add_issue_attachment (EDIT), download_issue_attachment (READ), and delete_issue_attachment (DELETE). Each wraps the `fj_core::issues` attachment functions that landed in forgejo-cli FJCLI-43, per the repo rule to wire `fj_core::*` rather than call `forgejo-api` directly.

add_issue_attachment takes the file as either a server-side `file_path` (stdio transport) or base64 `content` with `filename` (HTTP transport, where the server cannot read the caller's files); exactly one is required. Forgejo infers the MIME type from the name's extension server-side, and rejects an oversized upload with the instance's size-limit error, which propagates as an internal error. download_issue_attachment resolves the asset by id, fetches its browser_download_url with the host bearer token (issue attachments expose only metadata through `forgejo-api`, so the byte download goes through `fj_client::download_attachment`), and writes the bytes to a local file returning { path, bytes, filename } like the release-archive tools rather than streaming bytes through the text channel.

Bumps the fj-core/fj-client pin to forgejo-cli main 8f27115 (the FJCLI-43 merge) and adds a direct base64 dependency for content decoding. README tool tables and the server instructions list the new tools.

#FJMCP-17
David merged commit 760d2dceab into main 2026-06-20 14:40:41 +02:00
David deleted branch feat/issue-attachment-tools-FJMCP-17 2026-06-20 14:40:42 +02:00
Commenting is not possible because the repository is archived.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
pandoras-box/forgejo-mcp!20
No description provided.