mcp-web-snapshot is a Model Context Protocol (MCP) server that uses Playwright to implement website snapshot capabilities, enabling LLMs to capture and analyze webpages through structured data.
Purpose The project targets scenarios where AI tools need to read and understand webpage content, converting webpage state into structured output suitable for LLM consumption, along with monitoring information at the network and console levels.
Key capabilities
- Accessibility snapshot: captures the complete accessibility tree structure and outputs LLM-optimized structured data.
- Network monitoring: records all network requests and responses during page loading.
- Console messages: collects client-side console output, including logs, warnings, and errors.
- Element references: adds unique reference IDs to interactive elements for precise localization.
- Performance metrics: a summary of network activity.
- Production readiness: built-in error handling, resource limits, and timeout management.
- A pytest test suite is included, and the materials state that current test coverage is 92%.
Usage Runtime requirements are Python 3.11 or newer, and VS Code, Cursor, Windsurf, Claude Desktop, or another MCP client.
Installing in Cursor: go to Cursor Settings → MCP → Add new MCP server, select command as the type, set the command to uv, and set the arguments to ["--directory", "/path/to/mcp-web-snapshot", "run", "python", "src/server.py"].
Local development installation steps: clone the repository; install dependencies; run the server.
The tool is named website_snapshot, and its parameter target_url (a string, which must be a valid URL with a protocol) is the comprehensive snapshot capability.
Configuration Configuration is done through the CONFIG dictionary in src/tools/snapshot_url.py, including viewport size, User Agent, timeout, and content filtering options such as response body size limits and content type filtering.
Use cases The scenarios listed in the materials include: capturing complete page state for automatedtest generation; extracting structured data for content analysis and monitoring; using accessibility tree data for compliance checks; monitoring network activity to understand application behavior; and generating cross-browser tests based on captured interactions.
Limitations and error handling The server returns an error for invalid URLs, supports configurable timeout degradation, handles browser crashes and automatically cleans up resources, and intelligently filters large response bodies to avoid memory issues.
Other information The project uses the MIT license. The materials mention that it was inspired by the MCP Server Website Snapshot article, is based on Microsoft's Playwright, uses Playwright, and integrates LLMs through the Model Context Protocol.