scraper-mcp CLAUDE.md

A project instruction file for a Python web-scraping server. The server can retrieve webpage HTML, convert pages to Markdown, extract text, and list links from one or many URLs.

In plain words
What is it for?
Use it when developing, running, installing, or testing the scraper-mcp project, including its Docker setup.
Why use it?
It gives a coding agent the project context, setup commands, and testing commands needed to work on the scraper correctly.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/cotdp/scraper-mcp/claude-md
Clone the repo
git clone --depth 1 https://github.com/cotdp/scraper-mcp
Per session 1,882 This file is loaded in full into every session.
When invoked 1,882 The same file — it is already loaded in full.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01882 $0.01882
Opus 5 $0.00941 $0.00941
Sonnet 5 $0.00376 $0.00376
Haiku 4.5 $0.00188 $0.00188

Measured 2d ago against content hash f606f0d111a5, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

scraper-mcp CLAUDE.md scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- **`extract_links()`**: Extracts all `<a>` tags with URL resolution using `urllib.parse.urljoin()`
CLAUDE.md · 197 lines

How it starts

The opening of the file, as written. The whole thing — 197 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

A Model Context Protocol (MCP) server for efficient web scraping. Built with Python using FastMCP, providing AI tools with standardized web scraping capabilities through four main tools: raw HTML scraping, markdown conversion, text extraction, and link extraction. All tools support both single URL and batch operations with intelligent retry logic.

Development Commands

Environment Setup

# Install dependencies (uses uv package manager)
uv pip install -e ".[dev]"

Running the Server

# Run locally with default settings
python -m scraper_mcp

# Run with specific transport and port
python -m scraper_mcp streamable-http 0.0.0.0 8000

# Run with Docker
docker-compose up -d
docker-compose logs -f
docker-compose down

Testing

# Run all tests with coverage
pytest

# Run specific test file
pytest tests/test_server.py

# Run specific test class
pytest tests/test_server.py::TestScrapeUrlTool

# Run specific test function
pytest tests/test_server.py::TestScrapeUrlTool::test_scrape_url_success

# Run with verbose output
pytest -v

# Run without coverage report
pytest --no-cov

Code Quality

# Type checking
mypy src/

# Linting
ruff check .

# Auto-fix linting issues
ruff check . --fix

# Format code
ruff format .

Architecture

Provider Pattern

The server uses an extensible provider architecture for different scraping backends:

  • ScraperProvider (providers/base.py): Abstract interface defining scrape() and supports_url() methods
  • RequestsProvider (providers/requests_provider.py): Default HTTP scraper using requests library with exponential backoff retry logic
  • Future extensibility: Easy to add Playwright, Selenium, or Scrapy providers for JavaScript-heavy sites or specialized scraping

The get_provider() function in server.py routes URLs to appropriate providers. Currently defaults to RequestsProvider for all HTTP/HTTPS URLs.

Read the full file on GitHub · 197 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 197 lines · 1,882 tokens per session scan A f606f0d111a5

Subscribe to this mod's changes

scraper-mcp CLAUDE.md is an instructions file published in the GitHub repository cotdp/scraper-mcp (7 stars, last pushed 3mo ago), licensed MIT. It adds 1,882 tokens to every session, about $0.0094 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.