Created an mcp server which calls another local server, trying to fetch this server using its local address (localhost:8000) but then I got this response from the mcp server:
{"type": "text", "text": "fetch failed"}
Solved the problem by replacing localhost with my actual local ip address (e.g http://192.168.2.32:8000).
Seems like there's a problem for ClaudeDesktop to call localhost addresses by security reasons.
you can get your local ip address on macOS/unix using this command:
ifconfig | grep "inet " | grep -v 127.0.0.1
Just to make it more clear:
// replace
fetch(localhost:8000)
// with (your local ip address)
fetch(http://192.168.2.32:8000)