feat(server): add issue-attachment tools (upload/list/download/delete) #20
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/issue-attachment-tools-FJMCP-17"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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::issuesattachment functions that landed in forgejo-cli FJCLI-43, per the repo rule to wirefj_core::*rather than callforgejo-apidirectly.add_issue_attachment takes the file as either a server-side
file_path(stdio transport) or base64contentwithfilename(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 throughforgejo-api, so the byte download goes throughfj_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