Stagehand Python adds event hooks for WebMCP tool lifecycle
Stagehand Python 4.2.0a0.dev1524 introduces event hooks that fire when WebMCP tools are added or removed from a page.
Briefing
- Stagehand: Stagehand Python 4.2.0a0.dev1524 introduces event hooks that fire when WebMCP tools are added or removed from a page.
Why it matters
This feature gives developers fine-grained control over WebMCP tool state changes, enabling more responsive automation scripts that can react to dynamic tool additions and removals. The implementation is nontrivial because WebMCP.enable triggers toolsAdded events for pre-existing tools, so the hooks must handle deduplication and initial state correctly.
Sources
- Primary source · Stagehand · 2026-09-18 — browserbase/stagehand stagehand-python@4.2.0a0.dev1524: [feat]: add WebMCP tools added/removed event hooks (#2916)
Watch next
Will these hooks be backported to the JavaScript version of Stagehand?