mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2473] [CLOSED] [GUI] MCP cached image previews and authenticated downloads #4059
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4059
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/2473
Author: @cuijinkuo
Created: 10/14/2026
Status: ❌ Closed
Base:
main← Head:codex/mcp-image-results📝 Commits (7)
5463b11mcp: add opt-in cached image previews and authenticated downloadseb7c6e1mcp: parse image opt-in and tolerate stale cached history767d72cMerge upstream main and preserve MCP cache ignore rules0b9ad57web: keep MCP image chats within narrow viewports429c900docs: explain web search and generated image tool setupfcc62c6Merge Strata 0.2 main and preserve cached MCP image previews645099fMerge remote-tracking branch 'origin/main' into codex/live-022-20261022📊 Changes
8 files changed (+655 additions, -10 deletions)
View changed files
📝
.gitignore(+4 -0)➕
docs/MCP_IMAGES.md(+27 -0)➕
docs/MCP_TOOLS_GUIDE.md(+177 -0)📝
serve/mcp.py(+59 -3)📝
serve/server.py(+46 -2)➕
serve/test_mcp_media.py(+289 -0)📝
serve/web/app.css(+11 -2)📝
serve/web/app.js(+42 -3)📄 Description
Problem and result
An MCP image result reaches the Python web chat as text describing an unseen picture. This opt-in change caches raster results, forwards them through existing vision preparation when configured, and displays previews with authenticated downloads. Missing cache files become omission notes so later turns continue.
Related discussion
Related: #2130 and #2343. This PR was closed by the 0.2.0-beta tracker reset, not rejected. Updated against main
011c9e600a(0.2.2). #2343 is an overlapping alternative transport and needs reconciliation before merge. No separate maintainer scope approval is recorded for this cache-based alternative.Approach
Enable with JSON "mcp": {"image_results": true} in the run configuration; disabled by default. PNG/JPEG/WebP are cached by SHA-256 beside the config. Four pictures per result, each capped at 24 million base64 characters. The authenticated same-origin route validates basenames and sends raster MIME, nosniff and same-origin resource-policy headers. Browser previews/downloads use Blob URLs; history stores small references rather than base64. New chat/pagehide reclaim URLs; BFCache restoration rehydrates them.
Merged current main without rewriting history. The sole conflict was an equivalent min-width CSS declaration; kept upstream's form. Narrow layout changes retain tool cards and composer controls.
Setup tutorial: web search, generated images, preview and download
Validation
Revision:
645099fdbe, merged with 0.2.2. Windows, Python 3.14, Node 22.20.0.Passed:
Failed / corrected during validation:
Not run:
Limits
Applies to serve/server.py and serve/web, not the separate apps/host or apps/desktop UI. No bundled search provider, ComfyUI, vision/generation model or GPU lifecycle controller. Cache retention is manual. No performance/quality claim. The local Python web service has been cut over; this is not a desktop-app integration.
0.2.2 overlap: upstream
f2709679already fixes part of the mobile tool-card overflow. The remaining reason for this PR is opt-in cached image transport, vision delivery, previews and downloads. MCP provider configuration and the standalone image-generation API already exist upstream; this PR does not introduce those capabilities.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.