From 6a8f5031becbb791bc0ad07cbfb317f837929514 Mon Sep 17 00:00:00 2001 From: Anton Pidkuiko <105124934+antonpk1@users.noreply.github.com> Date: Tue, 9 Dec 2025 19:26:34 +0000 Subject: [PATCH] Fix mimeType, CSP settings and QR code example (#111) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix RESOURCE_MIME_TYPE to match spec: "text/html;profile=mcp-app" - Add CSP field to McpUiSandboxResourceReadyNotification type and schema - Update basic-host to extract and pass CSP metadata from resources - Update sandbox.ts to dynamically inject CSP meta tag into inner iframe - Remove static CSP from sandbox.html (now dynamic based on resource metadata) - Update QR server to use custom read_resource handler for _meta injection - Update requirements.txt to require mcp[cli]>=1.23.3 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude --- examples/basic-host/sandbox.html | 18 +----- examples/basic-host/src/implementation.ts | 45 +++++++++------ examples/basic-host/src/sandbox.ts | 42 +++++++++++++- examples/qr-server/requirements.txt | 2 +- examples/qr-server/server.py | 70 +++++++++++++++-------- examples/qr-server/widget.html | 2 +- src/app.ts | 2 +- src/types.ts | 13 +++++ 8 files changed, 133 insertions(+), 61 deletions(-) diff --git a/examples/basic-host/sandbox.html b/examples/basic-host/sandbox.html index f09d494..3714e29 100644 --- a/examples/basic-host/sandbox.html +++ b/examples/basic-host/sandbox.html @@ -2,22 +2,8 @@ - - + MCP-UI Proxy