Repository navigation
Conversation
…esource on MCP Apps hosts specs/t27mcp/visual_output.t27 (gHashTag/t27, stacked on #10504) now says when the UI_RESOURCE channel is picked: client_host() reads the client's initialize capabilities (the io.modelcontextprotocol/ui extension with the text/html;profile=mcp-app mime), carries_ui_resource() says whether a t27f result adds the resource. The wasm and table are regenerated from it on the Railway lab. server.mjs: the client's host is taken at initialize; t27f_view and t27f_graph name ui://t27f/view and ui://t27f/graph in their tools/list _meta, keep their latest drawing as a page (UI_PAGE around the SVG, no script), add it as a resource content item when the spec says so, and serve it from resources/read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary by t27-beesThis PR adds MCP Apps UI resource support for Worth a look
Read: 5 files, +67 -20, the whole diff. Head |
…test one Review on #28: t27f_graph awaits before it draws, so a second call could replace the shared latest-drawing map between this call's handler and the tools/call reply. The handler now hands its page back through a per-call object (call(name, args, ui) -> ui.page); the map only serves resources/read. carries_ui_resource gets whether there is a drawing instead of a constant 1, and resources/list names ui://t27f/view and ui://t27f/graph only to an MCP Apps client. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Addressed in 683c34f:
🤖 Generated with Claude Code |
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.
Stacked on #27 (base
t27mcp/visual-output). The spec is gHashTag/t27#10563, which is stacked on gHashTag/t27#10504.What
On a host that renders MCP Apps,
t27f_viewandt27f_graphnow also return their drawing as aui://resource, so the host shows it inline instead of a file path.specs/t27mcp/visual_output.t27, regenerated intowasm/visual_output.wasmandwasm/visual_output_table.mjson the Railway lab):client_host(ui_extension, ui_mime): an MCP Apps host is a client whose initialize capabilities nameio.modelcontextprotocol/uiwithtext/html;profile=mcp-app.carries_ui_resource(host, svg): whether a t27f result adds the resource.UI_PAGE,UI_URI_VIEW,UI_URI_GRAPH,UI_EMPTY: the page and the addresses.visual.mjs:clientHost(caps),carriesUi(host)anduiPage(title, svg), each a thin call into the wasm or the table.server.mjs:initializerecords the client's host._meta.ui.resourceUriintools/list.tools/callappends{type:'resource', resource:{uri, mimeType, text}}after the text.resources/listandresources/readserveui://t27f/viewandui://t27f/graph. Before the first drawing they serveUI_EMPTY.Evidence (Railway lab, commit 8919c9f, wasm sha256
4976db83…25ce4)client_hostignores the mime: fails 2node smoke.mjs: rc 0, 33 ok, "all checks passed".{"extensions":{"io.modelcontextprotocol/ui":{"mimeTypes":["text/html;profile=mcp-app"]}}}:tools/call t27f_graph {fixture:1}returns content typestext resource,uri ui://t27f/graphandmimeType text/html;profile=mcp-app. The page title is "T27F graph view, fixture 1: 16 nodes, 17 edges, 1860x484."tools/call t27f_view {scene:3}returns a resource atui://t27f/view: a 9650-byte page containing the<svg>.resources/read ui://t27f/graphreturns the same page.resources/listreturnsui://t27/dashboard ui://t27f/view ui://t27f/graph.tools/listshowsresourceUriont27f_view,t27f_graphandt27_dashboard.t27f_graphreturnstextonly, andresources/read ui://t27f/viewreturns the "No drawing yet" page.text/html:textonly.inline:line from feat(t27f): visual-output rule -- initialize instructions and an inline verdict on every t27f SVG #27 is unchanged in all three runs.Known limit:
resources/readserves the latest drawing per URI, so after two concurrent calls of the same tool it shows the later one. Eachtools/callresult embeds its own call's page, handed back through a per-call object rather than read from that map (fixed after review: lab run at 683c34f, two back-to-backt27f_graphcalls embed fixture 1 and fixture 0 respectively whileresources/readreturns fixture 0).resources/listnames the t27f resources only to an MCP Apps client.🤖 Generated with Claude Code