Feature Request: Work Item File Attachment Upload #1397
matjaz-sega
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Problem
The MCP server currently provides
wit_get_work_item_attachment(download) but has no corresponding upload capability. Agents that need to attach generated files (specs, plans, reports) to a work item must either fall back to theaz devopsCLI extension (which has known permission issues on Windows) or implement a raw REST API call usingaz account get-access-tokenandInvoke-RestMethod.This forces agents that should be analysis-only to request broad shell execution permissions (
run_in_terminal) just to perform a simple file upload.Proposed solution
Add two new tools:
wit_upload_attachmentUpload file content to ADO attachment storage. Returns the attachment URL.
Parameters:
project(string)fileName(string)content(string, base64-encoded)Returns:
{ "url": "https://dev.azure.com/.../_apis/wit/attachments/<guid>?fileName=..." }Maps to:
POST /_apis/wit/attachments?fileName={fileName}&api-version=7.1wit_add_attachmentLink an already-uploaded attachment URL to a work item.
Parameters:
workItemId(number)attachmentUrl(string)fileName(string)comment(string, optional)Maps to:
PATCH /_apis/wit/workItems/{id}with anadd /relations/-operation of typeAttachedFile.Why two tools?
The ADO REST API uses a two-step process (upload first, then link). Keeping them separate allows uploading multiple files and linking them in one patch if desired, and mirrors the underlying API shape.
Workaround currently required
This is exactly what the MCP server should encapsulate.
Beta Was this translation helpful? Give feedback.
All reactions