Skip to content

Move the MCP App resource out of the vendored browser layer - #308

Merged
max-sixty merged 2 commits into
mainfrom
mcp-app-out-of-page-vendor
Sep 5, 2026
Merged

max-sixty merged 2 commits into
mainfrom
mcp-app-out-of-page-vendor

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

compose_layer copies every file under a layer root's runtime, widgets and vendor into the page directory, and mcp-page-app.html sat in assets/vendor/. Every page therefore carried 396KB it never fetched — about 38% of its vendored bytes — because the MCP App resource is not page payload at all. An MCP host reads it from the install over the tool transport; no browser ever asks for it.

It moves to skills/leaf/mcp-app/page-app.html, outside the layer roots, so nothing can vendor it. scripts/vendor.py mcp-app writes it there and reproduces the tracked bytes exactly. mcp_page.py reads it from a new MCP_APP constant, which sits beside KERNEL and BUNDLED_PACKAGES saying why it is not one of them.

BROWSER_DIRS needs no split. It described assets/vendor/ and a package's vendor/ as one kind and was wrong only about the one file that was not browser payload; with that gone the tuple is accurate again, and the page-shape check in packages.py is unaffected.

test_init_does_not_vendor_the_mcp_app_resource compares bytes rather than names, so putting the file back under any layer root under any name fails it. Verified by planting the copy back in assets/vendor/ and watching it fail.

A page initialized before this still holds the stale copy until its next page init, which retires it along with anything else the layer dropped.

This was written by Claude Code on behalf of max-sixty

🤖 Generated with Claude Code

max-sixty and others added 2 commits September 5, 2026 13:31
`compose_layer` copies every file under a layer root's `runtime`, `widgets`
and `vendor` into the page directory, and `mcp-page-app.html` sat in
`assets/vendor/`. Every page therefore carried 396KB it never fetched — about
38% of its vendored bytes — because the MCP App resource is not page payload
at all. An MCP host reads it from the install over the tool transport; no
browser ever asks for it.

It moves to `skills/leaf/mcp-app/page-app.html`, outside the layer roots, so
nothing can vendor it. `scripts/vendor.py mcp-app` writes it there and
reproduces the tracked bytes exactly; `mcp_page.py` reads it from the new
`MCP_APP` constant, which sits beside `KERNEL` and `BUNDLED_PACKAGES` saying
why it is not one of them.

`BROWSER_DIRS` needs no split. It described `assets/vendor/` and a package's
`vendor/` as one kind and was wrong only about the one file that was not
browser payload; with that gone the tuple is accurate again.

A page initialized before this still holds the stale copy until its next
`page init`, which retires it along with anything else the layer dropped.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WiC25MCLJYBnRypf3ZXkku
@max-sixty
max-sixty merged commit bbea616 into main Sep 5, 2026
6 checks passed
@max-sixty
max-sixty deleted the mcp-app-out-of-page-vendor branch September 5, 2026 20:51
max-sixty added a commit that referenced this pull request Sep 5, 2026
`compose_layer` copies every file under a layer root's `runtime`,
`widgets` and `vendor` into the page directory, and `mcp-page-app.html`
sat in `assets/vendor/`. Every page therefore carried 396KB it never
fetched — about 38% of its vendored bytes — because the MCP App resource
is not page payload at all. An MCP host reads it from the install over
the tool transport; no browser ever asks for it.

It moves to `skills/leaf/mcp-app/page-app.html`, outside the layer
roots, so nothing can vendor it. `scripts/vendor.py mcp-app` writes it
there and reproduces the tracked bytes exactly. `mcp_page.py` reads it
from a new `MCP_APP` constant, which sits beside `KERNEL` and
`BUNDLED_PACKAGES` saying why it is not one of them.

`BROWSER_DIRS` needs no split. It described `assets/vendor/` and a
package's `vendor/` as one kind and was wrong only about the one file
that was not browser payload; with that gone the tuple is accurate
again, and the page-shape check in `packages.py` is unaffected.

`test_init_does_not_vendor_the_mcp_app_resource` compares bytes rather
than names, so putting the file back under any layer root under any name
fails it. Verified by planting the copy back in `assets/vendor/` and
watching it fail.

A page initialized before this still holds the stale copy until its next
`page init`, which retires it along with anything else the layer
dropped.

> _This was written by Claude Code on behalf of max-sixty_

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants