Scrapling Fetch MCP Server for Bot-Protected Websites
Fetch HTML and Markdown from bot-protected websites with Scrapling's MCP server to access text behind anti-automation measures.
npx -y @cyberchitta/scrapling-fetch-mcpOverview
Scrapling Fetch MCP Server is a small HTTP service that retrieves web pages protected by anti-automation defenses (for example Cloudflare, Akamai, and similar bot mitigations) and returns the page content in HTML or Markdown. It is designed to sit between an LLM-based agent and the web, exposing a simple Model Context Protocol (MCP)-compatible interface so language models can request clean, readable page text without having to handle browser automation or bypass logic themselves.
This server is useful when you need reliable text content from pages that refuse basic HTTP scraping. It encapsulates the complexity of headless-browser rendering, anti-bot handling, and HTML→Markdown conversion and exposes that functionality as an API or as an MCP tool that model-based applications can call directly.
Features
- Fetch fully rendered HTML from bot-protected pages using a headless browser layer
- Convert fetched HTML into Markdown automatically (optional)
- Simple JSON/HTTP API suitable for LLM tool invocation (MCP-compatible)
- Configurable timeouts, concurrency limits, and user-agent options
- Docker image for quick deployment and environment-variable-driven configuration
- Health and metrics endpoints to integrate with orchestration and monitoring
Installation / Configuration
Prerequisites:
- Docker (recommended) or Node/Python runtime (depending on distribution)
- Scrapling account / service credentials if using a hosted anti-bot bypass provider (optional)
Run with Docker (recommended):
# Pull the image and run on port 8080
Run from source (example pattern - adapt to language/runtime in repo):
# clone repo
# install dependencies (example for Node)
# run with environment variables for configuration
SCRAPLING_API_KEY=your_scrapling_api_key PORT=8080
Common environment variables:
| Variable | Purpose | Default |
|---|---|---|
| SCRAPLING_API_KEY | API key for Scrapling or headless service | (none) |
| PORT | HTTP port to listen on | 8080 |
| FETCH_TIMEOUT | Page fetch timeout in seconds | 30 |
| CONCURRENCY | Max parallel browser sessions | 4 |
| USER_AGENT | Default user-agent string for requests | standard browser UA |
Adjust timeouts and concurrency according to your hosting environment and the expected volume of requests.
Available Tools / Resources
The server exposes a small set of HTTP endpoints that are ideal to wrap as MCP tools for LLMs.
- GET /health — returns 200 if server is ready
- GET /metrics — Prometheus-style metrics (if enabled)
- POST /fetch — primary endpoint to fetch a URL and return HTML or Markdown
Example POST /fetch request (JSON):
Response (success):
Supported query parameters/JSON fields:
- url (string) — required, target URL to fetch
- format (string) — “html” or “markdown” (default: “html”)
- render_js (bool) — whether to execute JS / render client-side content
- timeout (number) — override default per-request timeout (seconds)
If you want to expose the server as an MCP tool for an LLM, provide a tool descriptor that maps to POST /fetch with the required fields (url, format). The server is intentionally minimal so tools remain straightforward.
Use Cases
LLM-assisted browsing for research
- An assistant can call the fetch tool to obtain a clean Markdown version of paywalled or bot-protected article text, then summarize or extract key points without dealing with the page’s obfuscation or JS rendering.
Single-page app content capture
- Fetch dynamic content that requires JS rendering (render_js=true) and convert it to Markdown for downstream parsing and indexing.
Content ingestion for indexing or search
- Use the server to retrieve canonical article text from sites guarded by anti-bot layers and feed the Markdown into a vector store or search index.
Compliance and monitoring
- Periodically fetch protected policy pages or terms-of-service documents using the server, store snapshots (HTML or Markdown), and diff them for changes.
Tool integration in LLM workflows
- Expose the fetch endpoint as an MCP tool so model-based agents can retrieve context-aware page text on demand and combine it with reasoning or data extraction tools.
Examples
Fetch page as Markdown with curl:
Simple health check:
MCP tool descriptor (example snippet):
Notes and Best Practices
- Respect robots.txt and site terms — using browser-level fetch to bypass bot protections can have legal and ethical implications.
- Cache results where appropriate to reduce repeat headless browser usage and costs.
- Tune concurrency and timeouts to avoid overloading the host or triggering defensive measures on target sites.
- Use API keys and network-level controls to prevent abuse of your deployed instance.