Webpage Screenshot MCP Server

Webpage Screenshot MCP Server

Capture web page screenshots programmatically for AI agent workflows.

44
Stars
4
Forks
44
Watchers
4
Issues
Webpage Screenshot MCP Server enables the capture of webpage and element screenshots using Puppeteer, providing a Model Context Protocol-compliant interface for AI agents. It supports various image formats, flexible authentication, and session persistence to facilitate integration with tools like Claude and Cursor. The server simplifies visual verification and monitoring of web applications by returning base64-encoded screenshots through customizable options. It also allows manual login workflows and multi-step web interactions with session continuity.

Key Features

Full page and element-specific screenshot capture
Supports PNG, JPEG, and WebP formats
Customizable viewport size and image quality
Base64-encoded image output for easy integration
Manual login and persistent cookie storage
Integration with system default browser
Session persistence across workflows
Flexible wait conditions and delays
Visible browser mode for manual tasks
Standardized protocol for AI agent communication

Use Cases

Visual verification of web application state
Automated UI testing and regression checks
Monitoring progress of AI-generated web apps
Capturing screenshots of authenticated pages
Multi-step browser workflows requiring login
Context sharing with AI agents for web tasks
Integrating visual feedback into developer tooling
Testing and debugging web workflows in real time
Gathering training data for computer vision models
Facilitating human-in-the-loop authentication processes

README

Webpage Screenshot MCP Server

An MCP (Model Context Protocol) server that captures screenshots of web pages using Puppeteer. This server allows AI agents to visually verify web applications and see their progress when generating web apps.

Screen Recording May 27 2025 (2)

Features

  • Full page screenshots: Capture entire web pages or just the viewport
  • Element screenshots: Target specific elements using CSS selectors
  • Multiple formats: Support for PNG, JPEG, and WebP formats
  • Customizable options: Set viewport size, image quality, wait conditions, and delays
  • Base64 encoding: Returns screenshots as base64 encoded images for easy integration
  • Authentication support: Manual login and cookie persistence
  • Default browser integration: Use your system's default browser for a more natural experience
  • Session persistence: Keep browser sessions open for multi-step workflows

Installation

Quick Start (Claude Desktop Extension)

Drag and drop the generated screenshot-webpage-mcp.dxt file into Claude Desktop for automatic installation!

Manual Installation

To install and build the MCP from source:

bash
# Clone the repository (if you haven't already)
git clone https://github.com/ananddtyagi/webpage-screenshot-mcp.git
cd webpage-screenshot-mcp

# Install dependencies
npm install

# Build the project
npm run build

The MCP server is built using TypeScript and compiled to JavaScript. The dist folder contains the compiled JavaScript files.

Adding to Claude or Cursor

To add this MCP to Claude Desktop or Cursor:

  1. Claude Desktop:

    • Go to Settings > Developer
    • Click "Edit Config"
    • Add the following:
    json
     "webpage-screenshot": {
       "command": "node",
       "args": [
         "~/path/to/webpage-screenshot-mcp/dist/index.js"
       ]
     }
    
    • Save and reload Claude
  2. Cursor:

    • Open Cursor and go to Cursor Settings > MCP
    • Click "Add new global MCP server"
    • Add the following:
json
  "webpage-screenshot": {
    "command": "node",
    "args": ["~/path/to/webpage-screenshot-mcp/dist/index.js"]
  }
  • Save and reload Cursor

Usage

Tools

This MCP server provides several tools:

1. login-and-wait

Opens a webpage in a visible browser window for manual login, waits for user to complete login, then saves cookies.

json
{
  "url": "https://example.com/login",
  "waitMinutes": 5,
  "successIndicator": ".dashboard-welcome",
  "useDefaultBrowser": true
}
  • url (required): The URL of the login page
  • waitMinutes (optional): Maximum minutes to wait for login (default: 5)
  • successIndicator (optional): CSS selector or URL pattern that indicates successful login
  • useDefaultBrowser (optional): Whether to use the system's default browser (default: true)

2. screenshot-page

Captures a screenshot of a given URL and returns it as base64 encoded image.

json
{
  "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 (required): The URL of the webpage to screenshot
  • fullPage (optional): Whether to capture the full page or just the 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): Quality of the image (0-100), only applicable for jpeg and webp
  • waitFor (optional): When to consider page loaded - "load", "domcontentloaded", "networkidle0", or "networkidle2" (default: "networkidle2")
  • delay (optional): Additional delay in milliseconds after page load (default: 0)
  • useSavedAuth (optional): Whether to use saved cookies from previous login (default: true)
  • reuseAuthPage (optional): Whether to use the existing authenticated page (default: false)
  • useDefaultBrowser (optional): Whether to use the system's default browser (default: false)
  • visibleBrowser (optional): Whether to show the browser window (default: false)

3. screenshot-element

Captures a screenshot of a specific element on a webpage using a CSS selector.

json
{
  "url": "https://example.com/dashboard",
  "selector": ".user-profile",
  "waitForSelector": true,
  "format": "png",
  "quality": 80,
  "padding": 10,
  "useSavedAuth": true,
  "useDefaultBrowser": true,
  "visibleBrowser": true
}
  • url (required): The URL of the webpage
  • selector (required): CSS selector for the element to screenshot
  • waitForSelector (optional): Whether to wait for the selector to appear (default: true)
  • format (optional): Image format - "png", "jpeg", or "webp" (default: "png")
  • quality (optional): Quality of the image (0-100), only applicable for jpeg and webp
  • padding (optional): Padding around the element in pixels (default: 0)
  • useSavedAuth (optional): Whether to use saved cookies from previous login (default: true)
  • useDefaultBrowser (optional): Whether to use the system's default browser (default: false)
  • visibleBrowser (optional): Whether to show the browser window (default: false)

4. clear-auth-cookies

Clears saved authentication cookies for a specific domain or all domains.

json
{
  "url": "https://example.com"
}
  • url (optional): URL of the domain to clear cookies for. If not provided, clears all cookies.

Default Browser Mode

The default browser mode allows you to use your system's regular browser (Chrome, Edge, etc.) instead of Puppeteer's bundled Chromium. This is useful for:

  1. Using your existing browser sessions and extensions
  2. Manually logging in to websites with your saved credentials
  3. Having a more natural browsing experience for multi-step workflows
  4. Testing with the same browser environment as your users

To enable default browser mode, set useDefaultBrowser: true and visibleBrowser: true in your tool parameters.

How Default Browser Mode Works

When you enable default browser mode:

  1. The tool will attempt to locate your system's default browser (Chrome, Edge, etc.)
  2. It launches your browser with remote debugging enabled on a random port
  3. Puppeteer connects to this browser instance instead of launching its own
  4. Your existing profiles, extensions, and cookies are available during the session
  5. The browser window remains visible so you can interact with it manually

This mode is particularly useful for workflows that require authentication or complex user interactions.

Browser Persistence

The MCP server can maintain a persistent browser session across multiple tool calls:

  1. When you use login-and-wait, the browser session is kept open
  2. Subsequent calls to screenshot-page or screenshot-element with reuseAuthPage: true will use the same page
  3. This allows for multi-step workflows without having to re-authenticate

Cookie Management

Cookies are automatically saved for each domain you visit:

  1. After using login-and-wait, cookies are saved to the .mcp-screenshot-cookies directory in your home folder
  2. These cookies are automatically loaded when visiting the same domain again with useSavedAuth: true
  3. You can clear cookies using the clear-auth-cookies tool

Example Workflow: Protected Page Screenshots

Here's an example workflow for taking screenshots of pages that require authentication:

  1. Manual Login Phase
json
{
  "name": "login-and-wait",
  "parameters": {
    "url": "https://example.com/login",
    "waitMinutes": 3,
    "successIndicator": ".dashboard-welcome",
    "useDefaultBrowser": true
  }
}

This will open your default browser with the login page. You can manually log in, and once complete (either by detecting the success indicator or after navigating away from the login page), the session cookies will be saved.

  1. Take Screenshots Using Saved Session
json
{
  "name": "screenshot-page",
  "parameters": {
    "url": "https://example.com/account",
    "fullPage": true,
    "useSavedAuth": true,
    "reuseAuthPage": true,
    "useDefaultBrowser": true,
    "visibleBrowser": true
  }
}

This will take a screenshot of the account page using your saved authentication cookies in the same browser window.

  1. Take Screenshots of Specific Elements
json
{
  "name": "screenshot-element",
  "parameters": {
    "url": "https://example.com/dashboard",
    "selector": ".user-profile-section",
    "useSavedAuth": true,
    "useDefaultBrowser": true,
    "visibleBrowser": true
  }
}
  1. Clear Cookies When Done
json
{
  "name": "clear-auth-cookies",
  "parameters": {
    "url": "https://example.com"
  }
}

This workflow allows you to interact with protected pages as if you were a regular user, completing the full authentication flow in your default browser.

Headless vs. Visible Mode

  • Headless mode (visibleBrowser: false): Faster and more suitable for automated workflows where no user interaction is needed.
  • Visible mode (visibleBrowser: true): Shows the browser window, allowing for user interaction and manual verification. Required for useDefaultBrowser: true.

Platform Support

The default browser detection works on:

  • macOS: Detects Chrome, Edge, and Safari
  • Windows: Detects Chrome and Edge via registry or common installation paths
  • Linux: Detects Chrome and Chromium via system commands

Troubleshooting

Common Issues

  1. Default browser not found: If the system can't find your default browser, it will fall back to Puppeteer's bundled Chromium.
  2. Connection issues: If there are problems connecting to the browser's debugging port, check if another instance is already using that port.
  3. Cookie issues: If authentication isn't working, try clearing cookies with the clear-auth-cookies tool.

Debugging

The MCP server logs helpful error messages to the console when issues occur. Check these messages for troubleshooting information.

Star History

Star History Chart

Repository Owner

Repository Details

Language JavaScript
Default Branch main
Size 18,918 KB
Contributors 1
License MIT License
MCP Verified Nov 12, 2025

Programming Languages

JavaScript
100%

Tags

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • @just-every/mcp-screenshot-website-fast

    @just-every/mcp-screenshot-website-fast

    Fast screenshot capture and tiling optimized for AI model workflows.

    Provides a fast and efficient command-line tool for capturing high-quality screenshots of webpages, specifically optimized for integration with AI vision workflows via the Model Context Protocol (MCP). Automates image tiling to 1072x1072 pixel chunks for optimal processing and compatibility with tools like Claude Vision API. Includes advanced features such as full-page capture, screencast recording, support for JavaScript injection, configurable viewports, and resource-efficient browser management.

    • 89
    • MCP
    • just-every/mcp-screenshot-website-fast
  • Urlbox MCP Server

    Urlbox MCP Server

    Screenshot, PDF, HTML, and markdown generation MCP for websites.

    Urlbox MCP Server enables AI clients to generate website screenshots, PDFs, and extract HTML or markdown from web pages via the Urlbox Screenshot API. It supports automated extraction of metadata, cookies, and allows local file downloads. The server is designed to be integrated with LLMs, which can use its tools to capture and process web content on demand via standardized MCP interfaces. Environment variable configuration secures API access, and multiple formats are supported for flexible output.

    • 1
    • MCP
    • urlbox/urlbox-mcp-server
  • Scrapeless MCP Server

    Scrapeless MCP Server

    A real-time web integration layer for LLMs and AI agents built on the open MCP standard.

    Scrapeless MCP Server is a powerful integration layer enabling large language models, AI agents, and applications to interact with the web in real time. Built on the open Model Context Protocol, it facilitates seamless connections between models like ChatGPT, Claude, and tools such as Cursor to external web capabilities, including Google services, browser automation, and advanced data extraction. The system supports multiple transport modes and is designed to provide dynamic, real-world context to AI workflows. Robust scraping, dynamic content handling, and flexible export formats are core parts of the feature set.

    • 57
    • MCP
    • scrapeless-ai/scrapeless-mcp-server
  • ScreenMonitorMCP v2

    ScreenMonitorMCP v2

    Real-time screen monitoring and visual analysis for AI assistants via MCP.

    ScreenMonitorMCP v2 is a Model Context Protocol (MCP) server enabling AI assistants to capture, analyze, and interact with screen content in real time. It supports instant screenshots, live streaming, advanced vision-based analysis, and provides performance monitoring across Windows, macOS, and Linux. Integration with clients like Claude Desktop is streamlined, offering easy configuration and broad compatibility. The tool leverages AI vision models to provide intelligent insights into screen content and system health.

    • 64
    • MCP
    • inkbytefo/ScreenMonitorMCP
  • WebScraping.AI MCP Server

    WebScraping.AI MCP Server

    MCP server for advanced web scraping and AI-driven data extraction

    WebScraping.AI MCP Server implements the Model Context Protocol to provide web data extraction and question answering functionalities. It integrates with WebScraping.AI to offer robust tools for retrieving, rendering, and parsing web content, including structured data and natural language answers from web pages. It supports JavaScript rendering, proxy management, device emulation, and custom extraction configurations, making it suitable for both individual and team deployments in AI-assisted workflows.

    • 33
    • MCP
    • webscraping-ai/webscraping-ai-mcp-server
  • ScreenPilot

    ScreenPilot

    Empower LLMs with full device control through screen automation.

    ScreenPilot provides an MCP server interface to enable large language models to interact with and control graphical user interfaces on a device. It offers a comprehensive toolkit for screen capture, mouse control, keyboard input, scrolling, element detection, and action sequencing. The toolkit is suitable for automation, education, and experimentation, allowing AI agents to perform complex operations on a user’s device.

    • 50
    • MCP
    • Mtehabsim/ScreenPilot
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results