Omniscio

OmniscioGuidesWebFetch cannot fetch localhost

Claude Code: WebFetch cannot fetch localhost

Last checked against Anthropic's documentation on November 22, 2026. By the Omniscio team. Updated .

What is the exact message?

WebFetch cannot fetch localhost or other hostnames without a dot. To reach a local server, use Bash with curl instead.

Anthropic's entry names the two shapes that trigger it: http://localhost:3000, and a bare intranet name such as http://wiki/ — an internal company machine, named with a single word.

Before v2.1.268, these URLs came back as a generic Invalid URL error instead. Claude Code's changelog records the change: the error for localhost and other dotless hostnames was rewritten to explain why the URL is refused and to suggest curl.

What does it mean?

WebFetch is the tool Claude uses when it needs a web page's content. It refuses a hostname with no dot, which covers localhost and single-word intranet machine names.

The refusal happens before any request is sent, so the local server never saw the call. Nothing is wrong with the server and nothing needs restarting.

The second sentence is the fix: WebFetch cannot reach that address, but curl through the Bash tool can.

How do I fix it?

  1. Usually nothing. Anthropic's guidance is that the message points Claude at curl through the Bash tool, and the work continues that way.
  2. If Claude keeps reaching for WebFetch on a local address, remind it of the route the message names: read the page with curl through Bash.

Nothing on the server needs changing. WebFetch refuses on the hostname's shape, so an address such as http://localhost:3000 stays refused even while the server is running normally. The message is about how Claude reaches the server, not about the server being down or the page being wrong.

How do I know it worked?

  • Claude answers using the page's content instead of printing the WebFetch line again.
  • The answer matches what the local server serves.
  • No Invalid URL or WebFetch cannot fetch line appears in the turn.

Where these answers come from

Common questions

Why can't WebFetch fetch localhost?

WebFetch refuses a URL whose hostname has no dot, and it refuses before making any request. That covers localhost and bare intranet names.

How do I let Claude read a local server?

Through curl in the Bash tool, which is the route the message names.

Do I need to change anything when this appears?

Usually not. The message tells Claude the other way to reach the server, and the turn continues.

Why did WebFetch say Invalid URL instead?

On versions before v2.1.268 that was the generic form of this refusal. The current message explains the hostname rule and suggests curl.