otp_debug_mcp is an MCP server that lets an AI agent attach to a running Erlang/Elixir node as a hidden node and diagnose it with a recon-style playbook: memory, mailboxes, crash loops, slow calls, ports, ETS. It works the same for Erlang and Elixir node
The latest release targets embedded nodes, Nerves in particular. Some of it is useful for any BEAM device:
- 32-bit VMs. On a 32-bit VM (erlang:system_info(wordsize) = 4), ETS and heap sizes counted in words were 2× too big. They now use the target’s word size.
- Reaching a device without exposing distribution. OTP’s ssh daemon refuses ssh -L unless tcpip_tunnel_in is set. That option takes a fun(Host, Port), so you can allow exactly one port: the node’s distribution port, with the node listening on loopback only (inet_dist_use_interface, inet_dist_listen_min/max). On your side, -erl_epmd_port 9100 dials that port through the tunnel without epmd. The guide is docs/nerves.md ( otp_debug_mcp/docs/nerves.md at main · ayarodionov/otp_debug_mcp · GitHub ).
- In-memory logs. Nerves devices log to RingLogger’s buffer rather than to a file. recent_errors now reads it, including errors logged before anyone connected.
- A demo device to try it on, examples/nerves ( otp_debug_mcp/examples/nerves at main · ayarodionov/otp_debug_mcp · GitHub ): a release on a 32-bit ARM VM in Docker, reachable only over SSH, with a crash-looping driver and a backed-up mailbox to find.
Help wanted. It has only been tested on an emulated 32-bit ARM VM in Docker, not on real hardware. I would be very happy if anybody tried it on a real device (a Nerves board, or any embedded BEAM node) and reported what works and what doesn’t, here or in a GitHub issue.
- Release: Release v0.16.1 · ayarodionov/otp_debug_mcp · GitHub