Migrate remaining backends (boltzmann, meitner, higgs, ampere, riemann, broglie) from custom server.lua to packaged #2

Closed
opened 2026-04-20 09:48:46 +00:00 by marfrit · 3 comments
Owner

Today (2026-04-20) hertz-tools and tesla were migrated from hand-written /opt/lmcp/server.lua to the packaged /usr/share/lua/5.4/server.lua (v0.5.2) invoked directly by the systemd unit, so future apt/pacman upgrade automatically picks up new tools (e.g. shell_bg) without per-host patching.

Remaining backends still on custom server.lua (each in active use; swap cost: ~2 min downtime + smoke-test):

  • boltzmann — Arch/BredOS aarch64, Bearer auth, custom 6-tool server. Migration should preserve the token (/opt/lmcp/boltzmann.conf → unit env LMCP_TOKEN).
  • meitner — Debian trixie x86_64, Bearer auth, custom server with legacy cmd parameter (now accepts both cmd and command, see closed bug on DokuWiki 2f41f2d). Migration loses the legacy cmd alias — anything still sending cmd will break. Likely nothing does; verify first.
  • higgs — Debian trixie aarch64 (Pi CM5), no auth (LAN only).
  • ampere — Arch Linux ARM aarch64 (CoolPi GenBook), Bearer auth.
  • riemann — macOS (MacBook), git-clone install via scripts/lmcp-install-macos.sh, Bearer auth + LaunchAgent. macOS path differs from the Linux apt/pacman flow — migration here is: git pull the lmcp repo on the Mac, re-run the install script (which already uses packaged-style paths under $(brew --prefix)/share/lua/5.4/). Actually riemann may already match — double-check during migration.
  • broglie — Arch (LXC on data), no auth, dev-only. Deferred; lowest priority.

Per-host migration recipe

  1. sudo apt install --only-upgrade lmcp / sudo pacman -Syu lmcp (ensures v0.5.2+ is on disk).
  2. Back up custom /opt/lmcp/server.luaserver.lua.pre-package-<date>.bak.
  3. Rewrite /etc/systemd/system/lmcp.service:
    • ExecStart=/usr/bin/lua5.4 /usr/share/lua/5.4/server.lua
    • Environment=LMCP_NAME=<host>-tools
    • Environment=LMCP_TOKEN=<hex> (for Bearer backends)
    • Environment=LMCP_PORT=8080
  4. systemctl daemon-reload && systemctl restart lmcp.
  5. Smoke: curl -s http://127.0.0.1:8080/mcp -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' -H 'Content-Type: application/json' -H 'Authorization: Bearer <hex>' expecting 7 tools.

Caveats

  • Per-host customisations (cwd handling, special tools) disappear. hub-tools::remote_shell host=<X> command=... is the replacement for most of them.
  • Arch hosts need lua54 + lua54-socket (the default lua is 5.5); lmcp package depends on lua which pulls 5.4 aliases on most distros — verify per-host.

Priority

Low. Current custom servers work; this is a hygiene/upgrade-ergonomics migration. Do it opportunistically per host (e.g. when touching a host for another reason).

Today (2026-04-20) `hertz-tools` and `tesla` were migrated from hand-written `/opt/lmcp/server.lua` to the packaged `/usr/share/lua/5.4/server.lua` (v0.5.2) invoked directly by the systemd unit, so future `apt/pacman upgrade` automatically picks up new tools (e.g. `shell_bg`) without per-host patching. Remaining backends still on custom `server.lua` (each in active use; swap cost: ~2 min downtime + smoke-test): - **boltzmann** — Arch/BredOS aarch64, Bearer auth, custom 6-tool server. Migration should preserve the token (`/opt/lmcp/boltzmann.conf` → unit env `LMCP_TOKEN`). - **meitner** — Debian trixie x86_64, Bearer auth, custom server with legacy `cmd` parameter (now accepts both `cmd` and `command`, see closed bug on DokuWiki 2f41f2d). Migration loses the legacy `cmd` alias — anything still sending `cmd` will break. Likely nothing does; verify first. - **higgs** — Debian trixie aarch64 (Pi CM5), no auth (LAN only). - **ampere** — Arch Linux ARM aarch64 (CoolPi GenBook), Bearer auth. - **riemann** — macOS (MacBook), git-clone install via `scripts/lmcp-install-macos.sh`, Bearer auth + LaunchAgent. *macOS path differs from the Linux apt/pacman flow — migration here is: `git pull` the lmcp repo on the Mac, re-run the install script (which already uses packaged-style paths under `$(brew --prefix)/share/lua/5.4/`).* Actually riemann may already match — double-check during migration. - **broglie** — Arch (LXC on data), no auth, dev-only. Deferred; lowest priority. ## Per-host migration recipe 1. `sudo apt install --only-upgrade lmcp` / `sudo pacman -Syu lmcp` (ensures v0.5.2+ is on disk). 2. Back up custom `/opt/lmcp/server.lua` → `server.lua.pre-package-<date>.bak`. 3. Rewrite `/etc/systemd/system/lmcp.service`: - `ExecStart=/usr/bin/lua5.4 /usr/share/lua/5.4/server.lua` - `Environment=LMCP_NAME=<host>-tools` - `Environment=LMCP_TOKEN=<hex>` (for Bearer backends) - `Environment=LMCP_PORT=8080` 4. `systemctl daemon-reload && systemctl restart lmcp`. 5. Smoke: `curl -s http://127.0.0.1:8080/mcp -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' -H 'Content-Type: application/json' -H 'Authorization: Bearer <hex>'` expecting 7 tools. ## Caveats - Per-host customisations (cwd handling, special tools) disappear. `hub-tools::remote_shell host=<X> command=...` is the replacement for most of them. - Arch hosts need `lua54` + `lua54-socket` (the default `lua` is 5.5); `lmcp` package depends on `lua` which pulls 5.4 aliases on most distros — verify per-host. ## Priority Low. Current custom servers work; this is a hygiene/upgrade-ergonomics migration. Do it opportunistically per host (e.g. when touching a host for another reason).
Author
Owner

Progress audit + drive-by 2026-04-29:

Host State
boltzmann already migrated (~2026-04-24): unit ExecStart=/usr/bin/lua5.4 /usr/share/lua/5.4/server.lua, token in LMCP_TOKEN=, package lmcp 0.5.2-1 from packages.reauktion.de. /opt/lmcp/server.lua gone, only legacy boltzmann.conf remains as no-op.
riemann ran scripts/lmcp-install-macos.sh from a fresh clone — token preserved (existing /usr/local/etc/lmcp/token reused), .lua files refreshed from 2026-04-18/19 → 2026-04-29 (now v0.5.4), LaunchAgent reloaded, smoke-test green, shell_bg now in tools/list.
meitner offline (DHCP NXDOMAIN). Pending.
higgs offline (.vpn no-resolve). Pending — schedule for next VPN window.
ampere offline (expected — fleet laptop). Pending — pick up next bench session.
broglie still parked per "deferred; lowest priority" in OP.

Net: 4 of 6 effectively done (hertz + tesla from filing + now boltzmann + riemann). 3 hosts remain (meitner / higgs / ampere), all currently offline. Not closing — pickup when those three come online.

Will revisit on the next dynamic-loop wakeup if any of meitner/higgs/ampere pop up.

Progress audit + drive-by 2026-04-29: | Host | State | |------|-------| | **boltzmann** | already migrated (~2026-04-24): unit ExecStart=`/usr/bin/lua5.4 /usr/share/lua/5.4/server.lua`, token in `LMCP_TOKEN=`, package `lmcp 0.5.2-1` from packages.reauktion.de. `/opt/lmcp/server.lua` gone, only legacy `boltzmann.conf` remains as no-op. ✅ | | **riemann** | ran `scripts/lmcp-install-macos.sh` from a fresh clone — token preserved (existing `/usr/local/etc/lmcp/token` reused), .lua files refreshed from 2026-04-18/19 → 2026-04-29 (now v0.5.4), LaunchAgent reloaded, smoke-test green, **`shell_bg` now in `tools/list`**. ✅ | | meitner | offline (DHCP NXDOMAIN). Pending. | | higgs | offline (.vpn no-resolve). Pending — schedule for next VPN window. | | ampere | offline (expected — fleet laptop). Pending — pick up next bench session. | | broglie | still parked per "deferred; lowest priority" in OP. | Net: 4 of 6 effectively done (hertz + tesla from filing + now boltzmann + riemann). 3 hosts remain (meitner / higgs / ampere), all currently offline. Not closing — pickup when those three come online. Will revisit on the next dynamic-loop wakeup if any of meitner/higgs/ampere pop up.
Author
Owner

Drive-by 2026-04-29 (#2 of N):

Host State
meitner migrated. Was lmcp 0.3.0-1 with custom lmcp-meitner.service ExecStart=/opt/lmcp/server.lua. Upgraded apt pkg → 0.5.4-1, retired lmcp-meitner.service, custom server.lua archived to server.lua.pre-package-2026-04-29.bak, new /etc/systemd/system/lmcp.service with packaged path + LMCP_NAME=meitner-tools + LMCP_TOKEN preserved from /opt/lmcp/lmcp.conf .godparticle. Smoke-test passes, 7 tools including shell_bg now present.
higgs still offline.
ampere still offline (fleet laptop).
broglie parked per OP.

Net: 4 of 6 done now (boltzmann + riemann + meitner + the original hertz/tesla pair). 2 hosts pending (higgs/ampere), both offline. Verified no cmd= calls in 30 days of meitner journal before dropping the legacy alias.

Drive-by 2026-04-29 (#2 of N): | Host | State | |------|-------| | **meitner** | migrated. Was lmcp 0.3.0-1 with custom `lmcp-meitner.service` ExecStart=`/opt/lmcp/server.lua`. Upgraded apt pkg → 0.5.4-1, retired `lmcp-meitner.service`, custom `server.lua` archived to `server.lua.pre-package-2026-04-29.bak`, new `/etc/systemd/system/lmcp.service` with packaged path + LMCP_NAME=`meitner-tools` + LMCP_TOKEN preserved from `/opt/lmcp/lmcp.conf` `.godparticle`. Smoke-test passes, 7 tools including **`shell_bg`** now present. ✅ | | higgs | still offline. | | ampere | still offline (fleet laptop). | | broglie | parked per OP. | Net: 4 of 6 done now (boltzmann + riemann + meitner + the original hertz/tesla pair). 2 hosts pending (higgs/ampere), both offline. Verified no `cmd=` calls in 30 days of meitner journal before dropping the legacy alias.
Author
Owner

Final round 2026-04-29 — all reachable hosts done.

Host State
ampere already on packaged paths from previous session; pkg bumped 0.5.2-1 → 0.5.4-1 from marfrit pacman repo (had to clear stale /var/lib/pacman/db.lck from an interrupted earlier session). Unit name still legacy lmcp-ampere.service not lmcp.service — cosmetic, deferred.
higgs full migration. Pkg lmcp 0.5.4-1 installed via apt (no prior pkg), custom /opt/lmcp/server.lua archived to server.lua.pre-package-2026-04-29.bak, unit rewritten with LMCP_PORT=8080/LMCP_NAME=higgs-tools (no Bearer token — LAN-only per OP), service active, shell_bg + edit_file now available.

All 6 actionable hosts on packaged: hertz, tesla, boltzmann, meitner, riemann, ampere, higgs. broglie remains parked per OP (deferred; lowest priority).

Closing as done.

Final round 2026-04-29 — all reachable hosts done. | Host | State | |------|-------| | **ampere** | already on packaged paths from previous session; pkg bumped 0.5.2-1 → 0.5.4-1 from marfrit pacman repo (had to clear stale `/var/lib/pacman/db.lck` from an interrupted earlier session). Unit name still legacy `lmcp-ampere.service` not `lmcp.service` — cosmetic, deferred. ✅ | | **higgs** | full migration. Pkg `lmcp 0.5.4-1` installed via apt (no prior pkg), custom `/opt/lmcp/server.lua` archived to `server.lua.pre-package-2026-04-29.bak`, unit rewritten with `LMCP_PORT=8080`/`LMCP_NAME=higgs-tools` (no Bearer token — LAN-only per OP), service active, `shell_bg` + `edit_file` now available. ✅ | All 6 actionable hosts on packaged: hertz, tesla, boltzmann, meitner, riemann, ampere, higgs. broglie remains parked per OP (deferred; lowest priority). Closing as done.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: marfrit/lmcp#2