MCP Server
SeaPortal runs as a Model Context Protocol server over JSON-RPC 2.0, line-delimited, on stdio:
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.
| Argument | Type | Description |
|---|---|---|
url | string | required โ URL to fetch |
dedupe | boolean | Enable block dedup (default true) |
fast | boolean | Bail early if a browser is needed |
with_links | boolean | Emit discovered links |
with_images | boolean | Emit discovered images |
with_tables | boolean | Emit structured tables |
with_comments | boolean | Emit user comments |
max_tokens | integer | Approximate output token cap |
fetch_snapshot
Build the accessibility-tree snapshot for a URL (HTTP fetch, then snapshot extraction). Wraps BuildSnapshotWithOptions.
| Argument | Type | Description |
|---|---|---|
url | string | required |
filter | string | interactive to keep only links/buttons/inputs; empty for full tree |
max_tokens | integer | Approximate token cap |
allow_internal | boolean | Allow 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.
| Argument | Type | Description |
|---|---|---|
url | string | required |
max_depth | integer | Max sitemap-index recursion depth (default 5) |
max_urls | integer | Stop after this many URLs (default 50000) |
allow_internal | boolean | Allow 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.
| Argument | Type | Description |
|---|---|---|
url | string | required |
max_items | integer | Stop after this many items (default 200) |
allow_internal | boolean | Allow 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.