MCP Server Reference
html2rss ships a built-in Model Context Protocol (MCP) server for AI agents and IDEs (Cursor, Claude Desktop, Copilot).
# stdio (default for desktop clients)html2rss mcp# HTTP on loopback onlyhtml2rss mcp --transport http --port 8080| Transport | Command | Notes |
|---|---|---|
stdio |
html2rss mcp |
Recommended for Cursor / Claude Desktop |
http |
html2rss mcp --transport http --port 8080 |
Bound to 127.0.0.1 only; needs rack, rackup, webrick |
Daemon logs go to stderr (stdout is JSON-RPC). Default LOG_LEVEL for the MCP process is info unless you set it.
Strategy
Section titled “Strategy”scrape and capture use strategy: "auto" by default so html2rss can choose an available fetch path from the scrape result. Prefer native RSS/Atom when present; weak homepage URLs may be rewritten via entry resolution.
The published strategy values are auto, default, httpx and botasaurus. Keep auto for normal use. For inspect and recon, auto stays on the cheap default fetch; pin botasaurus when you need browser rendering there. Pin strategy: "botasaurus" only when a diagnostic requires browser rendering or browser-specific controls.
Read html2rss://runtime for botasaurus_configured (boolean only). Set BOTASAURUS_SCRAPER_URL on the MCP process env.
Result envelope
Section titled “Result envelope”Every tool returns one JSON object in text content and structuredContent:
{ "ok": true, "next_step": "test", "guidance": "...", "payload": {}}isError matches ok: false. Articles live in payload.items; YAML in payload.yaml; RSS in payload.rss.
When a result was built from cached pages, the envelope also carries cache: { hits, max_age_seconds }. See Response cache.
next_step is one of: done, inspect, recon, validate, apply, scrape, capture, read_runtime, test.
Tools (7 bare verbs + batch trio)
Section titled “Tools (7 bare verbs + batch trio)”Golden path for durable YAML: inspect (optional) → recon → capture → test → apply. One-shot articles: scrape. Schema-only side door: validate.
scrape
Section titled “scrape”One-shot article extraction as JSON Feed items (no saved config).
- Parameters:
url(required);strategy(auto/default/botasaurus, defaultauto);limit(default25); optionalitems_selector - Payload:
items, plus totals / strategy fields when present - Empty items can still be
ok: true— follownext_step/guidance
inspect
Section titled “inspect”Diagnostics: final URL, status, scheme downgrade, rel=alternate feeds, surface category, admission drops.
- Parameters:
url(required);strategy(defaultauto) - Follow
next_step— oftenreconwhen alternates warrant it, orscrape/capture
Curation verdict and native_feed preference (BUILD / DEFER / DROP).
- Parameters:
url(required);strategy(defaultauto)
capture
Section titled “capture”Derive a reusable YAML draft (payload.yaml). Same serializer as CLI html2rss capture. Catalog feeds still need directory.topics and explicit channel title / url.
- Parameters:
url(required);strategy;items_selector;force(skip native feed detection);topics(array of directory topics);title;summary;enhance(force on or off);limit;max_redirects;max_requests - Typical
next_step:testorinspect
validate
Section titled “validate”Schema-only check against html2rss://schema. Exactly one of config or yaml.
- Success
next_stepis usuallytest - Failure returns
isErrorwithpayload.issues, an array of{ path, code, message, expected, actual }.pathis an array of keys.codeis one ofmissing_key,type_mismatch,unknown_value,invalid_value,constraint,parse.
Schema validation plus live extraction.
- Parameters: exactly one of
configoryaml;min_items(default1);strict_quality(defaultfalse);compare_enhance(defaultfalse);strategy - Success
next_stepisapply - A schema failure returns the same issue shape as
validate, underpayload.validation_issues, andnext_stepisvalidate. Any other failure points back tocapture - Payload includes
sample_items,items, timing,failure_kindandquality_reportwhen present - The MCP tool does not expose the Ruby
sample_limitoption; it uses the default of 3
Ship gate: build RSS from a config. Required url plus exactly one of config or yaml.
- Payload:
rss,item_count,quality_report isErrorwhen zero items;next_stepis theninspect- A missing
channel.urlis filled fromurl
Batch trio
Section titled “Batch trio”| Tool | Job |
|---|---|
batch_scrape |
Parallel scrape with per-URL isolation |
batch_inspect |
Parallel inspect |
batch_recon |
Parallel recon |
All three take urls (1 to 25), strategy and concurrency (worker threads, 1..10, default 5). batch_scrape also takes limit (default 10 per URL).
Resources
Section titled “Resources”| URI | Description |
|---|---|
html2rss://schema |
Feed config JSON Schema |
html2rss://extractors |
Extractor names |
html2rss://strategies |
Published strategy names: auto, default, httpx, botasaurus; prefer auto |
html2rss://runtime |
version, mcp_contract_version (currently 4), catalog_fingerprint, tools, botasaurus_configured, response_cache_ttl (null when off) — never the scraper URL |
validate / apply reject strategy: local_file and request.local_file_path. Use CLI --input for fixtures.
Prompts
Section titled “Prompts”| Name | Flow |
|---|---|
scrape-webpage |
One scrape call; inspect only if weak |
capture-feed-config |
capture → test → apply (catalog rewrite when targeting html2rss-configs) |
Response cache
Section titled “Response cache”The MCP process is long-lived, so an agent that runs inspect, capture, validate and test on one URL should not refetch it. The server caches initial page fetches in memory.
- On by default, 300 seconds. Set
HTML2RSS_RESPONSE_CACHE_TTL=<seconds>on the MCP process to change it. - Disable it with
0,offorfalse. An unusable value logs a warning and falls back to 300. - Only initial 2xx fetches are cached. Follow-up requests and block pages always hit the network.
- Memory is bounded to 32 entries and 32 MiB of bodies; the oldest entry goes first.
- To force a refetch, wait out the TTL or restart with the cache off.
- The cache is an MCP server setting. The Ruby library and the CLI do not cache by default.
Client setup
Section titled “Client setup”See AI Agent Workflows for Cursor / Claude Desktop mcp.json examples and the html2rss-config skill.
