feat(tools): add issue attachment upload/download/delete tools #17

Merged
David merged 1 commit from feat/issue-attachment-tools into main 2026-06-19 09:51:21 +02:00
Owner

Surface the attachment capabilities already provided by youtrack-client (upload_attachment, download_attachment, delete_attachment) as MCP tools so an agent can attach screenshots and logs without leaving the MCP for the web UI. Only list_issue_attachments was previously exposed.

add_issue_attachment accepts a local file_path (primary) or base64 content with a required filename; the two are mutually exclusive. The file name's extension drives the MIME type YouTrack infers server-side. Base64 uploads are staged in a uniquely-named temp file (cleaned up regardless of outcome) so they flow through the canonical youtrack-client upload path. Uploads above 25 MiB are rejected before any network call with an actionable invalid-params error, and a path-component strip on caller-supplied filenames prevents temp-dir escape.

get_issue_attachment resolves an attachment id to its metadata via the list endpoint, downloads the bytes, and returns them base64-encoded alongside id/name/url/size/mimeType. delete_issue_attachment removes an attachment by id.

Adds an invalid_params error helper and unit tests for the pure upload-source validation (mutual exclusion, missing filename, bad base64, oversize, path stripping).

#YTMCP-12

Surface the attachment capabilities already provided by youtrack-client (upload_attachment, download_attachment, delete_attachment) as MCP tools so an agent can attach screenshots and logs without leaving the MCP for the web UI. Only list_issue_attachments was previously exposed. add_issue_attachment accepts a local file_path (primary) or base64 content with a required filename; the two are mutually exclusive. The file name's extension drives the MIME type YouTrack infers server-side. Base64 uploads are staged in a uniquely-named temp file (cleaned up regardless of outcome) so they flow through the canonical youtrack-client upload path. Uploads above 25 MiB are rejected before any network call with an actionable invalid-params error, and a path-component strip on caller-supplied filenames prevents temp-dir escape. get_issue_attachment resolves an attachment id to its metadata via the list endpoint, downloads the bytes, and returns them base64-encoded alongside id/name/url/size/mimeType. delete_issue_attachment removes an attachment by id. Adds an invalid_params error helper and unit tests for the pure upload-source validation (mutual exclusion, missing filename, bad base64, oversize, path stripping). #YTMCP-12
feat(tools): add issue attachment upload/download/delete tools
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 27s
Create release / Create release from merged PR (pull_request) Has been skipped
a9ebf01a25
Surface the attachment capabilities already provided by youtrack-client (upload_attachment, download_attachment, delete_attachment) as MCP tools so an agent can attach screenshots and logs without leaving the MCP for the web UI. Only list_issue_attachments was previously exposed.

add_issue_attachment accepts a local file_path (primary) or base64 content with a required filename; the two are mutually exclusive. The file name's extension drives the MIME type YouTrack infers server-side. Base64 uploads are staged in a uniquely-named temp file (cleaned up regardless of outcome) so they flow through the canonical youtrack-client upload path. Uploads above 25 MiB are rejected before any network call with an actionable invalid-params error, and a path-component strip on caller-supplied filenames prevents temp-dir escape.

get_issue_attachment resolves an attachment id to its metadata via the list endpoint, downloads the bytes, and returns them base64-encoded alongside id/name/url/size/mimeType. delete_issue_attachment removes an attachment by id.

Adds an invalid_params error helper and unit tests for the pure upload-source validation (mutual exclusion, missing filename, bad base64, oversize, path stripping).

#YTMCP-12
David merged commit f4de42e584 into main 2026-06-19 09:51:21 +02:00
David deleted branch feat/issue-attachment-tools 2026-06-19 09:51:21 +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/youtrack-mcp!17
No description provided.