Module: Html2rss::MCP::Runtime

Defined in:
lib/html2rss/mcp/runtime.rb

Overview

Runtime facts for the MCP process (env configuration, wire coercion).

Defined Under Namespace

Classes: Snapshot

Class Method Summary collapse

Class Method Details

.botasaurus_configured?Boolean

Returns whether Botasaurus transport is configured in this process.

Returns:

  • (Boolean)

    whether Botasaurus transport is configured in this process



21
22
23
# File 'lib/html2rss/mcp/runtime.rb', line 21

def botasaurus_configured?
  !ENV['BOTASAURUS_SCRAPER_URL'].to_s.strip.empty?
end

.coerce_strategy(strategy) ⇒ Symbol

Parameters:

  • strategy (String, Symbol, nil)

Returns:

  • (Symbol)


40
41
42
# File 'lib/html2rss/mcp/runtime.rb', line 40

def coerce_strategy(strategy)
  (strategy || :auto).to_sym
end

.snapshotSnapshot

Returns runtime capabilities and catalog identity for MCP clients.

Returns:

  • (Snapshot)

    runtime capabilities and catalog identity for MCP clients



27
28
29
30
31
32
33
34
35
# File 'lib/html2rss/mcp/runtime.rb', line 27

def snapshot
  Snapshot.new(
    version: Html2rss::VERSION,
    mcp_contract_version: Contract::MCP_CONTRACT_VERSION,
    catalog_fingerprint: Contract.catalog_fingerprint,
    tools: Contract.catalog_tools,
    botasaurus_configured: botasaurus_configured?
  )
end