This MCP server allows you to capture web page screenshots programmatically, providing AI agents with visual verification of web applications and their progress. It uses Puppeteer to take screenshots of entire pages or specific elements, with support for authentication and session persistence.
Drag and drop the generated screenshot-webpage-mcp.dxt
file into Claude Desktop for automatic installation.
To install and build the MCP from source:
# Clone the repository
git clone https://github.com/ananddtyagi/webpage-screenshot-mcp.git
cd webpage-screenshot-mcp
# Install dependencies
npm install
# Build the project
npm run build
Claude Desktop:
"webpage-screenshot": {
"command": "node",
"args": [
"~/path/to/webpage-screenshot-mcp/dist/index.js"
]
}
Cursor:
"webpage-screenshot": {
"command": "node",
"args": ["~/path/to/webpage-screenshot-mcp/dist/index.js"]
}
Opens a webpage for manual login and saves cookies.
{
"name": "login-and-wait",
"parameters": {
"url": "https://example.com/login",
"waitMinutes": 5,
"successIndicator": ".dashboard-welcome",
"useDefaultBrowser": true
}
}
Parameters:
url
(required): Login page URLwaitMinutes
(optional): Maximum wait time in minutes (default: 5)successIndicator
(optional): CSS selector or URL pattern indicating successful loginuseDefaultBrowser
(optional): Use system's default browser (default: true)Captures a full page screenshot.
{
"name": "screenshot-page",
"parameters": {
"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
}
}
Parameters:
url
(required): Web page URLfullPage
(optional): Capture entire page or just viewport (default: true)width
(optional): Viewport width in pixels (default: 1920)height
(optional): Viewport height in pixels (default: 1080)format
(optional): Image format - "png", "jpeg", or "webp" (default: "png")quality
(optional): Image quality for jpeg/webp (0-100)waitFor
(optional): Page load condition (default: "networkidle2")delay
(optional): Additional delay after page load in millisecondsuseSavedAuth
(optional): Use saved cookies (default: true)reuseAuthPage
(optional): Use existing authenticated page (default: false)useDefaultBrowser
(optional): Use system's default browser (default: false)visibleBrowser
(optional): Show browser window (default: false)Captures a specific element on a webpage.
{
"name": "screenshot-element",
"parameters": {
"url": "https://example.com/dashboard",
"selector": ".user-profile",
"waitForSelector": true,
"format": "png",
"quality": 80,
"padding": 10,
"useSavedAuth": true,
"useDefaultBrowser": true,
"visibleBrowser": true
}
}
Parameters:
url
(required): Web page URLselector
(required): CSS selector for the target elementwaitForSelector
(optional): Wait for selector to appear (default: true)format
(optional): Image format (default: "png")quality
(optional): Image quality for jpeg/webp (0-100)padding
(optional): Padding around element in pixels (default: 0)useSavedAuth
(optional): Use saved cookies (default: true)useDefaultBrowser
(optional): Use system's default browser (default: false)visibleBrowser
(optional): Show browser window (default: false)Clears saved authentication cookies.
{
"name": "clear-auth-cookies",
"parameters": {
"url": "https://example.com"
}
}
Parameters:
url
(optional): Domain to clear cookies for (omit to clear all){
"name": "login-and-wait",
"parameters": {
"url": "https://example.com/login",
"waitMinutes": 3,
"successIndicator": ".dashboard-welcome",
"useDefaultBrowser": true
}
}
{
"name": "screenshot-page",
"parameters": {
"url": "https://example.com/account",
"fullPage": true,
"useSavedAuth": true,
"reuseAuthPage": true,
"useDefaultBrowser": true,
"visibleBrowser": true
}
}
{
"name": "screenshot-element",
"parameters": {
"url": "https://example.com/dashboard",
"selector": ".user-profile-section",
"useSavedAuth": true,
"useDefaultBrowser": true,
"visibleBrowser": true
}
}
{
"name": "clear-auth-cookies",
"parameters": {
"url": "https://example.com"
}
}
Enables using your system's regular browser instead of Puppeteer's bundled Chromium, providing access to:
Enable with useDefaultBrowser: true
and visibleBrowser: true
.
The server can maintain a persistent browser session across multiple tool calls:
login-and-wait
reuseAuthPage: true
in subsequent calls to use the same pageCookies are automatically managed:
.mcp-screenshot-cookies
directory in your home folderuseSavedAuth: true
clear-auth-cookies
toolclear-auth-cookies
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "webpage-screenshot" '{"command":"node","args":["~/path/to/webpage-screenshot-mcp/dist/index.js"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"webpage-screenshot": {
"command": "node",
"args": [
"~/path/to/webpage-screenshot-mcp/dist/index.js"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"webpage-screenshot": {
"command": "node",
"args": [
"~/path/to/webpage-screenshot-mcp/dist/index.js"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect