Read MCP Apps tool results from notification params

Merged
KL
2d ago
+142-42

Summary

Read MCP Apps tool-result notifications from params in the clock tutorial and story server. Initialize the UI bridge before consuming notifications, and accept tool results only from the parent window.

Exercise both embedded scripts with self-contained Node tests. Update the documentation line highlights and translations to match the expanded examples.

Fixes #3662

Checks

  • node --test tests/docs_src/test_apps.test.js - 2 passed
  • uv run --frozen pytest tests/docs_src/test_apps.py -q - 7 passed
  • uv run --frozen ruff check docs_src/apps/tutorial001.py examples/stories/apps/server.py tests/docs_src/test_apps.py
  • uv run --frozen pyright - no errors

AI Disclaimer

This PR was developed with the assistance of either Claude or Codex. I've reviewed and verified the changes.