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.
Ensure you have Node.js and npm installed on your system before proceeding.
The recommended way to use this server is through npx
, which runs the latest version without manual installation:
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.
Run the Server
Execute the following command in your terminal:
npx -y puppeteer-vision-mcp-server
The server can be configured using these environment variables:
OPENAI_API_KEY
(Required): Your API key for accessing the vision modelVISION_MODEL
(Optional): The model for vision analysis (default: gpt-4.1
)API_BASE_URL
(Optional): Custom API endpoint URL for alternative providersTRANSPORT_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
)The server supports three modes of operation:
stdio (Default): Communicates via standard input/output
SSE mode: Communicates via Server-Sent Events
TRANSPORT_TYPE=sse
http://localhost:3001/sse
HTTP mode: Streamable HTTP transport with session management
TRANSPORT_TYPE=http
http://localhost:3001/mcp
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"
}
}
}
}
The server provides a scrape-webpage
tool with the following parameters:
url
(string, required): The webpage URL to scrapeautoInteract
(boolean, optional, default: true): Enable automatic handling of interactive elementsmaxInteractionAttempts
(number, optional, default: 3): Maximum AI interaction attemptswaitForNetworkIdle
(boolean, optional, default: true): Wait for network idle before processingThe 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
}
}
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.
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.
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.
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": {
"web-scraper": {
"command": "npx",
"args": [
"-y",
"puppeteer-vision-mcp-server"
],
"env": {
"OPENAI_API_KEY": "YOUR_OPENAI_API_KEY_HERE"
}
}
}
}
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": {
"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