Skip to content

mcp: add support for ui/download-file requests#298838

Merged
connor4312 merged 3 commits intomainfrom
connor4312/298836
Mar 3, 2026
Merged

mcp: add support for ui/download-file requests#298838
connor4312 merged 3 commits intomainfrom
connor4312/298836

Conversation

@connor4312
Copy link
Member

  • Adds McpUiDownloadFileRequest and McpUiDownloadFileResult types to modelContextProtocolApps.ts for MCP apps to request file downloads
  • Introduces IChatResponseResourceFileSystemProvider interface with an associate() method to store arbitrary data in the chat response filesystem and track it by session for cleanup
  • Extracts ChatResourceGroupWidget as a reusable component for rendering resource groups with save/download actions, used by both ChatToolOutputContentSubPart and MCP app downloads
  • Adds _handleDownloadFile() in ChatMcpAppModel to process download requests, supporting both inline EmbeddedResource and ResourceLink types from the MCP protocol
  • Adds download resource container in ChatMcpAppSubPart that renders downloaded resources as attachment pills with toolbar actions
  • Registers IChatResponseResourceFileSystemProvider as a singleton service

Fixes #298836

(Commit message generated by Copilot)

- Adds McpUiDownloadFileRequest and McpUiDownloadFileResult types to modelContextProtocolApps.ts for MCP apps to request file downloads
- Introduces IChatResponseResourceFileSystemProvider interface with an associate() method to store arbitrary data in the chat response filesystem and track it by session for cleanup
- Extracts ChatResourceGroupWidget as a reusable component for rendering resource groups with save/download actions, used by both ChatToolOutputContentSubPart and MCP app downloads
- Adds _handleDownloadFile() in ChatMcpAppModel to process download requests, supporting both inline EmbeddedResource and ResourceLink types from the MCP protocol
- Adds download resource container in ChatMcpAppSubPart that renders downloaded resources as attachment pills with toolbar actions
- Registers IChatResponseResourceFileSystemProvider as a singleton service

Fixes #298836

(Commit message generated by Copilot)
- Adds McpUiDownloadFileRequest and McpUiDownloadFileResult types
- Introduces IChatResponseResourceFileSystemProvider interface
- Extracts ChatResourceGroupWidget as reusable component
- Adds _handleDownloadFile in ChatMcpAppModel
- Adds download container in ChatMcpAppSubPart
- Registers IChatResponseResourceFileSystemProvider singleton

Fixes #298836

(Commit message generated by Copilot)
Copilot AI review requested due to automatic review settings March 3, 2026 00:05
@vs-code-engineering vs-code-engineering bot added this to the March 2026 milestone Mar 3, 2026
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

Adds MCP ui/download-file support to the VS Code chat/MCP integration by introducing protocol types, a reusable resource-group UI widget, and a chat-response resource filesystem association API to back downloaded attachments.

Changes:

  • Add MCP protocol request/result types and capability flag for ui/download-file.
  • Introduce IChatResponseResourceFileSystemProvider.associate() to store arbitrary in-memory blobs per chat session for later download/save.
  • Refactor resource rendering into ChatResourceGroupWidget and surface MCP app downloads under the MCP app webview.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/vs/workbench/contrib/chat/common/widget/chatResponseResourceFileSystemProvider.ts Adds a service interface and in-memory association store keyed by session for downloadable resources.
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.ts Renders a downloads container below the MCP webview using the shared resource-group widget.
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.ts Handles ui/download-file requests and converts MCP resources into downloadable parts.
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatConfirmationWidget.css Adds styling/animation for the MCP download container.
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolOutputContentSubPart.ts Switches tool output resource rendering to use the extracted ChatResourceGroupWidget.
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatResourceGroupWidget.ts New reusable widget for resource pills + toolbar actions (download/save).
src/vs/workbench/contrib/chat/browser/chat.contribution.ts Registers the new filesystem provider service as a singleton (in addition to existing contribution registration).
src/vs/platform/mcp/common/modelContextProtocolApps.ts Adds MCP app protocol types/constants/capabilities for ui/download-file.

TylerLeonhardt
TylerLeonhardt previously approved these changes Mar 3, 2026
@connor4312 connor4312 merged commit 96681dc into main Mar 3, 2026
20 checks passed
@connor4312 connor4312 deleted the connor4312/298836 branch March 3, 2026 17:51
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.

MCP Apps: support download call

4 participants