-
Notifications
You must be signed in to change notification settings - Fork 412
feat(tools): add github-artifacts MCP server for issue image and attachment analysis #6158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Implemented `github_issue_images` tool to download images from GitHub issues and PRs. - Implemented `github_issue_attachments` tool to download and extract ZIP file attachments from GitHub issues. - Added test scripts for both tools to validate functionality. - Created necessary configuration files and server launch script for the MCP tools. - Updated documentation to include usage instructions for the new tools.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a new Model Context Protocol (MCP) server under tools/mcp/github-artifacts/ that enables GitHub Copilot prompts to download and analyze images and ZIP attachments from GitHub issues and pull requests. It also removes the model field from all prompt files and updates two prompt files to reference the new MCP tools.
Changes:
- New MCP server implementation with two tools:
github_issue_imagesfor downloading images as base64, andgithub_issue_attachmentsfor extracting ZIP files to local folders - Updated
.github/prompts/review-issue.prompt.mdand.github/prompts/review-pr.prompt.mdto document when and how to use the new MCP tools - Removed
model: 'GPT-5.1-Codex-Max'field from all prompt files (.github/prompts/*.prompt.md)
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
tools/mcp/github-artifacts/server.js |
Main MCP server with image/ZIP download and extraction logic |
tools/mcp/github-artifacts/package.json |
Package definition with dependencies (@modelcontextprotocol/sdk, jszip, zod) |
tools/mcp/github-artifacts/launch.js |
Bootstrap script that auto-installs dependencies before starting server |
tools/mcp/github-artifacts/.gitignore |
Excludes node_modules and package-lock.json |
tools/mcp/github-artifacts/test-github_issue_images.js |
Test script for image download tool |
tools/mcp/github-artifacts/test-github_issue_attachments.js |
Test script for ZIP attachment extraction tool |
.github/prompts/review-pr.prompt.md |
Added section on using github-artifacts MCP tools for linked issue artifacts |
.github/prompts/review-issue.prompt.md |
Added guidance on when to call github-artifacts MCP tools and updated CONTEXT section |
.github/prompts/fix-issue.prompt.md |
Removed model field from frontmatter |
.github/prompts/create-pr-summary.prompt.md |
Removed model field from frontmatter |
.github/prompts/create-commit-title.prompt.md |
Removed model field from frontmatter |
| - `github_issue_images`: use when the issue likely contains screenshots or other visual evidence (UI bugs, layout glitches, design problems). | ||
| - `github_issue_attachments`: use when the issue mentions attached ZIPs or diagnostic bundles (for example, `*.zip`, `logs.zip`, `debug.zip`). Always provide `extractFolder` as `Generated Files/issueReview/{{issue_number}}/logs`. | ||
|
|
||
| If these tools are not available, start the MCP server in `tools/mcp/github-artifacts/launch.js` and retry. |
Copilot
AI
Jan 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The instruction to "start the MCP server in tools/mcp/github-artifacts/launch.js and retry" is unclear. The prompt should clarify how to start the MCP server (e.g., whether it needs to be registered in VS Code settings, what command to run, etc.). Additionally, the MCP server cannot typically be started dynamically from within a prompt execution - it needs to be configured and started before the prompt runs.
| If these tools are not available, start the MCP server in `tools/mcp/github-artifacts/launch.js` and retry. | |
| If these tools are not available, do **not** attempt to start the MCP server from this prompt. Instead, instruct the user to configure and start the `github-artifacts` MCP server in VS Code (for example, by registering `tools/mcp/github-artifacts/launch.js` as an MCP server in Copilot settings and reloading VS Code), then re-run this prompt. For the current run, continue without these tools. |
| - `github_issue_images`: use when linked issues or PR discussion include screenshots (UI bugs, layout, design). | ||
| - `github_issue_attachments`: use when linked issues mention attached ZIPs or diagnostic bundles. Always provide `extractFolder` as `Generated Files/prReview/{{pr_number}}/issue-artifacts/<issue_number>`. | ||
|
|
||
| If these tools are not available, start the MCP server in `tools/mcp/github-artifacts/launch.js` and retry. |
Copilot
AI
Jan 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The instruction to "start the MCP server in tools/mcp/github-artifacts/launch.js and retry" is unclear. The prompt should clarify how to start the MCP server (e.g., whether it needs to be registered in VS Code settings, what command to run, etc.). Additionally, the MCP server cannot typically be started dynamically from within a prompt execution - it needs to be configured and started before the prompt runs.
| If these tools are not available, start the MCP server in `tools/mcp/github-artifacts/launch.js` and retry. | |
| If these tools are not available, ensure the `github-artifacts` MCP server is configured and enabled in your editor (for example, register `tools/mcp/github-artifacts/launch.js` in your Copilot Chat / MCP settings), then reload the client if needed and re-run this prompt. You cannot start this MCP server from within the prompt itself. |
|
|
||
| for (const zipUrl of zipUrls) { | ||
| try { | ||
| const urlPath = new URL(zipUrl).pathname; |
Copilot
AI
Jan 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new URL(zipUrl).pathname call at line 316 can throw an error if zipUrl is malformed or not a valid URL. While this is caught by the surrounding try-catch block, it would be better to validate the URL format before attempting to parse it, or provide a more specific error message to help users understand what went wrong.
| const urlPath = new URL(zipUrl).pathname; | |
| let urlPath; | |
| try { | |
| urlPath = new URL(zipUrl).pathname; | |
| } catch (e) { | |
| const message = e instanceof Error ? e.message : String(e); | |
| throw new Error(`Invalid ZIP URL '${zipUrl}': ${message}`); | |
| } |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Summary
Adds a new MCP (Model Context Protocol) server under
tools/mcp/github-artifacts/that enables Copilot prompts to download and analyze images and ZIP attachments from GitHub issues and PRs. Updatesreview-issue.prompt.mdandreview-pr.prompt.mdto leverage these new tools.Changes
New MCP Server (
tools/mcp/github-artifacts/)server.js— MCP server exposing two tools:github_issue_images— Downloads images from issue/PR body and comments, returns as base64 for LLM analysisgithub_issue_attachments— Downloads and extracts ZIP attachments (diagnostic bundles, logs) to local folder, returns text file contentslaunch.js— Bootstrap script that auto-installs dependencies before starting the serverpackage.json— Dependencies:@modelcontextprotocol/sdk,jszip,zodtest-github_issue_images.js/test-github_issue_attachments.js— Test scripts for verifying tool functionality.gitignore— Excludesnode_modules/andpackage-lock.jsonUpdated Copilot Prompts
.github/prompts/review-issue.prompt.md— Added## When to call MCP tools (github-artifacts)section with guidance on when to usegithub_issue_imagesandgithub_issue_attachments; updated CONTEXT section to explicitly reference these tools.github/prompts/review-pr.prompt.md— Added## Issue/PR artifacts (github-artifacts MCP)section for pulling supporting evidence from linked issuesImpacted Areas
tools/mcp/github-artifacts/*.github/prompts/review-issue.prompt.md,.github/prompts/review-pr.prompt.mdValidation
npm testintools/mcp/github-artifacts/to verify MCP server functionality (requiresGITHUB_TOKENenv var)Notes
GITHUB_TOKENenvironment variable for API authenticationunzipon other platforms.txt,.log,.json,.xml, etc.) and capped at 100KB per fileA microsoft employee must use /azp run to validate using the pipelines below.
WARNING:
Comments made by azure-pipelines bot maybe inaccurate.
Please see pipeline link to verify that the build is being ran.
For status checks on the main branch, please use TransportPackage-Foundation-PR
(https://microsoft.visualstudio.com/ProjectReunion/_build?definitionId=81063&_a=summary)
and run the build against your PR branch with the default parameters.