WebScraping.AI MCP server

Provides web scraping capabilities with proxy support, JavaScript rendering, and structured data extraction for robust web content retrieval and analysis.
Back to servers
Provider
WebScraping.AI
Release date
Apr 15, 2025
Language
TypeScript
Package
Stats
296 downloads
6 stars

WebScraping.AI MCP Server provides a Model Context Protocol implementation that integrates with WebScraping.AI service for advanced web data extraction capabilities. It enables LLM assistants to extract structured data, answer questions about web content, and retrieve HTML with JavaScript rendering support.

Installation

Quick Start with npx

Run the server directly using npx:

env WEBSCRAPING_AI_API_KEY=your_api_key npx -y webscraping-ai-mcp

Manual Installation

# Clone the repository
git clone https://github.com/webscraping-ai/webscraping-ai-mcp-server.git
cd webscraping-ai-mcp-server

# Install dependencies
npm install

# Run
npm start

Configuring in Cursor

Note: Requires Cursor version 0.45.6+

The WebScraping.AI MCP server can be configured in two ways in Cursor:

  • Project-specific Configuration (recommended for team projects): Create a .cursor/mcp.json file in your project directory:

    {
      "servers": {
        "webscraping-ai": {
          "type": "command",
          "command": "npx -y webscraping-ai-mcp",
          "env": {
            "WEBSCRAPING_AI_API_KEY": "your-api-key",
            "WEBSCRAPING_AI_CONCURRENCY_LIMIT": "5"
          }
        }
      }
    }
    
  • Global Configuration (for personal use across all projects): Create a ~/.cursor/mcp.json file in your home directory with the same configuration format as above.

For Windows users experiencing issues, try using:

cmd /c "set WEBSCRAPING_AI_API_KEY=your-api-key && npx -y webscraping-ai-mcp"

Running on Claude Desktop

Add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "mcp-server-webscraping-ai": {
      "command": "npx",
      "args": ["-y", "webscraping-ai-mcp"],
      "env": {
        "WEBSCRAPING_AI_API_KEY": "YOUR_API_KEY_HERE",
        "WEBSCRAPING_AI_CONCURRENCY_LIMIT": "5"
      }
    }
  }
}

Configuration

Environment Variables

Required

  • WEBSCRAPING_AI_API_KEY: Your WebScraping.AI API key

Optional Configuration

  • WEBSCRAPING_AI_CONCURRENCY_LIMIT: Maximum number of concurrent requests (default: 5)
  • WEBSCRAPING_AI_DEFAULT_PROXY_TYPE: Type of proxy to use (default: residential)
  • WEBSCRAPING_AI_DEFAULT_JS_RENDERING: Enable/disable JavaScript rendering (default: true)
  • WEBSCRAPING_AI_DEFAULT_TIMEOUT: Maximum web page retrieval time in ms (default: 15000, max: 30000)
  • WEBSCRAPING_AI_DEFAULT_JS_TIMEOUT: Maximum JavaScript rendering time in ms (default: 2000)

Configuration Example

# Required
export WEBSCRAPING_AI_API_KEY=your-api-key

# Optional - customize behavior (default values)
export WEBSCRAPING_AI_CONCURRENCY_LIMIT=5
export WEBSCRAPING_AI_DEFAULT_PROXY_TYPE=residential # datacenter or residential
export WEBSCRAPING_AI_DEFAULT_JS_RENDERING=true
export WEBSCRAPING_AI_DEFAULT_TIMEOUT=15000
export WEBSCRAPING_AI_DEFAULT_JS_TIMEOUT=2000

Available Tools

Question Tool (webscraping_ai_question)

Ask questions about web page content.

{
  "name": "webscraping_ai_question",
  "arguments": {
    "url": "https://example.com",
    "question": "What is the main topic of this page?",
    "timeout": 30000,
    "js": true,
    "js_timeout": 2000,
    "wait_for": ".content-loaded",
    "proxy": "datacenter",
    "country": "us"
  }
}

Fields Tool (webscraping_ai_fields)

Extract structured data from web pages based on instructions.

{
  "name": "webscraping_ai_fields",
  "arguments": {
    "url": "https://example.com/product",
    "fields": {
      "title": "Extract the product title",
      "price": "Extract the product price",
      "description": "Extract the product description"
    },
    "js": true,
    "timeout": 30000
  }
}

HTML Tool (webscraping_ai_html)

Get the full HTML of a web page with JavaScript rendering.

{
  "name": "webscraping_ai_html",
  "arguments": {
    "url": "https://example.com",
    "js": true,
    "timeout": 30000,
    "wait_for": "#content-loaded"
  }
}

Text Tool (webscraping_ai_text)

Extract the visible text content from a web page.

{
  "name": "webscraping_ai_text",
  "arguments": {
    "url": "https://example.com",
    "js": true,
    "timeout": 30000
  }
}

Selected Tool (webscraping_ai_selected)

Extract content from a specific element using a CSS selector.

{
  "name": "webscraping_ai_selected",
  "arguments": {
    "url": "https://example.com",
    "css_selector": ".product-price",
    "js": true,
    "timeout": 30000
  }
}

Selected Multiple Tool (webscraping_ai_selected_multiple)

Extract content from multiple elements using CSS selectors.

{
  "name": "webscraping_ai_selected_multiple",
  "arguments": {
    "url": "https://example.com",
    "css_selectors": {
      "title": "h1",
      "price": ".price",
      "description": ".description"
    },
    "js": true,
    "timeout": 30000
  }
}

Account Tool (webscraping_ai_account)

Get information about your WebScraping.AI account.

{
  "name": "webscraping_ai_account",
  "arguments": {}
}

Common Options for All Tools

The following options can be used with all scraping tools:

  • timeout: Maximum web page retrieval time in ms (15000 by default, maximum is 30000)
  • js: Execute on-page JavaScript using a headless browser (true by default)
  • js_timeout: Maximum JavaScript rendering time in ms (2000 by default)
  • wait_for: CSS selector to wait for before returning the page content
  • proxy: Type of proxy, datacenter or residential (residential by default)
  • country: Country of the proxy to use (US by default). Supported countries: us, gb, de, it, fr, ca, es, ru, jp, kr, in
  • custom_proxy: Your own proxy URL in "http://user:password@host:port" format
  • device: Type of device emulation. Supported values: desktop, mobile, tablet
  • error_on_404: Return error on 404 HTTP status on the target page (false by default)
  • error_on_redirect: Return error on redirect on the target page (false by default)
  • js_script: Custom JavaScript code to execute on the target page

How to add this MCP server to 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 > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

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