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
Generate a random token and put it in
MIRLI_API_TOKEN:Terminal export MIRLI_API_TOKEN="$(node -p "crypto.randomBytes(32).toString('hex')")"PowerShell $env: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>.Start the server on every interface:
Terminal soundbox --host 0.0.0.0The startup banner shows
Access token -> required.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.
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 thanlocalhostor127.0.0.1, also list it inMIRLI_ALLOWED_HOSTS, or/mcpanswers 403.
What the token protects, and the rate limit on wrong tokens, are described in Access control.
Put Mirli behind a reverse proxy
Start the server on loopback, listing the host name the proxy forwards in the
Hostheader:Terminal MIRLI_ALLOWED_HOSTS=mirli.lan soundboxTo accept that name on one port only, write
mirli.lan:8443.Point Caddy or nginx at
127.0.0.1:17494, and have it forward the originalHostheader.If the proxy terminates HTTPS, have it send
X-Forwarded-Proto: https, so the sign-in cookie is markedSecure.
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.
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 devOpen
http://<HOST>:5174from 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:
- Set an access token, as in Start the server with an access token.
- Set
MIRLI_SANDBOXED=1in the server's environment. - 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.