crawl4ai-local-for-windows
This server provides local MCP tools for crawling web pages on Windows and returning content or files to an agent.
crawl_markdown(url): Crawl a URL and return page content as Markdown.
crawl_structured(url, selector, fields): Extract repeated elements as JSON using CSS selectors.
crawl_screenshot(url, output_path): Capture a full-page screenshot and save it to a file (with system-directory protection).
Supports waiting options (
wait_seconds,wait_selector) for JavaScript-rendered pages.Keeps a reusable browser instance and automatically recovers from browser crashes.
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., "@crawl4ai-local-for-windows Crawl https://example.com and summarize the main points"
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 Local for Windows
Local MCP server for Crawl4ai on Windows. Runs directly on Windows without WSL.
π€ Most of the code was generated with AI assistance.
See also:
Requirements
Python 3.14 (Python installed via uv may be blocked by Windows Smart App Control, so install it separately)
Related MCP server: krwl3r
Installation
uv sync
# Install Chromium for Playwright
uv run crawl4ai-setupRunning
π¨ This server is a stdio server β no need to keep it running like a network server. When connected to an agent as MCP, the agent automatically spins up the server instance.
# Check for the "π Crawl4ai MCP server started." message, then exit
uv run mainβ
After confirming the welcome message, press Ctrl+C to exit, then add the MCP to your agent.
# Tip: debugging mode (MCP Inspector)
uv run mcp dev src/crawl4ai_local_for_windows/server.pyAdding MCP to an Agent
Claude Code
claude mcp add --transport stdio --scope user crawl4ai -- uv run --directory <parent_location>/crawl4ai-local-for-windows mainparent_location: Write it likeC:/dev/repoe.g.
claude mcp add --transport stdio --scope user crawl4ai -- uv run --directory C:/dev/repo/crawl4ai-local-for-windows main
# Check MCP installation
claude mcp list
claude mcp get crawl4aiHermes Agent
hermes mcp add crawl4ai --command "uv" --args "run" "--directory" "<parent_location>/crawl4ai-local-for-windows" "main"parent_location: Write it likeC:/dev/repoe.g.
C:/dev/repo/crawl4ai-local-for-windows
# Check MCP installation
hermes mcp listTools
crawl_markdown(url, wait_seconds=0, wait_selector="")
Crawl a URL and return the content as Markdown.
crawl_structured(url, selector, fields, wait_seconds=0, wait_selector="")
Extract repeated elements as JSON using CSS selectors.
crawl_structured(
url="https://books.toscrape.com/",
selector="article.product_pod",
fields={"μ λͺ©": "h3@title", "κ°κ²©": ".price_color:text"},
)
# β [{"μ λͺ©": "A Light in the Attic", "κ°κ²©": "Β£51.77"}, ...]Field spec syntax:
Spec | Meaning |
| Text of the matched element |
| Attribute of a child element ( |
| Attribute of the base element itself |
| Nth element β use standard CSS ( |
Both tools share the waiting options (see below).
crawl_screenshot(url, output_path)
Capture a full-page screenshot and save it to a file. Parent directories are created automatically.
π‘οΈ output_path is checked against a blocklist of known Windows system directories (C:\Windows, C:\Program Files, C:\Program Files (x86), C:\ProgramData, C:\System Volume Information, C:\$Recycle.Bin, C:\Users\All Users, C:\Users\Default) before the crawl even runs. A path that resolves into one of these (including via .. traversal) is rejected with an error message, so an agent can't accidentally overwrite system files. This is a blocklist, not a full sandbox β it guards against mistakes, not a determined attacker.
Browser Reuse & Crash Recovery
Instead of launching Chromium on every call (which is expensive), the server keeps one browser instance for the process lifetime. If the shared browser crashes mid-session, the server detects it and recovers automatically:
Crash detection matches Playwright collapse signatures only β
Target page, context or browser has been closed,browser has crashed,browsertype.launchfailures, etc. Network errors, anti-bot blocks, and timeouts are page-side causes and are never retried with a fresh browser.On crash: dispose the dead instance β launch a new one β retry, up to
_MAX_RECREATE_ATTEMPTS = 2attempts.Both failure paths are checked equally on every attempt: exceptions raised by
arun()andresult.success=False+ crash message inerror_message.On the last attempt, a crash is still reported as a failure, but the crawler is not reset again β that cleanup already happened on the prior attempt, and resetting a second time could tear down an instance a concurrent request just recreated.
Preventive recycling (e.g., refresh every N pages) is intentionally left to Crawl4ai's built-in browser recycling; the server only reacts to actual collapses.
Concurrency note: multiple simultaneous arun() calls on the shared crawler are safe β Crawl4ai serializes page creation internally (_page_lock, GH-1198 fix) and manages context lifecycle with refcounting + LRU. Verified with concurrent multi-site smoke tests.
Waiting Options (Dynamic Pages)
For dynamic pages that render content late using JS, use the waiting options of crawl_markdown / crawl_structured.
# Method 1: Wait for a fixed duration (seconds)
crawl_markdown(url="https://example.com", wait_seconds=5)
# Method 2: Wait until a CSS selector appears (takes precedence over wait_seconds when specified)
crawl_markdown(url="https://example.com", wait_selector="div.result-list")Verification Results (2026-08-25)
Comparison of 3 cases on a local test page that updates content via JS after 3 seconds:
Case | success | Captures Dynamic Content |
No waiting option | True | β Returns only "Loading..." |
| True | β Accurately captures final content |
| True | β Passes immediately if the element already exists in the initial HTML |
Findings / Cautions
wait_selectoris only valid for "newly created elements." If the text of an element already present in the initial HTML (e.g.,<article id="dynamic">Loading...</article>) changes later, the selector matches immediately and passes without waiting. For pages that update text dynamically, usewait_seconds.Extreme pages trigger anti-bot heuristics. Pages with minimal content and many script tags are flagged by Crawl4ai's anti-bot detector as
Blocked by anti-bot protection: Structural: no_content_elements, script_heavy_shell, resulting insuccess=False. Although rare in production pages, testing should be done on pages containing basic static content (navigation bars, paragraphs, etc.).
Keeping Up with Upstream
This server depends on the official crawl4ai library, so upstream releases may require source changes. The project ships a Claude Code slash command that handles this: .claude/commands/sync-upstream.md.
Run it in Claude Code from this repository's root:
# Sync to the latest stable release
/sync-upstream
# Sync to a specific version (pre-releases only when named explicitly)
/sync-upstream 0.9.5What it does:
Compares the installed
crawl4aiversion with the latest GitHub release, and stops if already up to date.Reads the release notes and
CHANGELOG.mdsince the current version, keeping only changes that affect the crawl4ai APIs used insrc/.Raises the
crawl4ai>=lower bound withuv add, and runsuv run crawl4ai-setupwhen the browser version changed.Updates
server.py(and both READMEs when behavior changes) without changing MCP tool names, arguments, or return formats. If that becomes unavoidable, it asks first.Runs Ruff, Flake8, mypy, pytest, and a live smoke test of all three tools, then reports the results.
It does not commit. Review the diff and commit yourself.
Available Tools
2 toolscrawl_markdownB
μ£Όμ΄μ§ URLμ ν¬λ‘€λ§ν΄μ λ§ν¬λ€μ΄μΌλ‘ λ°ννλ€.
Inputs: url (required). Returns: result
crawl_screenshotB
μ€ν¬λ¦°μ·μ μ°μ΄ νμΌλ‘ μ μ₯νλ€.
Inputs: url (required), output_path (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 2 tools
The two tools are clearly distinct: one returns markdown content, the other saves a screenshot. There is no overlap in their purposes or outputs.
Both tools follow the same verb_noun pattern with the 'crawl_' prefix, making the naming entirely predictable and consistent.
With only two tools, the server is slightly under the typical 3-15 range, but the minimal set is reasonable for a focused crawler that only offers markdown and screenshot output.
The core crawling workflow is covered, but there are noticeable gaps such as raw HTML output, link extraction, or crawling options like depth or custom selectors. Agents may need to work around these missing capabilities.
Maintenance
Related MCP Connectors
Hosted Web Crawler MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
One MCP server for all web data. Scrape, search, crawl, and AI research in one install.
Web scraping, browser automation, screenshots and AI data extraction for AI agents via MCP.
Scrape, crawl and search the web for AI agents via MCP.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA locally-hosted MCP server that provides AI assistants with advanced web crawling capabilities, including structured data extraction, deep site crawling, and page screenshots. It enables users to convert single or multiple URLs into clean Markdown content for processing by LLMs without requiring external API keys for basic features.-
- AlicenseNot gradedqualityDmaintenanceMCP server for web scraping and browser automation, enabling AI agents to extract clean, token-efficient content from web pages.1MIT
- AlicenseNot gradedqualityDmaintenanceA local, dependency-free MCP server that gives AI agents controlled access to the active Windows desktop, enabling automated interaction with applications through screenshots, clicks, typing, and window management.151 npm1MIT
- FlicenseNot gradedqualityDmaintenanceMCP server that enables AI agents to control Windows by clicking, typing, and navigating with a visible cursor overlay, using a layered approach (native UIA, browser CDP, pixel fallback) for reliable interaction.1-