Puppeteer MCP evaluate needs async IIFE and survives navigation poorly
puppeteer_evaluate rejects top-level await with 'await is only valid in async functions and the top level bodies of modules', so wrap scripts in (async () => { ... })(). A click or hover that triggers navigation destroys the execution context and throws 'Execution context was destroyed'; re-run the evaluate after the page settles. Viewport screenshots only give the state you set up, so pair them with DOM measurements such as getBoundingClientRect for overlap checks.
If every puppeteer_navigate/evaluate then fails with "Attempted to use detached Frame '<id>'", a plain navigate won't recover. Call puppeteer_navigate with launchOptions (e.g. {headless:true, defaultViewport:{width:1280,height:800}}) to force a browser relaunch; it works again after that.