Skip to content

Remove the experimental MCP Apps transport - #1465

Merged
max-sixty merged 4 commits into
mainfrom
lf-chart-dependency
Sep 30, 2026
Merged

max-sixty merged 4 commits into
mainfrom
lf-chart-dependency

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Leaf's MCP Apps transport was an opt-in experiment. Codex's default handoff opens the page in its browser pane instead, and the experiment's own probe had stopped passing. It still had to follow every change to delivery, anchoring and the runtime. Every Codex install started leaf mcp and showed the model a leaf_present tool. Its comments-only snapshot was a second rendering of the page, which every thread and anchoring change also had to update. This removes the transport. A rebuild would start from the experiment's direct-resource design rather than from this code.

Removed

  • leaf mcp and the Codex plugin's mcpServers registration.
  • mcp_page.py, mcp_server.py, mcp_app.py and mcp-app.md.
  • The ui:// resource (skills/leaf/mcp-app/) and its build (build/mcp-app/, build_mcp_app).
  • The direct-resource probe and the experiment captures under notes/mcp-apps/.
  • The mcp Python dependency and the @modelcontextprotocol/ext-apps JS dependency, from both lockfiles and the browser build manifest.
  • The MCP tests, the page_server fixture and run_async.

Code that existed only for it

  • Event admission no longer re-captures a comment's anchor from the file (capture_anchors). No remaining writer asked for that, since leaf thread open captures before it writes. capture_anchor's prefix/suffix matching goes with it; its only caller was that re-capture.
  • Export drops embedding, inline_css_assets and _file_reader. It keeps its inliner, renamed AssetInliner because the delivery tests call it.
  • Delivery drops Delivery.body_end and SourceDocument.body_close. They existed only to inject the MCP page-ready script.
  • The page server no longer has an embeddable mode. frame_ancestors_policy is always sent, and a sample's frame-ancestors 'self' is now a class attribute on SampleEndpoint.

Docs

References, AGENTS.md, build/AGENTS.md, scripts/AGENTS.md, validation.md, events.md, TODO.md and the notes are updated to match. notes/mcp-apps/PROJECT.md now records:

  • what experiment 56 found;
  • why the probe broke;
  • how to restore the old code from a8ed55e68;
  • what to confirm before rebuilding.

TODO.md keeps one entry to rebuild it.

Tests

wt hook pre-merge passed locally before main was merged in. That covers 1418 tests plus the browser and worker gates. The merge conflicts with #1456, which touched the deleted MCP files and the frame-policy comment, are resolved by keeping the deletions and taking main's text.

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

🤖 Generated with Claude Code

max-sixty and others added 4 commits September 29, 2026 22:07
The inline MCP App was opt-in, Codex's default handoff opens the page in its
browser pane, and the experiment's own probe no longer passed. It still had to
follow every change to delivery, anchoring and the runtime, including a
comments-only snapshot that was a second rendering of the page.

Removed: `leaf mcp` and the Codex plugin's MCP server registration; the
`mcp_page`/`mcp_server`/`mcp_app` modules and their contract; the `ui://`
resource and its build; the probe and experiment captures; the `mcp` and
`@modelcontextprotocol/ext-apps` dependencies; their tests.

Code that existed only for it goes too: admission's `capture_anchors`
recapture, the export's `embedding`/`inline_css_assets` helpers (the export
keeps the inliner, now `AssetInliner`, which the delivery tests call), the
frameable-server branch of `frame_ancestors_policy`, and `run_async` in the
test support. `notes/mcp-apps/PROJECT.md` keeps what experiment 56 found and
how to rebuild on the direct-resource design, from `a8ed55e68`.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…_close

capture_anchor's prefix/suffix matching and Delivery.body_end had one producer
each, the removed recapture and the MCP page-ready script; the sample child's
frame policy moves onto SampleEndpoint. Prose that described the recapture,
and the MCP note's rebuild pointer, are corrected.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts:
#	skills/leaf/scripts/leaf/mcp-app.md
#	skills/leaf/scripts/leaf/mcp_server.py
#	skills/leaf/scripts/leaf/structure.py
#	tests/shift_watch.js
#	tests/test_mcp_app.py
#	tests/test_revision_delivery.py
@max-sixty
max-sixty merged commit 8dc7a18 into main Sep 30, 2026
5 checks passed
@max-sixty
max-sixty deleted the lf-chart-dependency branch September 30, 2026 08:21
leaf-agent pushed a commit that referenced this pull request Oct 12, 2026
Code-quality survey item F17. The event endpoint read a browser retry's
attempt in `_accepted_retry` before admission, merging the stored
comment anchor into the retry first, and `append_admitted` read it again
under the same lease, and the append a third time. The anchor merge
answered an enrichment only the MCP Apps transport made, removed in
#1465.

`append_admitted` now returns `(record, appended)`, so the endpoint
gates the nudge and the thread-title request on whether this request
appended, and answers `AttemptConflict` with the same 409. The endpoint
stamps the author once, before validation, and `browser_command_error`
no longer restates the rule. Attempt identity is derived from the append
envelope, `$events.ownership.derived`, author and publication; events.md
and the registry description stop saying `browser_discard` shapes it,
and both name `post_reply`'s looser CLI retry rule.

Also: the stale `append_admitted` docstring about `contract_writer`
exiting (gone since #2328), and presence reads the claim's id and turn
fields directly, since `readable_claim` always supplies them.

No user-visible behavior changes.

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

Co-authored-by: Claude Opus 5.5 (1M context) <[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