Skip to main content
Scrape Hacker News headlines and top comments into a structured reader’s digest with the Stagehand MCP server.
This example’s source docstring names a removed cookbook path: cookbook/90_tools/mcp/stagehand.py. Follow the generated Run step below.
stagehand.py

Run the Example

1

Set up your virtual environment

2

Install dependencies

3

Export environment variables

4

Build the Stagehand MCP server

Install Node.js, then clone and build the server in the directory where you will save stagehand.py:
5

Run the example

Save the code above as stagehand.py, then run:
Full source: cookbook/91_tools/mcp/stagehand.py