mirror of
https://github.com/unclecode/crawl4ai.git
synced 2026-06-11 16:28:11 +00:00
MCP tools (md, html, screenshot, pdf, execute_js) hardcoded
CrawlerRunConfig() with no user input, so wait_until,
delay_before_return_html, cache_mode, and all other
CrawlerRunConfig fields were silently ignored. /crawl already
had full passthrough; this brings the remaining tools to parity.
- schemas.py: add crawler_config: Optional[Dict] to all five
request schemas so mcp_bridge.py exposes the field in MCP
tool inputSchemas automatically
- server.py: handlers now load via CrawlerRunConfig.load() then
stamp endpoint-required fields on top (screenshot, pdf, js_code);
fix screenshot_wait_for/wait_for_images defaults from 2/False to
None so they only override crawler_config when explicitly passed
- api.py: handle_markdown_request accepts crawler_config kwarg;
cache_mode precedence uses key-presence check instead of falsy
check so crawler_config.cache_mode correctly wins over legacy c
Tests: tests/mcp/test_mcp_crawler_config.py — 7 MCP SSE tests
proving delay_before_return_html is honoured server-side on all tools