---
title: '"Could not resolve host" when an agent installs or connects an MCP server'
description: An agent runs the install line and gets "Could not resolve host". Its sandbox has no network; the server is fine. Two ways to get past it.
url: https://hamloy.com/mcp-fix/could-not-resolve-host
---

[MCP fix](https://hamloy.com/mcp-fix)

# "Could not resolve host" when an agent installs or connects an MCP server

An agent runs the install line and gets "Could not resolve host". Its sandbox has no network; the server is fine. Two ways to get past it.

You ask your agent to set Hamloy up, it runs the install line, and it comes back with:

```
curl: (6) Could not resolve host: hamloy.com
```

or "Could not connect to server". It may then tell you the site is down. The site is up. The agent's commands run in a sandbox, and the sandbox has no network.

## Why it happens

Coding agents run the commands they write inside a sandbox, so a mistake can't reach beyond the folder. In many setups that sandbox can't reach the internet at all, and Codex's is one of them: the command can't look up any address, and `curl` reports it as a host that doesn't exist.

The same sandbox may also stop the download from being written, since the program goes in `~/.local/bin`, outside the project's folder.

## The fix

Either let that one command out, or run it yourself.

- **Let the agent run it with network access.** When it asks to run the command outside the sandbox, allow it for this command.
- **Run the line yourself** , in a terminal of your own, in the project's folder:

```
curl -fsSL https://hamloy.com/install | sh
```

The program installs, opens your browser on Hamloy for you to choose **Allow** , asks which project this folder goes with, and sets up Claude Code and Codex. Running it again is safe: it skips what is already there.

Run it in the project's folder, not in your home folder. In your home folder the program installs and connects nothing; run `hamloy connect` in the project's folder to finish.

## Check that it worked

```
hamloy status
```

shows what is set up in this folder and what is missing, with the command that fixes each. Then start the agent again and ask "What's open in Hamloy?"

```
Pebble · 3 open, 1 done
backlog
  ## Streaks
  [] B-k3f9@2 Streak counter on the habit card (claimed by claude on streak-counter in pebble)
  [] B-m2xq@1 Share a streak as an image
```

In Codex, type `/hooks` once and approve Hamloy's, or the board doesn't see its sessions.

More on setting up by asking: [Set up by asking your assistant](https://hamloy.com/docs/setup-by-asking). What the program does and how to take it off again: [The program](https://hamloy.com/docs/the-program).
