Implementation:0xKoda WireMCP axios urlhaus fetch
| Knowledge Sources | |
|---|---|
| Domains | Security, Threat_Intelligence |
| Last Updated | 2026-10-28 00:00 GMT |
Overview
Concrete tool for fetching the URLhaus threat-intelligence blacklist provided by the axios HTTP client, invoked within the `check_threats` and `check_ip_threats` tool handlers.
Description
The axios URLhaus fetch pattern calls `axios.get('https://urlhaus.abuse.ch/downloads/text/')` to retrieve the URLhaus blacklist as a raw text body. URLhaus is a malicious URL/host feed maintained by abuse.ch. WireMCP downloads the full text dump and extracts IPv4 addresses from it via regex to build a set of known-malicious IPs. On fetch failure, the tool gracefully degrades to an empty array so the MCP tool still returns a response.
Usage
Use this pattern when you need to retrieve the URLhaus blacklist for IP intersection operations. The fetch is identical in both the `check_threats` (multi-IP) and `check_ip_threats` (single-IP) tools.
Code Reference
Source Location
- Repository: WireMCP
- File: index.js
- Lines: L208-214 (check_threats), L261-267 (check_ip_threats)
Signature
const urlhausUrl = 'https://urlhaus.abuse.ch/downloads/text/';
const response = await axios.get(urlhausUrl);
// response.data is the raw text body of the URLhaus blacklist
Import
const axios = require('axios');
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| urlhausUrl | string | No | Hardcoded to `https://urlhaus.abuse.ch/downloads/text/` |
Outputs
| Name | Type | Description |
|---|---|---|
| response | Object | `{ status, data }` — `data` is the raw text blacklist |
| (on failure) | string[] | Falls back to empty array `[]` |
Usage Examples
Fetch URLhaus Blacklist
const urlhausUrl = 'https://urlhaus.abuse.ch/downloads/text/';
let urlhausData;
try {
const response = await axios.get(urlhausUrl);
console.error(`URLhaus response status: ${response.status}`);
// response.data is raw text — one entry per line
} catch (e) {
console.error(`Failed to fetch URLhaus data: ${e.message}`);
urlhausData = [];
}
Fetch and Extract IPs
const response = await axios.get(urlhausUrl);
const ipRegex = /\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/;
// Extract unique IPv4 addresses from the blacklist text
const urlhausData = [...new Set(
response.data.split('\n')
.map(line => {
const match = line.match(ipRegex);
return match ? match[0] : null;
})
.filter(ip => ip)
)];