MCP Server

SeaPortal runs as a Model Context Protocol server over JSON-RPC 2.0, line-delimited, on stdio:

terminal
seaportal mcp

No flags are accepted โ€” configuration flows through tool arguments. The server implements initialize, tools/list, and tools/call.

Client config

{
  "mcpServers": {
    "seaportal": {
      "command": "seaportal",
      "args": ["mcp"]
    }
  }
}

Tools

Each tool wraps an existing library entry point and returns its JSON-marshalled result as a single text content block.

fetch_url

Fetch a URL and return the extracted Markdown + metadata as JSON (the Result struct). Wraps FromURLWithOptions.

ArgumentTypeDescription
urlstringrequired โ€” URL to fetch
dedupebooleanEnable block dedup (default true)
fastbooleanBail early if a browser is needed
with_linksbooleanEmit discovered links
with_imagesbooleanEmit discovered images
with_tablesbooleanEmit structured tables
with_commentsbooleanEmit user comments
max_tokensintegerApproximate output token cap

fetch_snapshot

Build the accessibility-tree snapshot for a URL (HTTP fetch, then snapshot extraction). Wraps BuildSnapshotWithOptions.

ArgumentTypeDescription
urlstringrequired
filterstringinteractive to keep only links/buttons/inputs; empty for full tree
max_tokensintegerApproximate token cap
allow_internalbooleanAllow private/internal IP targets

parse_sitemap

Fetch and flatten a sitemap.xml (nested <sitemapindex> supported, .gz auto-decompressed). Returns a JSON array of {loc, lastmod, changefreq, priority}. Wraps FlattenSitemap.

ArgumentTypeDescription
urlstringrequired
max_depthintegerMax sitemap-index recursion depth (default 5)
max_urlsintegerStop after this many URLs (default 50000)
allow_internalbooleanAllow private/internal IP targets

parse_feed

Fetch and parse an RSS 2.0 / Atom 1.0 / JSON Feed 1.x URL into a unified {title, link, published, summary, author, guid} JSON array. Wraps ParseFeed.

ArgumentTypeDescription
urlstringrequired
max_itemsintegerStop after this many items (default 200)
allow_internalbooleanAllow private/internal IP targets

Errors

Tool-level failures return a successful JSON-RPC result with isError: true and the error message as text; handler panics are caught and returned the same way.