Skip to content

Conversation

@yeelam-gordon
Copy link
Contributor

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. Updates review-issue.prompt.md and review-pr.prompt.md to 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 analysis
    • github_issue_attachments — Downloads and extracts ZIP attachments (diagnostic bundles, logs) to local folder, returns text file contents
  • launch.js — Bootstrap script that auto-installs dependencies before starting the server
  • package.json — Dependencies: @modelcontextprotocol/sdk, jszip, zod
  • test-github_issue_images.js / test-github_issue_attachments.js — Test scripts for verifying tool functionality
  • .gitignore — Excludes node_modules/ and package-lock.json

Updated Copilot Prompts

  • .github/prompts/review-issue.prompt.md — Added ## When to call MCP tools (github-artifacts) section with guidance on when to use github_issue_images and github_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 issues

Impacted Areas

Area Files
MCP tooling tools/mcp/github-artifacts/*
Copilot prompts .github/prompts/review-issue.prompt.md, .github/prompts/review-pr.prompt.md

Validation

  • Build validation: N/A — This PR adds Node.js tooling and Markdown files only; no C++/C# SDK code changes
  • Test validation: Run npm test in tools/mcp/github-artifacts/ to verify MCP server functionality (requires GITHUB_TOKEN env var)

Notes

  • The MCP server requires a GITHUB_TOKEN environment variable for API authentication
  • ZIP extraction uses native PowerShell on Windows or unzip on other platforms
  • Text file contents are limited to common extensions (.txt, .log, .json, .xml, etc.) and capped at 100KB per file

A 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.

- 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.
Copy link
Contributor

Copilot AI left a 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_images for downloading images as base64, and github_issue_attachments for extracting ZIP files to local folders
  • Updated .github/prompts/review-issue.prompt.md and .github/prompts/review-pr.prompt.md to 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.
Copy link

Copilot AI Jan 23, 2026

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.

Suggested change
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.

Copilot uses AI. Check for mistakes.
- `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.
Copy link

Copilot AI Jan 23, 2026

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.

Suggested change
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.

Copilot uses AI. Check for mistakes.

for (const zipUrl of zipUrls) {
try {
const urlPath = new URL(zipUrl).pathname;
Copy link

Copilot AI Jan 23, 2026

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.

Suggested change
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}`);
}

Copilot uses AI. Check for mistakes.
yeelam-gordon and others added 2 commits January 23, 2026 13:56
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants