Repository navigation
feat(mcp): MCP Apps item card for pad_item on remote MCP (TASK-4465) - #2519
Merged
Merged
Conversation
…(TASK-4465) Only the required peers stay pinned: @modelcontextprotocol/client, @modelcontextprotocol/core and zod. The view never imports React or the server SDK. Claude-Session: https://claude.ai/code/session_01Pa22hGNokx3Pi1fqL3EfXE
…K-4465) The SDK and its MCP dependencies import zod as a namespace, which keeps every error-message translation in the bundle (about 260 kB). With them the item card cannot fit the 512 KiB cap; without them it is 484898 bytes. Claude-Session: https://claude.ai/code/session_01Pa22hGNokx3Pi1fqL3EfXE
The card shows ref, title, collection, select fields, assignee, updated time and a plain-text content preview. The title and non-computed select fields are editable through pad_item update with expected_seq; a conflict reloads the item. The bridge applies the host theme, style variables and fonts. scripts/preview-mcp-app.mjs is a host stand-in for looking at the built card and is not part of the build. Claude-Session: https://claude.ai/code/session_01Pa22hGNokx3Pi1fqL3EfXE
…K-4465) false, 0, no and off (any case, surrounding space ignored) all turn MCP Apps off, matching PAD_MCP_ENABLED, so an operator copying that style does not leave the item card on by accident. Claude-Session: https://claude.ai/code/session_01Pa22hGNokx3Pi1fqL3EfXE
…y (TASK-4465) The server refuses a repeated field key only on schema writes, so an older or imported schema can still carry one, and a keyed each would throw and blank the card. The select list now goes through uniqueBy. Also: the content preview counts code points so a cut never splits a surrogate pair, and the bundle build refuses a bundle containing '<script', which could stop the inline script tag from closing. Claude-Session: https://claude.ai/code/session_01Pa22hGNokx3Pi1fqL3EfXE
…(TASK-4465) jose comes in through @modelcontextprotocol/client (^6.1.3); 6.2.17 is younger than the floor the dependency age check enforces. Claude-Session: https://claude.ai/code/session_01Pa22hGNokx3Pi1fqL3EfXE
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.
Remote MCP (
/mcp) now ships an MCP Apps item card. Hosts that support MCP Apps renderpad_itemresults as a small editable card; other hosts see one extra_metakey onpad_itemand nothing else.What changes
pad_itemcarries_meta.ui.resourceUri = ui://pad/item-card(plus the legacy flatui/resourceUri) on the remote server only. Stdio (pad mcp serve) is unchanged.ui://pad/item-card(text/html;profile=mcp-app,_meta.ui.prefersBorder), served from a single self-contained HTML file embedded in the binary. Nocspordomain, so the view has no network access; every call goes through the host as an MCP tool call on the connection's own token.get,create,update,move,restore,claimandreleaseresults that are items; anything else renders nothing (zero height).pad_item updatewithexpected_seqand never content.update_conflictreloads the item and says so.pad_itemget/update,pad_collectionlist and the reservedpad_boardshow/changes. That allowlist lives in the view; the server cannot tell a card write from any other write on the same token.PAD_MCP_APPS=offremoves the metadata and the resource.web/scripts/build-mcp-app.mjs(part ofnpm run build) writesweb/build-mcp-app/item-card.html, refusing anything over 512 KiB or with an externalsrc/href. CI, Docker, nix and the Makefile placeholder build or stub it next to the materializer.@modelcontextprotocol/ext-apps2.0.4 and its required peers@modelcontextprotocol/client2.4.0,@modelcontextprotocol/core2.4.0,zod4.6.7.Compatibility
tools/listgolden moves only bypad_item._meta; stdio goldens are byte-identical. No tool, action, parameter or result shape changes, soToolSurfaceVersionis unchanged.Tests
TestMCPApps_ItemToolCarriesUIMeta,TestMCPApps_ResourceRead,TestMCPApps_KillSwitch,TestMCPApps_EmbeddedBundleSelfContained, wire goldens.src/mcp-appmodel, bridge (allowlist and a source scan for{@html, network APIs and model-messaging calls) and the card component (escaping, empty render, edit, conflict, error, title edit).https://claude.ai/code/session_01Pa22hGNokx3Pi1fqL3EfXE