mcp-screenshot-website-fast
CLAUDE.md110 starsChanged 17 months agoMITView on GitHub
Fast, efficient screenshot capture of web pages - optimized for CLI coding tools. Automatically tiles full pages into 1072x1072 chunks for optimal processing. A TypeScript-based screenshot tool optimized for AI vision models, particularly Claude Vision API. Captures high-quality screenshots with intelligent tiling for large pages. IMPORTANT: Always run these commands before committing: Only commit if all commands succeed without errors.
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
17 rules. About 0 are common, 14 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈14
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
No caching - always captures fresh content
- Distinctive: line 60
No caching for always-fresh content
- Distinctive: line 71
IMPORTANT: Always run these commands before committing:
- Distinctive: line 79
Only commit if all commands succeed without errors.
- Very specific: line 97
Run tests with npm test
- Distinctive: line 98
Test different viewport sizes
- Distinctive: line 99
Verify tiling algorithm correctness
- Distinctive: line 100
Test error scenarios (timeouts, invalid URLs)
- Distinctive: line 106
Update README for user-facing changes
- Very specific: line 115
Run npm run dev for development
- Distinctive: line 120
Keep Puppeteer version pinned for consistency
- Distinctive: line 122
Document any new dependencies
- Distinctive: line 127
Chrome Process: Ensure proper cleanup to avoid zombie processes
- Very specific: line 141
When running as MCP server (npm run serve):
- Distinctive: line 147
No caching - always fresh screenshots
- Distinctive: line 155
Puppeteer installation: Check firewall/proxy settings
- Distinctive: line 158
Chrome crashes: Check system resources
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
Fast, efficient screenshot capture of web pages - optimized for CLI coding tools. Automatically tiles full pages into 1072x1072 chunks for optimal processing.
Core Modules & Files
src/internal/screenshotCapture.ts: Core Puppeteer-based capture logicsrc/utils/: Logger and chunking utilitiessrc/index.ts: CLI interface using Commandersrc/serve.ts: MCP server using SDK- No caching - always captures fresh content
Commands
Development
npm run dev capture <URL> -o out.png # Capture screenshot (tiled by default)
npm run dev capture <URL> --no-full-page -o out.png # Viewport only
npm run serve:dev # Run MCP server in dev modeBuild & Production
npm run build # Compile TypeScript to JavaScript
npm run start # Run compiled CLI
npm run serve # Run compiled MCP serverCode Quality
npm run lint # Run ESLint
npm run typecheck # TypeScript type checking
npm test # Run tests with VitestArchitecture Overview
A TypeScript-based screenshot tool optimized for AI vision models, particularly Claude Vision API. Captures high-quality screenshots with intelligent tiling for large pages.
Core Components
- Screenshot Engine (
src/internal/screenshotCapture.ts)- Puppeteer-based headless Chrome automation
- Automatic viewport limiting (1072x1072 for Claude Vision)
- Smart page tiling for full-page captures
- Configurable wait strategies
- CLI Interface (
src/index.ts)- Commander-based command line tool
- Support for various output formats
- Flexible viewport and wait options
- MCP Server (
src/serve.ts)- SDK-based MCP implementation
- Real-time screenshot capture
- No caching for always-fresh content
Key Patterns
- Browser instance reuse for performance
- Automatic resolution optimization for AI models
- Graceful error handling and retries
- Memory-efficient tiling algorithm
Pre-Commit Requirements
IMPORTANT: Always run these commands before committing:
npm test # Ensure tests pass
npm run lint # Check linting
npm run build # Ensure TypeScript compilesOnly commit if all commands succeed without errors.
TypeScript Configuration
- ES Modules with Node.js >=20.0.0
- Strict mode enabled, targeting ES2022
- Source maps for debugging
- Declaration files for type safety
Code Style Guidelines
- Async/await for all asynchronous operations
- Proper error handling with detailed messages
- Resource cleanup (browser instances)
- Minimal dependencies for fast installs
Testing Instructions
- Run tests with
npm test - Test different viewport sizes
- Verify tiling algorithm correctness
- Test error scenarios (timeouts, invalid URLs)
Repository Etiquette
- Branch names:
feature/description,fix/issue-number - Conventional commits (
feat:,fix:,chore:) - Update README for user-facing changes
- Include screenshot examples for visual changes
Developer Environment Setup
- Clone repository
- Install Node.js 20.x or higher
- Run
npm install - Puppeteer will auto-download Chrome
- Run
npm run devfor development
Package Management
- Puppeteer is the main dependency
- Keep Puppeteer version pinned for consistency
- Monitor bundle size for MCP deployment
- Document any new dependencies
Project-Specific Warnings
- Memory Usage: Large pages can consume significant memory during tiling
- Chrome Process: Ensure proper cleanup to avoid zombie processes
- File Sizes: Tiled screenshots can create large output files
- Timeouts: Some sites may require longer wait times
- Headless Detection: Some sites block headless browsers
Key Utility Functions & APIs
captureScreenshot(): Main capture functiontilePage(): Splits large pages into tileswaitForPage(): Implements various wait strategiesoptimizeViewport(): Ensures Claude Vision compatibility
MCP Server Integration
When running as MCP server (npm run serve):
Tools:
screenshot_website_fast- Full page capture with automatic tiling
Features:
- No caching - always fresh screenshots
- Automatic resolution optimization
- Error handling with descriptive messages
Troubleshooting
Common Issues
- Puppeteer installation: Check firewall/proxy settings
- Memory errors: Reduce viewport size or disable full-page
- Timeout errors: Increase wait time or change wait strategy
- Chrome crashes: Check system resources
Debug Mode
Enable verbose logging:
DEBUG=screenshot:* npm run dev capture <URL>Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

