mcp: implement McpUiUpdateModelContextRequest handler (#289474)
Implements the ui/update-model-context MCP Apps protocol method to allow MCP UIs to update the chat widget's model context with structured data and content attachments. Each update replaces only the context added by that specific MCP app instance, preserving user-added attachments. - Maps MCP content blocks to chat attachments: - Images become image attachments - Resource links become file attachments using McpResourceURI - Text blocks become generic attachments with preview and tooltip - Structured content becomes a single JSON attachment formatted nicely - Uses hashed server ID prefix to track and replace only app-specific context - Announces updateModelContext capability in host capabilities Fixes https://github.com/microsoft/vscode/issues/289473 (Commit message generated by Copilot)
C
Connor Peet committed
8ae978b2234a6ee3650ce51dd5bc40c76aea18d4
Parent: 868d1ca
Committed by GitHub <[email protected]>
on 1/21/2026, 9:03:16 PM