Puppeteer Vision Web Scraper MCP server

Automates web scraping by intelligently handling cookie banners, CAPTCHAs, and paywalls to extract clean markdown content from websites
Back to servers
Setup instructions
Provider
Denis Jannot
Release date
May 15, 2025
Language
JavaScript
Stats
24 stars

This MCP server extracts content from web pages, converting them to markdown format with AI-powered capabilities to handle interactive elements like cookie banners, captchas, and paywalls. The tool uses Puppeteer for browser automation and AI vision models to intelligently interact with web pages when needed.

Installation

Prerequisites

Ensure you have Node.js and npm installed on your system before proceeding.

Setup with NPX

The recommended way to use this server is through npx, which runs the latest version without manual installation:

  1. Configure Environment Variables

    Create a .env file in your working directory with the following settings:

    # Required
    OPENAI_API_KEY=your_api_key_here
    
    # Optional settings (defaults shown)
    # VISION_MODEL=gpt-4.1
    # API_BASE_URL=https://api.openai.com/v1
    # TRANSPORT_TYPE=stdio
    # PORT=3001
    # DISABLE_HEADLESS=false
    

    Alternatively, you can export these variables in your terminal session.

  2. Run the Server

    Execute the following command in your terminal:

    npx -y puppeteer-vision-mcp-server
    

Configuration Options

Environment Variables

The server can be configured using these environment variables:

  • OPENAI_API_KEY (Required): Your API key for accessing the vision model
  • VISION_MODEL (Optional): The model for vision analysis (default: gpt-4.1)
  • API_BASE_URL (Optional): Custom API endpoint URL for alternative providers
  • TRANSPORT_TYPE (Optional): Communication protocol (options: stdio, sse, http, default: stdio)
  • PORT (Optional): HTTP server port for SSE or HTTP mode (default: 3001)
  • DISABLE_HEADLESS (Optional): Set to true to show the browser during operation (default: false)

Communication Modes

The server supports three modes of operation:

  1. stdio (Default): Communicates via standard input/output

    • Ideal for direct integration with LLM tools
    • No HTTP server required
  2. SSE mode: Communicates via Server-Sent Events

    • Enable with TRANSPORT_TYPE=sse
    • Starts an HTTP server on the specified port
    • Connect to: http://localhost:3001/sse
  3. HTTP mode: Streamable HTTP transport with session management

    • Enable with TRANSPORT_TYPE=http
    • Starts an HTTP server on the specified port
    • Connect to: http://localhost:3001/mcp

Integration as an MCP Tool

To integrate the server with an MCP-compatible LLM orchestrator, use a configuration like this:

{
  "mcpServers": {
    "web-scraper": {
      "command": "npx",
      "args": ["-y", "puppeteer-vision-mcp-server"],
      "env": {
        "OPENAI_API_KEY": "YOUR_OPENAI_API_KEY_HERE"
      }
    }
  }
}

Using the Tool

The server provides a scrape-webpage tool with the following parameters:

  • url (string, required): The webpage URL to scrape
  • autoInteract (boolean, optional, default: true): Enable automatic handling of interactive elements
  • maxInteractionAttempts (number, optional, default: 3): Maximum AI interaction attempts
  • waitForNetworkIdle (boolean, optional, default: true): Wait for network idle before processing

Response Format

The tool returns results in this structure:

{
  "content": [
    {
      "type": "text",
      "text": "# Page Title\n\nThis is the content..."
    }
  ],
  "metadata": {
    "message": "Scraping successful",
    "success": true,
    "contentSize": 8734
  }
}

On error:

{
  "content": [
    {
      "type": "text",
      "text": ""
    }
  ],
  "metadata": {
    "message": "Error scraping webpage: Failed to load the URL",
    "success": false
  }
}

How It Works

AI-Driven Interaction

The system uses vision-capable AI models to analyze webpage screenshots and determine appropriate actions (clicking, typing, scrolling) to bypass overlays and consent forms. This process repeats up to the configured maximum interaction attempts.

Content Extraction

After handling interactive elements, Mozilla's Readability extracts the main content, which is then sanitized and converted to markdown using Turndown with special handling for code blocks, tables, and other structured content.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "web-scraper" '{"command":"npx","args":["-y","puppeteer-vision-mcp-server"],"env":{"OPENAI_API_KEY":"YOUR_OPENAI_API_KEY_HERE"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

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.

Adding an MCP server to Cursor globally

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": {
        "web-scraper": {
            "command": "npx",
            "args": [
                "-y",
                "puppeteer-vision-mcp-server"
            ],
            "env": {
                "OPENAI_API_KEY": "YOUR_OPENAI_API_KEY_HERE"
            }
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "web-scraper": {
            "command": "npx",
            "args": [
                "-y",
                "puppeteer-vision-mcp-server"
            ],
            "env": {
                "OPENAI_API_KEY": "YOUR_OPENAI_API_KEY_HERE"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later