mcp: add support for ui/download-file requests#298838
Merged
connor4312 merged 3 commits intomainfrom Mar 3, 2026
Merged
Conversation
- 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)
Contributor
There was a problem hiding this comment.
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
ChatResourceGroupWidgetand 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. |
src/vs/workbench/contrib/chat/common/widget/chatResponseResourceFileSystemProvider.ts
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatResourceGroupWidget.ts
Outdated
Show resolved
Hide resolved
...orkbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.ts
Outdated
Show resolved
Hide resolved
TylerLeonhardt
previously approved these changes
Mar 3, 2026
pwang347
approved these changes
Mar 3, 2026
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.
Fixes #298836
(Commit message generated by Copilot)