Webpage Screenshot MCP Server
网页截图 MCP 服务器
一个使用 Puppeteer 截取网页截图的 MCP(模型上下文协议)服务器。该服务器允许 AI 代理直观地验证 Web 应用程序,并在生成 Web 应用程序时查看其进度。
特征
全页面截图:捕获整个网页或仅捕获视口
元素截图:使用 CSS 选择器定位特定元素
多种格式:支持 PNG、JPEG 和 WebP 格式
可定制选项:设置视口大小、图像质量、等待条件和延迟
Base64 编码:将屏幕截图以 Base64 编码图像的形式返回,以便于集成
身份验证支持:手动登录和cookie持久化
默认浏览器集成:使用系统的默认浏览器获得更自然的体验
会话持久性:保持浏览器会话处于打开状态以进行多步骤工作流
Related MCP server: MCP Browser Screenshot Server
安装
# Install globally
npm install -g screenshot-webpage-mcp
# Or use locally in a project
npm install screenshot-webpage-mcp用法
工具
该 MCP 服务器提供了几种工具:
1. 登录并等待
在可见的浏览器窗口中打开网页进行手动登录,等待用户完成登录,然后保存 cookie。
{
"url": "https://example.com/login",
"waitMinutes": 5,
"successIndicator": ".dashboard-welcome",
"useDefaultBrowser": true
}url(必填):登录页面的 URLwaitMinutes(可选):等待登录的最大分钟数(默认值:5)successIndicator(可选):指示登录成功的 CSS 选择器或 URL 模式useDefaultBrowser(可选):是否使用系统默认浏览器(默认值:true)
2. 屏幕截图
捕获给定 URL 的屏幕截图并将其作为 base64 编码图像返回。
{
"url": "https://example.com/dashboard",
"fullPage": true,
"width": 1920,
"height": 1080,
"format": "png",
"quality": 80,
"waitFor": "networkidle2",
"delay": 500,
"useSavedAuth": true,
"reuseAuthPage": true,
"useDefaultBrowser": true,
"visibleBrowser": true
}url(必填):需要截图的网页地址fullPage(可选):是否捕获整个页面或仅捕获视口(默认值:true)width(可选):视口宽度(以像素为单位)(默认值:1920)height(可选):视口高度(以像素为单位)(默认值:1080)format(可选):图像格式 - “png”、“jpeg”或“webp”(默认:“png”)quality(可选):图像质量(0-100),仅适用于 jpeg 和 webpwaitFor(可选):何时考虑页面加载 - “load”、“domcontentloaded”、“networkidle0”或“networkidle2”(默认值:“networkidle2”)delay(可选):页面加载后的额外延迟(以毫秒为单位)(默认值:0)useSavedAuth(可选):是否使用上次登录时保存的 cookie(默认值:true)reuseAuthPage(可选):是否使用现有的认证页面(默认值:false)useDefaultBrowser(可选):是否使用系统默认浏览器(默认值:false)visibleBrowser(可选):是否显示浏览器窗口(默认值:false)
3. 屏幕截图元素
使用 CSS 选择器捕获网页上特定元素的屏幕截图。
{
"url": "https://example.com/dashboard",
"selector": ".user-profile",
"waitForSelector": true,
"format": "png",
"quality": 80,
"padding": 10,
"useSavedAuth": true,
"useDefaultBrowser": true,
"visibleBrowser": true
}url(必填):网页的 URLselector(必需):要截图的元素的 CSS 选择器waitForSelector(可选):是否等待选择器出现(默认值:true)format(可选):图像格式 - “png”、“jpeg”或“webp”(默认:“png”)quality(可选):图像质量(0-100),仅适用于 jpeg 和 webppadding(可选):元素周围的填充(以像素为单位)(默认值:0)useSavedAuth(可选):是否使用上次登录时保存的 cookie(默认值:true)useDefaultBrowser(可选):是否使用系统默认浏览器(默认值:false)visibleBrowser(可选):是否显示浏览器窗口(默认值:false)
4. 清除身份验证 cookie
清除特定域或所有域的已保存身份验证 cookie。
{
"url": "https://example.com"
}url(可选):需要清除 Cookie 的域名 URL。若未提供,则清除所有 Cookie。
默认浏览器模式
默认浏览器模式允许您使用系统自带的浏览器(Chrome、Edge 等),而不是 Puppeteer 自带的 Chromium 浏览器。此功能适用于:
使用现有的浏览器会话和扩展程序
使用已保存的凭据手动登录网站
为多步骤工作流程提供更自然的浏览体验
使用与用户相同的浏览器环境进行测试
要启用默认浏览器模式,请在工具参数中设置useDefaultBrowser: true和visibleBrowser: true 。
默认浏览器模式的工作原理
启用默认浏览器模式时:
该工具将尝试找到系统的默认浏览器(Chrome、Edge 等)
它会启动你的浏览器,并在随机端口上启用远程调试
Puppeteer 连接到此浏览器实例,而不是启动自己的
您现有的配置文件、扩展程序和 Cookie 在会话期间可用
浏览器窗口仍然可见,因此您可以手动与其交互
此模式对于需要身份验证或复杂用户交互的工作流特别有用。
浏览器持久性
MCP 服务器可以在多个工具调用之间维持持久的浏览器会话:
当您使用
login-and-wait时,浏览器会话保持打开状态后续使用
reuseAuthPage: true调用screenshot-page或screenshot-element将使用同一页面这允许多步骤工作流程,而无需重新进行身份验证
Cookie 管理
您访问的每个域名都会自动保存 Cookie:
使用
login-and-wait后,cookie 将保存到主文件夹中的.mcp-screenshot-cookies目录中当使用
useSavedAuth: true再次访问同一域时,会自动加载这些 cookie您可以使用
clear-auth-cookies工具清除 cookies
示例工作流程:受保护的页面截图
以下是对需要身份验证的页面进行截图的示例工作流程:
手动登录阶段
{
"name": "login-and-wait",
"parameters": {
"url": "https://example.com/login",
"waitMinutes": 3,
"successIndicator": ".dashboard-welcome",
"useDefaultBrowser": true
}
}这将打开您的默认浏览器并显示登录页面。您可以手动登录。登录完成后(无论是检测到登录成功指示,还是离开登录页面),会话 Cookie 都会被保存。
使用已保存的会话截取屏幕截图
{
"name": "screenshot-page",
"parameters": {
"url": "https://example.com/account",
"fullPage": true,
"useSavedAuth": true,
"reuseAuthPage": true,
"useDefaultBrowser": true,
"visibleBrowser": true
}
}这将在同一浏览器窗口中使用您保存的身份验证 cookie 截取帐户页面的屏幕截图。
截取特定元素的屏幕截图
{
"name": "screenshot-element",
"parameters": {
"url": "https://example.com/dashboard",
"selector": ".user-profile-section",
"useSavedAuth": true,
"useDefaultBrowser": true,
"visibleBrowser": true
}
}完成后清除 Cookies
{
"name": "clear-auth-cookies",
"parameters": {
"url": "https://example.com"
}
}此工作流程允许您像普通用户一样与受保护的页面进行交互,并在默认浏览器中完成完整的身份验证流程。
无头模式与可见模式
无头模式(
visibleBrowser: false):更快,更适合不需要用户交互的自动化工作流程。可见模式(
visibleBrowser: true):显示浏览器窗口,允许用户交互和手动验证。useDefaultBrowser: true时必需。
平台支持
默认浏览器检测适用于:
macOS :检测 Chrome、Edge 和 Safari
Windows :通过注册表或常见安装路径检测 Chrome 和 Edge
Linux :通过系统命令检测 Chrome 和 Chromium
故障排除
常见问题
未找到默认浏览器:如果系统找不到您的默认浏览器,它将恢复使用 Puppeteer 捆绑的 Chromium。
连接问题:如果连接到浏览器的调试端口时出现问题,请检查是否有另一个实例正在使用该端口。
Cookie 问题:如果身份验证不起作用,请尝试使用
clear-auth-cookies工具清除 cookie。
调试
出现问题时,MCP 服务器会将有用的错误消息记录到控制台。查看这些消息以获取故障排除信息。
Available Tools
5 toolsclear-auth-cookiesA
Clears saved authentication cookies for a specific domain or all domains
Inputs: url.
login-and-waitA
Opens a webpage in a visible browser window for manual login, waits for user to complete login, then saves cookies
Inputs: url (required), successIndicator, useDefaultBrowser, waitMinutes.
screenshot-elementB
Captures a screenshot of a specific element on a webpage using a CSS selector
Inputs: selector (required), url (required), format, padding, +5 more.
screenshot-pageA
Captures a screenshot of a given URL and returns it as base64 encoded image. Can use saved cookies from login-and-wait.
Inputs: url (required), delay, format, fullPage, +8 more.
signal-login-completeA
Signals that manual login is complete and the login-and-wait tool should continue
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Most tools have distinct purposes: screenshot-element and screenshot-page target different screenshot scopes, while login-and-wait and clear-auth-cookies handle authentication. However, signal-login-complete is tightly coupled with login-and-wait, which could cause confusion about whether to use it separately or as part of the login flow.
The naming is mixed: screenshot-element and screenshot-page follow a verb-noun pattern, but clear-auth-cookies and login-and-wait use hyphens and compound phrases, while signal-login-complete is a full sentence. This inconsistency makes the set less predictable, though the names remain readable.
With 5 tools, the count is well-scoped for a webpage screenshot server. Each tool serves a clear role in the workflow (authentication, screenshot capture, and cleanup), and there are no extraneous tools, making it efficient for agents to navigate.
The toolset covers core screenshot and authentication workflows effectively, including login, cookie management, and element/page capture. A minor gap is the lack of tools for advanced screenshot options (e.g., full-page capture or viewport adjustments), but agents can still accomplish the main tasks without significant workarounds.
Maintenance
Related MCP Connectors
Let your AI agent see any public web page: one screenshot tool, returns the page as an image.
Give your agent eyes: screenshots of any web page it can see, pages as markdown, and PDFs.
Screenshot any public web page from an AI agent. Free without signup, or with an API key.
Generate images, GIFs, videos, and PDFs from HTML, URLs, or templates — from your AI agent.
Related MCP Servers
- AlicenseCqualityDmaintenanceEnables LLMs to perform web browsing tasks, take screenshots, and execute JavaScript using Puppeteer for browser automation.41MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to capture screenshots of web pages using automated browser sessions. Supports full-page and element-specific screenshots, device simulation, and JavaScript execution for comprehensive web testing and monitoring.6MIT

site-shot-mcpofficial
AlicenseBqualityBmaintenanceEnables AI agents to capture full-page or viewport screenshots of any web page with options for ad removal, cookie banner blocking, and proxy country selection.2512 npm3MIT- AlicenseAqualityBmaintenanceEnables AI agents to capture screenshots, scrape structured page content, and run automated visual checks on live websites via a headless Chromium browser.3MIT