fix(client): apply host color scheme to saved MCP apps #17026
MergedPixPMusic(GitHub profile, opens in a new tab)merged 2 commits into
main fromrefs/pull/17026/headmerged by juliusmarminge View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
coderabbitai[bot](GitHub profile, opens in a new tab) approved these changes
coderabbitai[bot](GitHub profile, opens in a new tab) requested changes
apps/server/src/http.ts lines 183 to 187OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -167,9 +168,20 @@167168 readonly fileName?: string;168169 readonly mimeType?: string;169170 readonly file?: OpenMediaFile;171+ readonly renderIntent?: "mcp-app";170172 },171173 rangeHeader?: string,172174 ifRangeHeader?: string,173175 method: "GET" | "HEAD" = "GET",174176 ) {175177 const headers = assetResponseHeaders(asset.path, asset);178+ if (179+ asset.renderIntent === "mcp-app" &&180+ !asset.download &&181+ headers["Content-Type"] === "text/html; charset=utf-8"182+ ) {183+ const fs = yield* FileSystem.FileSystem;184+ // Stored snapshots also contain a bounded CSP meta tag (up to 32 domains185+ // per directive). Bound the read even if the attachment grows after minting.186+ const limit = MCP_APP_MAX_HTML_BYTES + 128 * 1024;187+ const chunks = yield* Stream.runCollect(fs.stream(asset.path, { bytesToRead: limit + 1 }));juliusmarminge added labelsmacroscope-review
- apps/server/src/http.ts line 187OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -167,9 +168,20 @@167168 readonly fileName?: string;168169 readonly mimeType?: string;169170 readonly file?: OpenMediaFile;171+ readonly renderIntent?: "mcp-app";170172 },171173 rangeHeader?: string,172174 ifRangeHeader?: string,173175 method: "GET" | "HEAD" = "GET",174176 ) {175177 const headers = assetResponseHeaders(asset.path, asset);178+ if (179+ asset.renderIntent === "mcp-app" &&180+ !asset.download &&181+ headers["Content-Type"] === "text/html; charset=utf-8"182+ ) {183+ const fs = yield* FileSystem.FileSystem;184+ // Stored snapshots also contain a bounded CSP meta tag (up to 32 domains185+ // per directive). Bound the read even if the attachment grows after minting.186+ const limit = MCP_APP_MAX_HTML_BYTES + 128 * 1024;187+ const chunks = yield* Stream.runCollect(fs.stream(asset.path, { bytesToRead: limit + 1 }));
coderabbitai[bot](GitHub profile, opens in a new tab) approved these changes
juliusmarminge merged this2e19207
juliusmarminge closed this
Sign in to join this conversation.


macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed