crawl4ai-mcp
Allows searching the web using Baidu search engine.
Allows extracting video transcripts from Bilibili.
Allows searching the web using DuckDuckGo search engine.
Allows fetching content from GitHub pages.
Allows searching the web using Google search engine.
Allows fetching content from Medium articles.
Allows using OpenAI-compatible models to enhance extracted content.
Allows searching the web using Sogou search engine.
Allows extracting video transcripts from YouTube.
Click on "Install 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., "@crawl4ai-mcpfetch the content of https://example.com"
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.
crawl4ai-mcp
A minimal MCP server for agent-friendly web extraction and search.
Two tools: fetch real pages with Playwright + Crawl4AI, or search across 7 engines with automatic fallback.
Quick entry
Audience | Read this |
Human developer | |
Living in the AI era, delegating your remaining sanity to an agent |
Related MCP server: web-mcp-server
At a glance
Item | Reality in this repo |
MCP tools | 2 tools: |
Single-page fetch |
|
Web search |
|
Search engines | DuckDuckGo · Bing · Google · Yandex · Sogou · 360Search · Baidu |
Output |
|
Non-LLM mode | First-class, default, usable without any model |
LLM mode | Off by default. Enabled only with |
Fallback | Missing/failed LLM call automatically falls back to non-LLM result |
Anti-bot realism | proxy / cookies / persistent profile / randomized browser behavior |
License | AGPL-3.0-or-later |
How it works
Fetch flow:
---
config:
theme: base
themeVariables:
primaryColor: "#FAF9F5"
primaryTextColor: "#1A1A1A"
primaryBorderColor: "#D97757"
lineColor: "#8B5E3C"
secondaryColor: "#F5F1E8"
tertiaryColor: "#FAF9F5"
fontFamily: "ui-sans-serif, system-ui, -apple-system, sans-serif"
fontSize: "14px"
---
flowchart LR
A[URL list] --> B[Playwright + Crawl4AI]
B --> C{Fast path enough?}
C -- Yes --> D[Markdown / HTML]
C -- No --> E[Stronger fallback]
E --> D
D --> F{use_llm?}
F -- No --> G[Return result]
F -- Yes --> H[OpenAI-compatible cleanup]
H --> I{LLM success?}
I -- Yes --> J[Return enhanced result]
I -- No --> GSearch flow:
---
config:
theme: base
themeVariables:
primaryColor: "#FAF9F5"
primaryTextColor: "#1A1A1A"
primaryBorderColor: "#D97757"
lineColor: "#8B5E3C"
secondaryColor: "#F5F1E8"
tertiaryColor: "#FAF9F5"
fontFamily: "ui-sans-serif, system-ui, -apple-system, sans-serif"
fontSize: "14px"
---
flowchart LR
A[query + engine] --> B{engine=auto?}
B -- Yes --> C[Detect language]
C --> D[Build engine plan]
B -- No --> E[Use specified engine]
D --> F[Try engines in order]
E --> F
F --> G{Results?}
G -- Yes --> H[Aggregate + deduplicate]
G -- No, next engine --> F
H --> I[Return results]Installation
Quick install (recommended)
Step 1: Create a virtual environment
# macOS/Linux - using system Python 3 (3.10-3.13)
python3 -m venv crawl4ai
source crawl4ai/bin/activate
# Windows
python -m venv crawl4ai
crawl4ai\Scripts\activateStep 2: Install
pip install --upgrade pip
pip install crawl4agent
playwright install chromiumAlternative methods
If python3 is too old (3.9 or below):
# Use specific Python version (3.10, 3.11, 3.12, or 3.13)
python3.12 -m venv crawl4ai
source crawl4ai/bin/activate
pip install crawl4agentUsing conda:
conda create -n crawl4ai python=3.12
conda activate crawl4ai
pip install crawl4agent
playwright install chromiumUsing pipx (global command):
pipx install crawl4agent
crawl4ai-mcp --helpTroubleshooting
Problem: "pip install" uses Python 2.7
# macOS: use python3 explicitly
python3 -m pip install crawl4agent
# Or check which pip you're using
which pip
pip --versionProblem: "No matching distribution found for crawl4agent"
Check Python version:
python3 --version(must be 3.10-3.13)Upgrade pip:
python3 -m pip install --upgrade pip
Problem: "playwright install" fails
Use mirror (China):
export PLAYWRIGHT_DOWNLOAD_HOST=https://npmmirror.com/mirrors/playwright/Then:
python3 -m playwright install chromium
Why this project exists
Most generic “web fetch” tools either fail on JS-heavy pages or return too much boilerplate. This project focuses on four things:
Non-LLM quality first: usable even with zero model config
Minimal MCP surface: easier for agents, easier to maintain
Pragmatic anti-bot workflow: proxy / cookies / persistent profile are first-class
Golden regression review: full markdown outputs can be saved and inspected page by page
Core capabilities
Non-LLM mode
Capability | Actual behavior |
Rendering | Real browser rendering via Playwright |
Extraction | Crawl4AI markdown/html extraction |
Fallback | Fast path → stronger path when content is too thin |
Cleanup | Remove obvious noise, compress blanks, strip data-image placeholders |
Site tuning | Medium / Claude Docs / GitHub and other mainstream sites |
ChatGPT shared links | Full conversation extraction from |
Video transcripts | YouTube / Bilibili URLs prefer subtitle extraction via |
Block detection |
|
Batch control | Bounded concurrency via |
Optional LLM mode
Input | Meaning |
| Turn on post-cleanup with an OpenAI-compatible model |
| Tell the model what to keep / remove |
Important reality check:
With
llm_instruction, the prompt is constraint-heavy and biased toward preserving original lines.Without
llm_instruction, the model does a more generic “clean readable markdown” pass.If the LLM call fails for any reason, the tool returns the original non-LLM extraction plus
llm_used=falseandllm_error.
MCP Tools
fetch_urls
{
"urls": ["https://a.com", "https://b.com"],
"format": "markdown",
"max_chars": 200000,
"concurrency": 3,
"use_llm": false,
"llm_instruction": "keep only the tutorial body and in-body references"
}Use a single-element list if you only need one page.
For supported video URLs (youtube.com, youtu.be, bilibili.com, b23.tv), fetch_urls prefers transcript extraction and returns readable markdown built from subtitles when available.
Return shape
Field | Meaning |
| Original URL |
| Final resolved URL after redirects |
| Extracted title |
| Markdown or HTML |
|
|
| Normalized extracted links |
| Present for supported video transcript extraction results |
| Likely anti-bot / verification / denied result |
| Whether LLM enhancement was actually applied |
| Why the LLM step degraded |
search_web
{
"query": "crawl4ai web scraping",
"engine": "auto",
"max_results": 10,
"lang": ""
}Parameter | Default | Description |
| (required) | Search query string |
|
| Engine to use: |
|
| Maximum number of results |
|
| Language hint (e.g. |
When engine="auto", the server tries engines in fallback order: DuckDuckGo → Bing → Google → Baidu. The first engine that returns results wins.
Search return shape
Field | Meaning |
| Which engine actually returned results |
| Original query |
| List of |
| Number of results |
| Engines that failed before the successful one |
Anti-bot realism
The server already includes randomized browser behavior in code:
Mechanism | Actual status |
Random viewport | Yes |
Random user agent mode | Yes, when explicit UA is not provided |
Delay jitter | Yes |
| Yes |
| Yes, in stronger fallback mode |
Proxy / cookies / persistent profile | Supported via env vars |
Cloudflare bypass | Enhanced browser fingerprinting + configurable wait strategies |
Note: For overseas websites (Medium, ProductHunt, etc.), using a proxy is recommended. The server supports HTTP/HTTPS/SOCKS5 proxies via CRAWL4AI_MCP_PROXY environment variable.
Proxy input formats
CRAWL4AI_MCP_PROXY accepts all of these:
Input | Interpreted as |
| HTTP proxy |
| HTTPS proxy |
| SOCKS5 proxy |
| Auto-normalized to |
| Auto-normalized to |
| Auto-normalized to |
That means the README should not claim “perfect stealth”, but it can honestly claim human-like randomization and practical anti-bot knobs.
Quickstart
Conda
conda env create -f environment.yml
conda activate crawl4ai-mcp
python -m playwright install
crawl4ai-mcpvenv
python -m venv .venv
source .venv/bin/activate
python -m pip install -U pip
python -m pip install -e '.[dev]'
python -m playwright install
crawl4ai-mcpMCP server config example
{
"mcpServers": {
"crawl4ai": {
"command": "crawl4ai-mcp",
"env": {
"CRAWL4AI_MCP_HEADLESS": "true",
"CRAWL4AI_MCP_PROXY": "127.0.0.1:7890",
"CRAWL4AI_MCP_NAVIGATION_TIMEOUT_MS": "30000",
"CRAWL4AI_MCP_WAIT_UNTIL": "load",
"OPENAI_BASE_URL": "https://your-openai-compatible-host",
"OPENAI_API_KEY": "your-api-key",
"OPENAI_MODEL": "your-model-name"
}
}
}
}LLM-related env vars are optional. use_llm is still off by default at call time. If any LLM env is missing, invalid, or the model call fails, the server automatically falls back to non-LLM extraction.
Runtime configuration
Env var | Purpose |
| Run browser headless |
| Upstream proxy, supports |
| Playwright storage state JSON |
| Browser cookies source for video transcript extraction, e.g. |
| Netscape cookies.txt path for |
| Reuse browser profile |
| Profile directory |
| Default max single navigation wait, default |
| Default page readiness strategy, default |
| OpenAI-compatible base URL |
| API key |
| Model name |
One-shot CLI
This project now exposes a stateless one-shot CLI in addition to the MCP stdio server.
Fetch a single URL once and print JSON:
crawl4agent fetch "https://obsidian.md/help/cli" --format markdownSearch the web once and print JSON:
crawl4agent search "agent framework" --engine auto --max-results 5Use proxy and browser cookies for video transcript extraction:
crawl4agent fetch "https://www.youtube.com/watch?v=OFfwN23hR8U" \
--proxy http://127.0.0.1:7890 \
--cookies-from-browser chromeRun golden smoke once and print a JSON array:
crawl4agent smoke --out-dir ./_golden_outputsThe existing crawl4ai-mcp command remains the MCP stdio server entrypoint for MCP hosts.
Available help surfaces:
crawl4agent --help
crawl4agent fetch --help
crawl4agent search --help
crawl4agent smoke --helpGolden smoke regression
CRAWL4AI_MCP_SMOKE_DIR=./_golden_outputs .venv/bin/python -m crawl4ai_mcp.smoke_goldenFor overseas video URLs, a local proxy is often needed:
CRAWL4AI_MCP_PROXY=http://127.0.0.1:7890 \
CRAWL4AI_MCP_SMOKE_DIR=./_golden_outputs \
.venv/bin/python -m crawl4ai_mcp.smoke_goldenThis writes full markdown outputs to _golden_outputs/ so you can inspect extraction quality page by page.
The golden set now includes the earlier baseline URLs plus ainew.me, openclaw, watcha, producthunt, mydrivers, caihongtu, openrouter, mobile Douban, and video pages from YouTube / Bilibili. For sites outside mainland China, proxy-based verification is recommended.
Some overseas sites may still return Cloudflare or similar verification pages even when a proxy is configured. In those cases the server now marks them with blocked=true. The recommended path is: better proxy quality, valid cookies, or a persistent browser profile after manual verification.
For some video golden URLs, subtitle extraction may require login. If yt-dlp reports login-required subtitles, configure either CRAWL4AI_MCP_YTDLP_COOKIES_FROM_BROWSER or CRAWL4AI_MCP_YTDLP_COOKIEFILE before running golden smoke.
Prior art
Crawl4AI: https://github.com/unclecode/crawl4ai
mcp-crawl4ai-rag: https://github.com/coleam00/mcp-crawl4ai-rag
weidwonder/crawl4ai-mcp-server: https://github.com/weidwonder/crawl4ai-mcp-server
WaterCrawl: https://github.com/watercrawl/WaterCrawl
teracrawl: https://github.com/BrowserCash/teracrawl
License
This project is licensed under AGPL-3.0-or-later.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/pazyork/crawl4ai-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server