mcp-webscraper
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-webscraper Scrape books.toscrape.com for all book titles and prices"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Web Scraper for Claude Desktop
A Model Context Protocol (MCP) server that enables Claude Desktop to perform advanced web scraping and crawling operations. Extract structured data, analyze website architectures, and discover content relationships - all through natural conversation with Claude.
π― Features
Static & Dynamic Scraping: Handle both regular HTML and JavaScript-rendered pages
Website Crawling: Discover and map entire website structures
Data Extraction: Extract specific elements using CSS selectors
Batch Operations: Process multiple URLs efficiently
Link Analysis: Understand how pages connect and reference each other
Related MCP server: Katana MCP Server
π₯ Watch the Tutorial
See the full demo and step-by-step setup guide on YouTube:

π Prerequisites
Python 3.10 or higher
WSL2 with Ubuntu (for Windows users)
Claude Desktop application
uvpackage manager
π Installation
1. Clone the Repository
git clone https://github.com/samirsaci/mcp-webscraper.git
cd mcp-webscraper2. Install uv Package Manager
If you don't have uv installed:
curl -LsSf https://astral.sh/uv/install.sh | sh3. Initialize the project
# Initialize the virtual environment
uv init .4. Install Dependencies
uv add "mcp[cli]"
source .venv/bin/activate
uv pip install -r requirements.txtDo not forget to install playwright browser to scrape dynamic content
uv run playwright install chromium5. Test the Installation
Run the test script to verify everything works using a website that loves to be scrapped https://books.toscrape.com/:
uv run python test_local.pyExpected Output:
Static Scraping Success: True
HTML length: 51294
---------
Dynamic Scraping Success: True
HTML length: 51004
---------
Testing Crawler...
Crawler Success: True
Pages crawled: 5
Pages discovered: 437
Failed URLs: 0
First 3 pages discovered:
1. All products | Books to Scrape - Sandbox
URL: https://books.toscrape.com/
Links found: 73
Depth: 0
2. All products | Books to Scrape - Sandbox
URL: https://books.toscrape.com/index.html
Links found: 73
Depth: 1
3. Books |
Books to Scrape - Sandbox
URL: https://books.toscrape.com/catalogue/category/books_1/index.html
Links found: 73
Depth: 1
Statistics:
Total unique links: 104
Max depth reached: 1
Avg load time: 0.21sβοΈ Claude Desktop Configuration
For Windows Users with WSL
Locate your Claude Desktop configuration file:
File -> Settings -> Edit ConfigAdd the WebScrappingServer configuration
{
"mcpServers": {
"WebScrapingServer": {
"command": "wsl",
"args": [
"-d",
"Ubuntu",
"bash",
"-lc",
"cd ~/path/to/mcp-webscraper && uv run --with mcp[cli] mcp run scrapping.py"
]
}
}
}Important: Replace ~/path/to/mcp-webscraper with the actual path to your project folder in WSL. To find your WSL path:
pwd3. Restart Claude Desktop
After updating the configuration:
Completely quit Claude Desktop (not just close the window)
Start Claude Desktop again
Look for the π icon in the text input area
Click it to verify "WebScrapingServer" appears
π§ Usage Examples
Once configured, you can ask Claude to:
Basic Scraping
"Scrape the homepage of example.com and tell me what you find"Advanced SEO analysis
Please help me to crawl my personal blog https://yourblog.com with a limit of 150 pages.
I would like to understand how articles are referring to each other.
Can you help me to perform this type of analysis?π Project Structure
mcp-webscraper/
βββ models/
β βββ scraping_models.py # Pydantic models for data validation
βββ utils/
β βββ web_scraper.py # Core WebScraper class
βββ scrapping.py # MCP server implementation
βββ test_local.py # Local testing script
βββ requirements.txt # Python dependencies
βββ README.md # This file
βββ scraping_server.log # Server logs (created at runtime)π οΈ Available MCP Tools
The server exposes these tools to Claude:
scrape_url: Get raw HTML from any webpageextract_data: Extract multiple elements using CSS selectorsextract_first: Get a single element from a pagebatch_scrape: Process multiple URLscrawl_website: Discover and map website structure
π Troubleshooting
Server not appearing in Claude
*If the server does not appear in Claude, try first to restart Claude Desktop by terminating its processus.`
If this does not work, try to
Check the log file:
cat scraping_server.logVerify the path in config matches your WSL path:
pwdThe output should match what you have in your config file.
Test the server directly:
uv run python scrapping.pyPlaywright issues
If JavaScript scraping fails, try to reinstall the browser
uv run playwright install chromiumWSL-specific issues
Ensure WSL2 is properly installed:
Run this in Windows PowerShell opened as Administrator
wsl --statusπ License
MIT License - feel free to use this in your own projects!
About me π€
Senior Supply Chain and Data Science consultant with international experience working on Logistics and Transportation operations. For consulting or advising on analytics and sustainable supply chain transformation, feel free to contact me via Logigreen Consulting or LinkedIn
Available Tools
5 toolsbatch_scrapeB
Scrape multiple URLs efficiently.
Args:
urls: List of URLs to scrape
javascript: Set to True if the sites need JavaScript rendering
Returns:
List of scraping results for each URL
Inputs: urls (required), javascript. Returns: result
crawl_websiteA
Crawl a website to discover its structure and pages.
Args:
start_url: Starting URL
max_pages: Maximum pages to crawl (default 50)
max_depth: Maximum link depth (default 3)
same_domain_only: Stay on same domain (default True)
Returns:
Site map with discovered pages and statistics
Inputs: start_url (required), max_pages, max_depth, same_domain_only. Returns: result
extract_dataA
Scrape a webpage and extract specific data using CSS selectors.
Args:
url: The webpage to scrape
css_selectors: List of CSS selectors (e.g., ["h1", "a.link", "#content"])
attributes: List of attributes to extract for each selector (e.g., ["text", "href", "text"])
If not provided, defaults to "text" for all selectors
javascript: Set to True for JavaScript-rendered sites
Returns:
Dictionary with extracted data for each selector
Example:
extract_data(
url="https://example.com",
css_selectors=["h1", "a"],
attributes=["text", "href"]
)
Inputs: url (required), css_selectors (required), attributes, javascript. Returns: result
extract_firstA
Extract the first matching element from a webpage.
Useful for getting single values like page title, main heading, etc.
Args:
url: The webpage to scrape
css_selector: CSS selector for the element (e.g., "h1", "title", "meta[name='description']")
attribute: What to extract - "text" for content, or attribute name like "href", "content", "src"
javascript: Set to True for JavaScript-rendered sites
Returns:
Dictionary with the extracted value
Example:
extract_first(url="https://example.com", css_selector="title", attribute="text")
Inputs: url (required), css_selector (required), attribute, javascript. Returns: result
scrape_urlA
Scrape a webpage and return its HTML content.
Args:
url: The webpage URL to scrape
javascript: Set to True for JavaScript-rendered sites (slower but handles dynamic content)
wait_seconds: How long to wait for JavaScript to load (only used when javascript=True)
Returns:
Dictionary with html content, status code, and load time
Inputs: url (required), javascript, wait_seconds. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 5 tools
Each tool serves a clearly distinct purpose: raw HTML fetch, structured extraction per URL, extraction of first matching element, batch scraping, and website crawling. No overlap or ambiguity.
All tools follow a consistent verb_noun pattern in snake_case (batch_scrape, crawl_website, extract_data, extract_first, scrape_url). The naming is predictable and clear.
With 5 tools, the coverage is focused and each tool adds unique value. The count is ideal for a web scraping server, avoiding bloat or gaps.
The tool set covers the core web scraping workflows: fetching raw HTML, extracting with CSS selectors, handling single/multiple URLs, and crawling site structure. No obvious missing operations for typical scraping tasks.
Maintenance
Related MCP Connectors
Scrape websites by following links and extract structured data from natural language instructions.
Enable language models to perform advanced AI-powered web scraping with enterprise-grade reliabiliβ¦
Web data for agents. Extract web pages, crawl websites, discover URLs, and search the web.
Web scraping, search, crawling, structured extraction and research for AI agents.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables web scraping, crawling, structured data extraction, and browser automation through multiple AI agents including OpenAI's CUA, Anthropic's Claude Computer Use, and Browser Use.MIT
- AlicenseNot gradedqualityDmaintenanceIntegrates ProjectDiscovery's Katana web crawler with Claude Desktop, enabling users to crawl websites, discover endpoints and hidden resources, extract JavaScript files, and perform reconnaissance with customizable depth, scope, and filtering options.MIT
- FlicenseNot gradedqualityDmaintenanceEnables scraping single pages or crawling entire websites, converting content to markdown and optionally extracting structured data with Claude.-
- AlicenseNot gradedqualityCmaintenanceEnables Claude and other MCP clients to read, extract, crawl, and export data from open browser tabs and specified URLs locally, including logged-in sessions, structured page data, contacts, images, sitemaps, and Shopify catalogues.MIT