Developers · Run it yourself

Reach Mirli from another machine

Open Mirli to other machines with an access token, behind a proxy, or for other people.

This guide opens a Mirli server to other machines, such as a rented GPU or a box on your LAN, with an access token so that only you can use it. It also covers putting the server behind a reverse proxy and running it for other people.

Warning

Without a token, anyone who can reach the port can generate audio, read and delete your library, change settings and call every MCP tool. Set a token before you bind any address other than loopback.

Before you begin

  • Build Mirli as described in Run Mirli from source, or run the Docker image.
  • Plan how the connection is encrypted: a reverse proxy with a certificate, a tunnel such as Tailscale, or a GPU host's own HTTPS proxy. Over plain http://, the token crosses the network unencrypted.

Start the server with an access token

  1. Generate a random token and put it in MIRLI_API_TOKEN:

    Terminal
    export MIRLI_API_TOKEN="$(node -p "crypto.randomBytes(32).toString('hex')")"

    The token must be at least 16 characters. For Docker, pass it with -e MIRLI_API_TOKEN=<TOKEN>.

  2. Start the server on every interface:

    Terminal
    soundbox --host 0.0.0.0

    The startup banner shows Access token -> required.

  3. Open the server's address in a browser and paste the token on the sign-in screen. The browser stays signed in for 30 days.

  4. Optional: Connect an MCP client with the token in a header. For Claude Code:

    Terminal
    claude mcp add --transport http soundbox https://<HOST>/mcp \
      --header "Authorization: Bearer $MIRLI_API_TOKEN"

    Replace <HOST> with the name or address you reach the server by. If that is anything other than localhost or 127.0.0.1, also list it in MIRLI_ALLOWED_HOSTS, or /mcp answers 403.

What the token protects, and the rate limit on wrong tokens, are described in Access control.

Put Mirli behind a reverse proxy

  1. Start the server on loopback, listing the host name the proxy forwards in the Host header:

    Terminal
    MIRLI_ALLOWED_HOSTS=mirli.lan soundbox

    To accept that name on one port only, write mirli.lan:8443.

  2. Point Caddy or nginx at 127.0.0.1:17494, and have it forward the original Host header.

  3. If the proxy terminates HTTPS, have it send X-Forwarded-Proto: https, so the sign-in cookie is marked Secure.

Use an access token as well, or a proxy that authenticates (basic auth, Authelia or Authentik).

Open the dev servers to your network

Under npm run dev, the server stays on 127.0.0.1 and only Vite listens more widely.

  1. Start the dev servers with Vite listening on every interface, and list the name you reach it by:

    Terminal
    SOUNDBOX_DEV_HOST=0.0.0.0 SOUNDBOX_ALLOWED_HOSTS=mirli.lan npm run dev
  2. Open http://<HOST>:5174 from the other machine.

Behind a proxy on the same machine, set only SOUNDBOX_ALLOWED_HOSTS and point the proxy at 127.0.0.1:5174. For a LAN IP address, set only SOUNDBOX_DEV_HOST. The dev servers have no authentication.

Run Mirli for other people

When the people using Mirli don't own the machine it runs on, such as a shared server or a NAS:

  1. Set an access token, as in Start the server with an access token.
  2. Set MIRLI_SANDBOXED=1 in the server's environment.
  3. Restart the server.

The UI then offers nothing that touches the host, and settings that name a path, a device, an engine or a URL are locked. To turn off only some of this, set MIRLI_DISABLE instead. Both are described in Access control.

What's next