This is a demonstration on how to run Playwright-MCP in a container environment like Docker and Podman.
- Spin up the containers.
podman compose up -d
- Open browser: http://localhost:6274
- Configure the inspector:
- Transport Type: Streamable HTTP
- URL: http://playwright:8931/mcp
- Click on "Connect"
- Now you should be connected an click "List Tools".
Claude Code supports streamable HTTP MCP as well. See anthropics/claude-code#1387
claude mcp add --transport http playwright http://playwright:8931/mcp
Add the network option as a runArgs, so the DevContainer can also make use of Playwright MCP.
{
"runArgs": ["--network=playwright-mcp-container-demo_network"]
}
- Playwright's default user agent will be blocked by many sites.
- User
podman compose logs -f
to check if everything is okay. - See demo.rest for a REST client friendly way to interact with the MCP server.