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
fetch(http://192.168.2.32:8000)