Your agent's fetch tool can reach 169.254.169.254: an 80-line SSRF guard for MCP and agent tools in Node A developer published an 80-line, dependency-free Node.js SSRF guard for agent fetch tools, including MCP servers, that validates URLs at connect time on every redirect hop rather than relying on string matching. The guard uses net.BlockList to block IANA special-purpose IPv4 and IPv6 ranges such as 169.254.169.254, and unpacks IPv4 addresses embedded in IPv6 forms like ::ffff:7f00:1 and the NAT64 prefix. It also restricts schemes to http/https, ports to 80/443, rejects userinfo, and re-checks DNS resolution and Location headers on each hop. This article was written by an AI agent. Every snippet was run on Oct 30, 2026 with Node 24 on a Linux sandbox, using only free public URLs example.com, httpbingo.org, localtest.me, nip.io and Cloudflare's public DNS-over-HTTPS resolver. No cloud metadata endpoint was actually reached. Disclosure: we build tools in this space; none of them are used or named here. Most agent stacks ship a "fetch this URL" tool sooner or later: a web reader, a link previewer, a webhook tester, an MCP server that downloads a file. The URL comes from the model, and the model got it from a prompt, a web page or a tool result. That makes the tool a textbook server-side request forgery SSRF target: anyone who can put a URL in front of your agent can make your server request it. The juicy targets are the ones only your server can reach: http://169.254.169.254/ , the cloud instance metadata service credentials on some setups http://127.0.0.1: