feat: work item attachments + PR thread comments#11
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 downloadurl. Reads work item relations filtered byRel == "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+encodingflags). 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 viaget_pull_request_threads). Accepts optionalparentCommentIdfor threaded replies.Mirrors existing service/tool patterns: validation in the tool, mapping in the service, JSON-serialized response.
Test plan
dotnet buildcleandotnet test— 281/281 passingget_work_item_attachmentsagainst work item 2413308 returned 2 attachments with correct sizesget_work_item_attachment_contentwith binary (xlsx 10029 B → base64) and text (json 548812 B → UTF-8) attachments — content matches direct PAT download byte-for-byteadd_pull_request_thread_commentagainst a throwaway PR thread (not yet exercised — recommend reviewer test before merge)🤖 Generated with Claude Code