Webshot MCP
Enables taking screenshots of web pages with support for multiple devices (desktop, mobile, tablet), custom dimensions, full-page capture, and various image formats. Built with Playwright for reliable web page rendering and screenshot generation.
README
webshot-mcp
中文文档 | English
A MCP (Model Context Protocol) server for generating web page screenshots, implemented with Playwright.
Features
- 🌐 Support for any web page screenshots
- 📱 Support for multiple device types (desktop, mobile, tablet)
- 🎨 Support for multiple image formats (PNG, JPEG, WebP)
- 📏 Support for custom dimensions and DPI scaling
- 🖼️ Support for full-page screenshots
- 🗜️ Support for image quality compression
- ⚡ Asynchronous processing for excellent performance
Usage
As MCP Server
Method 1: Run directly with uvx (Recommended)
{
"mcpServers": {
"webshot": {
"command": "uvx",
"args": ["webshot-mcp"]
}
}
}
Method 2: Use with Claude Code
Claude Code can be configured to use this MCP server in two ways:
Option A: Using the CLI wizard
claude mcp add
Then follow the prompts to add webshot-mcp.
Option B: Direct config file editing (Recommended)
Edit your Claude Code configuration file (~/.claude.json) and add:
{
"mcpServers": {
"webshot": {
"type": "stdio",
"command": "uvx",
"args": ["webshot-mcp"]
}
}
}
After editing the config file, restart Claude Code to apply the changes.
Method 3: Install with pip and run
# Install webshot-mcp
pip install webshot-mcp
# Install chromium browser
playwright install chromium
Then add to your MCP client configuration:
For Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"webshot": {
"command": "webshot-mcp"
}
}
}
For Claude Code (~/.claude.json):
{
"mcpServers": {
"webshot": {
"type": "stdio",
"command": "webshot-mcp"
}
}
}
Tool Parameters
The webshot tool supports the following parameters:
Required Parameters
url(string): URL of the web page to screenshotoutput(string): Path to save the screenshot file
Optional Parameters
width(integer): Browser window width, default 1280height(integer): Browser window height, default 768. Set to 0 for full-page screenshotdpi_scale(number): DPI scaling ratio, default 2device(string): Device type, options:desktop(default): Desktop devicemobile: Mobile device (iPhone 13)tablet: Tablet device (iPad Pro)
format(string): Image format, options:png(default): PNG formatjpeg: JPEG formatwebp: WebP format
quality(integer): Image quality (0-100), default 100. Only effective for JPEG and WebP formats
Usage Examples
Full-page Screenshot (Long Screenshot) Prompt Reference
Please generate a full-page screenshot of www.baidu.com, save it as WebP format to /Users/ben/Downloads/screenshot-baidu-1.webp
Custom Size Screenshot Prompt Reference
Please generate a screenshot of www.baidu.com with dimensions 1280x720, save it as WebP format to /Users/ben/Downloads/screenshot-baidu-2.webp
Mobile Device Screenshot Prompt Reference
Note: Mobile and tablet devices will use their actual device dimensions, ignoring custom size parameters
Please generate a mobile screenshot of www.baidu.com, save it as WebP format to /Users/ben/Downloads/screenshot-mobile.webp
Tablet Device Screenshot Prompt Reference
Please generate a tablet screenshot of www.baidu.com, save it as PNG format to /Users/ben/Downloads/screenshot-tablet.png
Custom Format and Quality Prompt Reference
Please generate a screenshot of www.baidu.com, save it as JPEG format with 80% quality to /Users/ben/Downloads/screenshot.jpg
High-resolution Desktop Screenshot Prompt Reference
Please generate a high-resolution screenshot of www.github.com with dimensions 1920x1080, save it as PNG format to /Users/ben/Downloads/github-hd.png
Batch Screenshots Prompt Reference
Please generate screenshots for the following websites and save them to /Users/ben/Downloads/:
1. www.google.com - full page, WebP format, filename: google-full.webp
2. www.github.com - 1280x720 size, JPEG format 90% quality, filename: github.jpg
3. www.stackoverflow.com - mobile view, PNG format, filename: stackoverflow-mobile.png
Development
Run Tests
uv run pytest
Code Structure
webshot-mcp/
├── src/webshot_mcp/
│ ├── __init__.py
│ ├── cli.py # CLI entry point
│ └── server.py # MCP server implementation
├── tests/
│ └── test_server.py # Test cases
├── pyproject.toml # Project configuration
└── README.md
Tech Stack
- MCP: Model Context Protocol framework
- Playwright: Browser automation and screenshots
- Pillow: Image processing and compression
- asyncio: Asynchronous programming support
Publishing
Build and Publish to PyPI
# Install build tools
uv add --dev build twine
# Build package
uv run python -m build
# Publish to PyPI
uv run twine upload dist/*
License
MIT License
Contributing
Issues and Pull Requests are welcome!
Changelog
v0.1.0
- Initial release
- Support for basic web page screenshot functionality
- Support for multiple device types and image formats
- Support for image quality compression and size adjustment
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。