Skip to main content
Reference · Information

senkani_web

Live Savings ~99% vs raw HTML

Render http:// / https:// pages with full JavaScript and return an AXTree-style Markdown extraction.

Signature

senkani_mcp.call(tool="senkani_web", args={...})

Behavior

Uses WKWebView + semantic DOM walk. Returns headings, links, buttons, form fields — not the raw HTML. SSRF guard: DNS-resolves the host via `getaddrinfo` before fetch and blocks any address in private/link-local/CGNAT/multicast ranges (including IPv4-mapped IPv6 and octal/hex IPv4). `decidePolicyFor` re-validates every redirect. A WKContentRuleList blocks subresource requests (<img>, <script>, <xhr>) to the same private ranges — a hostile page embedding <img src="http://169.254.169.254/..."> cannot reach cloud metadata through WebKit's auto-rendering. file:// scheme is NOT accepted — use senkani_read for local files.

Markdown-first content negotiation (W.2)

Sources/Core/ContentNegotiator.swift ships a three-tier ladder — Accept: text/markdown first, deterministic HTML→markdown transform on origin HTML, headless render only when both fail. MarkdownFirstFetcher.fetch(url:method:) takes auto (default), transform, or render. Every ContentNegotiationResult carries tier, tokensEstimate (the local-first analogue of x-markdown-tokens), originBytes, and needsRender. Wiring this ladder into senkani_web's argument plumbing is W.2-bis; the Core capability ships now so callers (and the Gemma-4-backed transformer adapter) can land independently.

Inputs

Name
Type
Default
Description
url
string
Absolute http:// or https:// URL. file:// rejected.
wait_ms
integer
2000
Ms to wait after load for JS to settle.
viewport
object
{{"w":1280,"h":800}}
Render viewport.

Output

Markdown-formatted AXTree: headings, text blocks, links, interactive controls.

Example

{"tool":"senkani_web","args":{"url":"https://docs.example.com"}}
SSRF guard applies to the main nav AND every subresource. Override for internal doc servers: `SENKANI_WEB_ALLOW_PRIVATE=on`. Bypassing this is on the operator.

See also

Source: Sources/MCPServer/Tools/WebTool.swift