# Network Settings

How KuraDB chooses its HTTP port, when it mounts the remote MCP endpoint, and how clients discover the current URL.

## HTTP port

`config.json` currently has two supported properties:

```json
{
  "port": 8080,
  "remote": false
}
```

| Property | Type | Default | Rules |
|---|---|---|---|
| `port` | integer | `0` / omitted | Must be in the range 1–65535 when set through the CLI |
| `remote` | boolean | `false` / omitted | Mounts the MCP endpoint at `/mcp` when true |

Manage the value through KuraDB rather than editing JSON manually:

```bash
kura port set 8080
kura port clear
```

`port set` persists the value, stops a running daemon, and starts a new one; it starts the daemon even when none was running. `port clear` resets only `port` (the `remote` flag is kept) and takes effect after the next manual start.

When no port is pinned, KuraDB tries up to 10 random ports from 10000 through 65535. A pinned port that is already taken is not retried: the HTTP listener logs the error and does not start. Both fixed and random listeners bind only to `127.0.0.1`; the published URL uses `localhost`.

## Remote MCP endpoint

The MCP endpoint on the HTTP listener is opt-in:

```bash
kura remote enable
kura remote disable
```

Both commands persist the `remote` flag and restart the daemon only when one is running, because routes are mounted during startup. While the flag is false the daemon serves `/api/*` normally and answers 404 at `/mcp`. The stdio transport, `kura mcp`, ignores this setting entirely. Client setup for both transports is in [Connect an MCP Client](/mcp-server-connect).

## Endpoint discovery

After the listener is ready, KuraDB writes a URL to `~/.config/kuradb/endpoint`:

```bash
BASE="$(cat ~/.config/kuradb/endpoint)"
curl "$BASE/api/health"
```

The launcher waits up to 10 seconds for this file and prints the URL once it appears. Graceful shutdown removes it, so consumers should read it again after every restart.
