Skip to content

feat: work item attachments + PR thread comments#11

Merged
viamus merged 1 commit into
mainfrom
feature/attachments-and-thread-comments
May 2, 2026
Merged

feat: work item attachments + PR thread comments#11
viamus merged 1 commit into
mainfrom
feature/attachments-and-thread-comments

Conversation

@viamus
Copy link
Copy Markdown
Owner

@viamus viamus commented May 2, 2026

Summary

Closes three functional gaps in the MCP server:

  • get_work_item_attachments — lists files attached to a work item: id (GUID), name, size (bytes), comment, createdDate, modifiedDate, and download url. Reads work item relations filtered by Rel == "AttachedFile".
  • get_work_item_attachment_content — downloads an attachment by GUID and returns content inline so it can feed Claude Code sessions directly. UTF-8 for textual files, base64 for binaries (isBinary + encoding flags). Default 10 MB cap (maxBytes); larger files are rejected with guidance to use the URL out-of-band.
  • add_pull_request_thread_comment — replies to existing PR comment threads (the read side already existed via get_pull_request_threads). Accepts optional parentCommentId for threaded replies.

Mirrors existing service/tool patterns: validation in the tool, mapping in the service, JSON-serialized response.

Test plan

  • dotnet build clean
  • dotnet test — 281/281 passing
  • Manual: get_work_item_attachments against work item 2413308 returned 2 attachments with correct sizes
  • Manual: get_work_item_attachment_content with binary (xlsx 10029 B → base64) and text (json 548812 B → UTF-8) attachments — content matches direct PAT download byte-for-byte
  • Manual: add_pull_request_thread_comment against a throwaway PR thread (not yet exercised — recommend reviewer test before merge)

🤖 Generated with Claude Code

Adds three MCP tools to close functional gaps in the work item and
pull request domains:

- get_work_item_attachments: lists attachments (name, size, dates, URL)
- get_work_item_attachment_content: downloads inline as UTF-8 or base64
  with a 10 MB cap for session-friendly responses
- add_pull_request_thread_comment: replies to existing PR threads, with
  optional parentCommentId for threaded replies

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@viamus viamus merged commit d59a012 into main May 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant