490e688cc1
One lmcp server on a central host (typically hertz) that proxies
remote_* tools to every backend in a registry, with a clean SSH
fallback for hosts whose lmcp is temporarily down or not installed.
Tools: remote_list_hosts, remote_{shell,read_file,write_file,edit_file,
list_dir,search_files}. Each takes a `host` argument naming the target
in /opt/herding/etc/hub-backends.conf (or $LMCP_HUB_BACKENDS).
Lazy 30s health cache; `remote_list_hosts force=true` bypasses it.
Bearer auth on inbound (standard lmcp opts.conf / LMCP_TOKEN machinery);
backend Bearer tokens kept in the registry and forwarded per-call.
SSH fallback uses `ssh host 'bash -s' < local_script` — stdin-piped
script body is the canonical shell-escape-free technique. Covers
shell/read_file/write_file/list_dir/search_files. edit_file is lmcp-only
because the literal-match + uniqueness check is nontrivial to replicate
safely in shell.
Ships an example systemd unit and a commented backends.conf template
in examples/. No migration required for existing lmcp deployments —
hub.lua is additive alongside the existing server.lua.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
23 lines
1.3 KiB
Plaintext
23 lines
1.3 KiB
Plaintext
# lmcp hub backend registry.
|
|
#
|
|
# Format: whitespace-separated "name ssh_host lmcp_url token"
|
|
# Use "-" for not-applicable fields.
|
|
# - Missing ssh_host (col 2 = -): no ssh fallback available for this backend
|
|
# - Missing lmcp_url (col 3 = -): this backend is ssh-only
|
|
# - Missing token (col 4 = -): backend accepts unauth lmcp (LAN-only hosts)
|
|
#
|
|
# Lines starting with # are comments. Blank lines ignored.
|
|
#
|
|
# LXD-container caveat: if your hub lives on the LXD host and the backend is
|
|
# a sibling LXD container, Fritz DNS often caches a stale DHCP lease for the
|
|
# container's hostname. Hardcode the container IP here and update when it
|
|
# rotates, or wire the .lxd stub zone into systemd-resolved.
|
|
|
|
# name ssh_host lmcp_url token
|
|
# --- --- --- ---
|
|
# boltzmann boltzmann.fritz.box http://boltzmann.fritz.box:8080/mcp <64hex>
|
|
# tesla 192.168.88.67 http://192.168.88.67:8080/mcp -
|
|
# nc nc.reauktion.de http://nc.reauktion.de:8080/mcp <opaque>
|
|
# pve1 pve1.fritz.box http://pve1.fritz.box:8080/mcp <opaque>
|
|
# hertz - http://hertz.fritz.box:8080/mcp <opaque>
|