# fetch — URL fetch & HTML-to-Markdown MCP connector for SCORPIOX BOT
`plugin_fetch` is a clean-room, zero-dependency **pure C99** rewrite of the
tool surface of
[`modelcontextprotocol/servers` → `src/fetch`](https://github.com/modelcontextprotocol/servers/tree/main/src/fetch)
plus the readability-shaped HTML→Markdown subset of
[`openclaw/openclaw` → `extensions/web-readability`](https://github.com/openclaw/openclaw),
reshaped as a **SCORPIOX BOT connector plugin**: one binary, four modes, no
shared-library requirements, and a security model you can actually read.
Give it a URL, get clean Markdown back — with the boilerplate gone and long
documents chunked so an agent can page through a page instead of flooding its
context window.
| | |
|---|---|
| Slug | `fetch` |
| Binary | `plugin_fetch` (`plugin_fetch.exe` on Windows) |
| `--meta` | `{"name":"fetch","desc":"URL to Markdown","kind":"mcp","mcp":true,"daemon":false,"menus":false,"verified":"live"}` |
| Category | `network` |
| Kind | MCP connector (`--mcp`, stdio JSON-RPC 2.0) |
| License | MIT (vendored yyjson MIT, mbedTLS 3.6.7 Apache-2.0) |
## Modes
| Mode | Trigger | Who calls it |
|---|---|---|
| Discovery | `--meta` / `SX_PLUGIN_META=1` | `scorpiox-bot-api` `/plugins`, `scorpiox-cli-botplugin`, `sx-connector-mcp` |
| MCP tool | `--mcp` | `sx-connector-mcp` (the single MCP router) or any MCP client over stdio |
| Control API | `?action=…` / `?format=json` | the plugin page (behind `require_node_auth()`) |
| Setup / tester page | `GET` | the browser, via the hub or the node directly |
```sh
./plugin_fetch --meta
printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | ./plugin_fetch --mcp
make && make test && make e2e
```
## The tool
One tool, `fetch`, with the same parameter shape as upstream so prompts and
agent code written against the Python reference work unchanged:
| Argument | Type | Default | Meaning |
|---|---|---|---|
| `url` | string | *required* | must be `http://` or `https://` |
| `max_length` | integer | `5000` | characters to return, hard cap `100000` |
| `start_index` | integer | `0` | continue a truncated document here |
| `raw` | boolean | `false` | return the original HTML instead of converting |
```sh
printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"fetch","arguments":{"url":"https://example.com","max_length":2000}}}' \
| ./plugin_fetch --mcp
```
Behaviour that matters when an agent is driving it:
* **Truncation is self-describing.** A chunk that ran out ends with
`
` | fenced block; `` inline → `` `code` `` |
| ``/``, ``/`` | `**…**`, `*…*` |
| `` | `> …` |
| `
` | `---` |
| `
` | `` |
| `` | pipe-separated rows |
| `&` ` ` `—` `—` `✓` | decoded (named + decimal + hex) |
| `