test0r c5375b8a77 v1.2.1/#22: LMCP_HOST + LMCP_CONF env support
Adds two env vars to the packaged server.lua so hosts can switch
fully to the packaged entrypoint (combined with v1.2.0's tools.d/
plugin scan):

  LMCP_HOST — interface to bind on (default 0.0.0.0). Hosts that
              need .18-only binding (hertz) or similar single-NIC
              constraints set this. Threaded into lmcp.new opts.host.
  LMCP_CONF — path to a conf file with bearer-token entries (e.g.
              /opt/herding/etc/hertz-tools.conf). Read by lmcp.lua's
              read_conf; the `.godparticle` entry becomes the bearer
              token. Threaded into lmcp.new opts.conf.

Both unset → unchanged behavior (binds 0.0.0.0, no conf file).

Together with v1.2.0's tools.d/ scan, this lets a host like hertz
ship NO override server.lua — just an /opt/lmcp/tools.d/hertz.lua
plugin file and a systemd unit that points at the packaged
server.lua with LMCP_HOST=192.168.88.18 + LMCP_CONF=/opt/herding/
etc/hertz-tools.conf. apt upgrade then delivers all packaged
improvements automatically.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 23:33:30 +00:00
2026-04-14 19:58:40 +00:00

lmcp — Lua MCP server

Lightweight Model Context Protocol (MCP) server in pure Lua.

Runtime dependencies

  • Lua 5.1+
  • luasocket — needed for the TCP listener. Packaged as lua-socket on Arch/ALARM, lua-socket on Debian.

Files

File Role
lmcp.lua library: protocol handling, tool registration
server.lua HTTP server loop
json.lua vendored JSON encoder/decoder
example_server.lua sample server with a couple of tools

Install

Packaged as lmcp in the marfrit overlay repo:

# Arch / ALARM
sudo pacman -S lmcp

# Debian
sudo apt install lmcp

Files land under /usr/share/lua/5.4/ (Lua LUA_PATH). The example server installs as /usr/bin/lmcp-example.

S
Description
Lightweight MCP server in pure Lua. 2MB RSS. Zero deps beyond luasocket.
Readme 296 KiB
Languages
Lua 93.1%
Shell 6.2%
Batchfile 0.7%