Problem
Invalid LIBTMUX_SAFETY values currently fall back to mutating. README also documents invalid values: read, read+send, and read+send+kill.
This can expose write tools when a user intends to restrict the server.
Minimal local reproduction
$ LIBTMUX_SAFETY=read uv run python - <<'PY'
import asyncio
from libtmux_mcp.server import build_mcp_server
async def main():
tools = await build_mcp_server().list_tools()
names = {tool.name for tool in tools}
print("send_keys visible:", "send_keys" in names)
print("kill_pane visible:", "kill_pane" in names)
asyncio.run(main())
PY
Expected today: send_keys visible: True.
Minimal fix
Fail closed.
Either:
- refuse startup on invalid
LIBTMUX_SAFETY, or
- fall back to
readonly.
Also fix README/server instructions to document only the actual values:
readonly
mutating
destructive
Acceptance criteria
LIBTMUX_SAFETY=read does not expose mutating tools.
- Invalid safety values produce a clear error or readonly-only surface.
- README, configuration docs, and server instructions use the same safety value names.
- Tests cover invalid safety configuration.
Problem
Invalid
LIBTMUX_SAFETYvalues currently fall back tomutating. README also documents invalid values:read,read+send, andread+send+kill.This can expose write tools when a user intends to restrict the server.
Minimal local reproduction
Expected today:
send_keys visible: True.Minimal fix
Fail closed.
Either:
LIBTMUX_SAFETY, orreadonly.Also fix README/server instructions to document only the actual values:
readonlymutatingdestructiveAcceptance criteria
LIBTMUX_SAFETY=readdoes not expose mutating tools.