Migrate ad-hoc fetch + web_search tools from ampere into lmcp package #22
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Observed
The
mcp__ampere-tools__fetchandmcp__ampere-tools__web_searchtools surface on ampere's lmcp endpoint as ad-hoc local additions (likely installed manually on ampere, not via the package). When ampere is powered down, the tools disappear from the fleet — they don't exist on any other host.Expected
Per the 9(+1)-phase loop closing rule (feedback_dev_process.md Phase 8): once a tool exists and is useful, it goes through
marfrit-packages→lmcp.deb→ available on every host with lmcp installed. Hosts shouldn't accumulate hacks that vanish on shutdown.Tasks
/opt/lmcp/*.luaextensions or a custom server.lua patch)tools.d/-style plugin so hosts can opt inapt-get upgradeSeverity
Low — workaround is to use Claude Code's built-in WebSearch tool (verified on 2026-05-18 toniebox-hack-server lookup). But it's a known-pattern violation worth closing for hygiene.
Investigation note (partial — ampere is down, can't audit live).
The packaged lmcp already includes
fetchandweb_searchas built-in tools inserver.lua— they shipped in v1.0.0-rc1 (April 2026, commitdeb73d1, issues #3 and #4) and are still present in v1.1.0 / v1.1.1. So tasks 1–3 of this issue are effectively done by the v1.0.0-rc1 release — the upstream migration already happened.Remaining work is entirely on the ampere side:
dpkg -l lmcpshowing, and does it have a redundant/opt/lmcp/server.luaoverride left over from before v1.0.0-rc1?apt update && apt install lmcp. The packaged/usr/share/lua/5.4/server.luawill already have fetch + web_search; no local override needed./opt/lmcp/server.luaoverride and let the packaged copy take effect.Blocker: ampere is a CoolPi GenBook RK3588 laptop with no remote-wake path (no WoL, no smart plug, no hypervisor
pct start). Needs a physical lid-open / power-button press to come up. Bringing it on briefly is enough —apt upgrade lmcp+rm /opt/lmcp/server.lua+systemctl restart lmcpfinishes the issue in under a minute once it's reachable.I'll wait for "ampere is up" then run the audit + cleanup in one go.
— claude-noether (paused, ampere offline)
Progress update — option 2 (compose) execution.
Took the "compose" path (vs. quick surgical hack) — now in flight:
Upstream (commits + tags shipped to gitea):
e05438f—tools.d/plugin scan in packaged server.lua. ScansLMCP_TOOLS_DIR(default/opt/lmcp/tools.don POSIX,%ProgramData%\lmcp\tools.don Windows) for*.luafiles. Each file invoked as a function receiving(server, run). Smoke-tested.c5375b8—LMCP_HOST+LMCP_CONFenv-var support, so hosts that need single-interface binding (hertz: .18-only) or conf-file auth drive the packaged entrypoint via systemd env instead of carrying an override.Combined, these let a host's local config be:
/etc/systemd/system/lmcp.service— points at packaged/usr/share/lua/5.4/server.lua, setsLMCP_HOST/LMCP_CONF/LMCP_TOOLS_DIR/opt/lmcp/tools.d/<host>.lua— only the genuine host-specifics, no copy-paste of packaged genericsPackaging (PR): marfrit/marfrit-packages#25 —
lmcp: 1.1.1 -> 1.2.1. Awaiting merge + CI publish.Hertz pre-staging (already done, dormant):
/opt/lmcp/tools.d/hertz.lua— 9756 bytes, 12 hertz-specific tools (lxc_exec/list, fritz, ping_host, network_status, wol_and_wait, pct_exec, ha_cli/api, mqtt_pub/sub, mediagrab). Syntax-verified. Won't activate until packaged server.lua v1.2.1 lands./opt/lmcp/CUTOVER-v1.2.1.md— atomic cutover script:pacman -Syu lmcp→ swap systemd unit → archive/opt/lmcp/server.lua→ restart → verify.After cutover,
tools/liston hertz-tools will show 21 tools (9 packaged + 12 hertz).fetchandweb_searchwill then be exposed via hertz-tools, closing the original symptom of this issue. Futureapt upgrade lmcpdeliveries land automatically — no override drift.Same pattern will apply to ampere when it's next powered on. Will reference this issue in the ampere migration commit.
Cutover executed on hertz 2026-05-18 by claude-noether. Verified:
apt upgrade/usr/share/lua/5.4/server.luawithLMCP_HOST=192.168.88.18,LMCP_CONF=/opt/herding/etc/hertz-tools.conf,LMCP_TOOLS_DIR=/opt/lmcp/tools.d/opt/lmcp/server.luaarchived to.pre-tools.d.bak.20260518tools/listshows 21 tools (9 packaged + 12 hertz via/opt/lmcp/tools.d/hertz.lua), zero missing on either sidefetch+web_searchnow exposed via hertz-tools (closes the original symptom)ampere migration deferred until next power-on. Same recipe applies:
apt upgrade lmcp→ rewrite systemd unit withLMCP_TOOLS_DIR=/opt/lmcp/tools.d→ drop/opt/lmcp/server.luaif present → restart.