Web Scraper MCP Server

Web Scraper MCP Server

Enables AI agents to fetch, clean, and extract readable content from web pages, optionally including links and images, via the scrape_url tool.

Category
Visit Server

README

Web Scraper MCP Server

A Model Context Protocol (MCP) server that provides web scraping capabilities using FastMCP. It allows AI agents to fetch, clean, and extract readable content from web pages, optionally including links and images.

Features

  • ๐ŸŒ Fetches and parses web pages
  • ๐Ÿงน Cleans and normalizes extracted text
  • ๐Ÿ”— Optionally extracts links
  • ๐Ÿ–ผ๏ธ Optionally extracts image URLs
  • โšก Async HTTP requests using httpx
  • ๐Ÿง  Exposed as an MCP tool (scrape_url)
  • ๐Ÿณ Dockerized for easy deployment

Project Structure

. 
โ”œโ”€โ”€ .env.example
โ”œโ”€โ”€ .gitignore
โ”œโ”€โ”€ Dockerfile         # Container image definition
โ”œโ”€โ”€ Makefile           # Common development and deployment commands
โ”œโ”€โ”€ README.md          # This file
โ”œโ”€โ”€ docker-compose.yml # Compose file for easy local development
โ”œโ”€โ”€ main.py            # MCP server and scraping logic
โ””โ”€โ”€ requirements.txt   # Dependencies file

main.py

This file contains the MCP server implementation.

Key Components

  • FastMCP Server

    • Runs an MCP-compatible HTTP server
    • Exposes tools to AI agents
  • scrape_url Tool

    • Fetches and extracts content from a given URL

Tool Signature

scrape_url(
    url: str,
    include_links: bool = True,
    include_images: bool = False,
    clean_text: bool = True
) -> str

Behavior

  • Validates URLs before fetching

  • Removes <script> and <style> tags

  • Extracts readable text

  • Optionally appends:

    • All links (<a href>)
    • All images (<img src>)
  • Returns a formatted plain-text result

Configuration (Environment Variables)

Variable Default Description
HOST_ADDR 0.0.0.0 Bind address
HOST_PORT 9292 Server port
LOG_LEVEL INFO Logging level

Dockerfile

The Dockerfile builds a lightweight containerized version of the MCP server.

Highlights

  • Based on python:3.12-slim

  • Optimized for production use

  • Sets helpful defaults:

    • No bytecode
    • Unbuffered output
    • Reduced pip noise

Example Build & Run

docker build -t mcp-web-scraper .
docker run -p 9292:9292 mcp-web-scraper

Makefile

The Makefile provides shortcuts for common tasks.

Common Targets

Target Description
clean Remove local virtual environment
dev-compose Start development environment with Docker Compose
dev-down Stop development Docker Compose stack
infra Apply Terraform infrastructure

Example Usage

make dev-compose
make dev-down
make clean

Running Locally (Without Docker)

pip install -r requirements.txt
python main.py

The server will start at:

http://localhost:9292

MCP Integration

This server is designed to be consumed by MCP-compatible clients or agents, enabling them to:

  • Read web pages
  • Extract structured textual content
  • Use scraped data as model context

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured