lirc-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
lirc-mcp
An MCP server that lets an AI agent use infrared devices on a Linux host: receive IR (e.g. learn a remote's buttons), send it, and record it to files.
It talks to the kernel's LIRC interface (/dev/lircN), so it works with any IR
device that has a kernel driver: USB transceivers such as the IR Toy / Irdroid
(ir_toy), Windows Media Center receivers (mceusb), GPIO IR on a Raspberry
Pi, and more. The only runtime dependency is the MCP Python SDK.
Safety model
Only named devices. The agent can use only the devices given with
--device; it cannot choose a path.Pinned devices. A device given as
/dev/lircNis bound at startup to what is there (see Pinning). Every open is then verified against sysfs before the device is used, and refused if it cannot be, so a re-plugged or renumbered node cannot redirect access.Receive-only by default. Sending needs
:sendon the device.Audit log.
--log FILEappends a JSON line per tool call (exceptlist_devices), including the timings sent. Keep it where the agent cannot write.Captures. Files are created only in
--capture-dir, never following symlinks or overwriting. The agent must not be able to write above it.Limits. Sizes, durations and repeats are capped (see
list_devices).One at a time. A second send or carrier measurement on a busy device is refused. Plain receiving is not limited, though a measurement may affect what it hears. Other programs using the device are not covered.
Revoking access means stopping the server.
Related MCP server: chameleon
Pinning
Given as | Found again by |
| vendor, product and serial, whatever its number becomes |
| the path, which must keep the same identity and place of attachment |
| the path, which must keep the same place of attachment |
| exactly what you wrote; give the serial to name one unit |
A path that stays a path is pinned for that run only: if the device moves (for instance to another USB port), restart the server. The server warns on stderr about such devices, and about a serial that cannot be written in a SPEC.
Requirements
Linux with a LIRC device node (
/dev/lircN) from a kernel IR driver. Check withlirc-mcp --scan, which also explains why a USB device has none.Read/write access to the node, usually by being in its group (
ls -l /dev/lirc0, oftenvideo) or through a udev rule (see below).Python 3.10 or newer.
If your user cannot open the node, a rule such as this gives it to the video
group:
echo 'SUBSYSTEM=="lirc", GROUP="video", MODE="0660"' |
sudo tee /etc/udev/rules.d/70-lirc.rules
sudo udevadm control --reload
sudo udevadm trigger --subsystem-match=lirc
sudo usermod -aG video "$USER" # then log in againRun it
With uv, no installation step is needed:
uvx --from git+https://github.com/laphone32/lirc-mcp lirc-mcp --scan
uvx --from git+https://github.com/laphone32/lirc-mcp lirc-mcp --device /dev/lirc0:sendPin a tag or commit (...lirc-mcp@v0.1.0) for code you run with device
access. With pip: pip install git+https://github.com/laphone32/lirc-mcp,
then run lirc-mcp.
lirc-mcp --device SPEC [--device SPEC ...] [--capture-dir DIR] [--log FILE]
lirc-mcp --resolve --device SPEC ... # check devices, print the pinned SPECs
lirc-mcp --scan # list USB LIRC devices (or why none)
lirc-mcp --versionSPEC is [ALIAS=]TARGET[:send], where TARGET is /dev/lircN or
usb:VID:PID[:SERIAL]. Examples: /dev/lirc0, /dev/lirc0:send,
tv=usb:04d8:f58b:352:send. The alias is what the agent sees; it defaults to
the USB product name. Each explicit alias may be used only once.
The parent of --capture-dir must already exist; the server refuses to start
if captures could not be saved there. For example, with an alias, captures and
an audit log:
uvx --from git+https://github.com/laphone32/lirc-mcp lirc-mcp \
--device tv=/dev/lirc0:send \
--capture-dir ~/ir-captures \
--log ~/.local/state/lirc-mcp/audit.jsonlClaude Code
claude mcp add ir -- uvx --from git+https://github.com/laphone32/lirc-mcp \
lirc-mcp --device /dev/lirc0:sendOther MCP clients
{
"mcpServers": {
"ir": {
"command": "uvx",
"args": ["--from", "git+https://github.com/laphone32/lirc-mcp",
"lirc-mcp", "--device", "/dev/lirc0:send"]
}
}
}Docker Sandboxes (sbx)
The server must run on the host, where the device is. Register it, then attach it to one sandbox only:
sbx mcp add ir --command uvx \
--args=--from --args=git+https://github.com/laphone32/lirc-mcp \
--args=lirc-mcp --args=--device --args=/dev/lirc0:send
sbx mcp load ir --sandbox my-sandbox
# later: sbx mcp unload ir --sandbox my-sandbox && sbx mcp rm irTo use capture, also pass --args=--capture-dir --args=DIR, where DIR is in
a folder shared with the sandbox at the same path.
Tools
All tools return structured results.
Tool | What it does |
| The allowed devices: presence, USB identity, kernel features, receive settings, whether sending is allowed; the limits and the capture directory. |
| Waits for one IR burst (e.g. a button press) and returns its timings in µs (pulse, space, ..., pulse), the same as |
| Transmits a burst given as |
| Records bursts for up to 60 s into a new file in |
ir_receive, capture and ir_send stop promptly when the client cancels the
call.
Audit log
With --log FILE every call except list_devices appends a line such as:
{"time": "2026-12-04T10:20:30.123+01:00", "event": "ir_send", "device": "tv", "timings_us": [9000, 4500, 560], "ir_ctl": null, "carrier_hz": null, "duty_cycle": 0, "repeat": 0, "repeat_gap_us": 40000, "ok": true, "result": {"values": 3, "duration_us": 14060, "carrier_hz": 38000, "...": "..."}}The server refuses to start if the log cannot be created.
Using the LIRC code in your own app
lirc_mcp.lirc_dev uses only the standard library: info(), Receiver
(bursts as µs lists), send(), parse_timings() and format_timings().
Development
uv run --extra dev pytest # tests, against a fake LIRC device
uv run --extra dev ruff check .
uv run --extra dev ruff format --check .
uv run --extra dev black --check .
curl -fsSL https://google.github.io/styleguide/pylintrc -o .pylintrc
uv run --extra dev pylint src tests # Google style, as in CITests marked hw use a real kernel device, e.g. the kernel's loopback device,
which receives what it sends:
sudo modprobe rc-loopback # adds a /dev/lircN
LIRC_MCP_TEST_DEVICE=/dev/lircN uv run --extra dev pytest -m hw
sudo modprobe -r rc-loopbackLicense
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Remote MCP access to user-authorized Linux, Windows and Intel Mac devices for AI assistants.
- DNS-DATA RemoteDeprecatedcom.dns-data
Connect AI assistants to authorized Windows and macOS devices for files, commands, and management.
Reach your own computers from any AI app: files, commands, screen and mouse, approvals and alerts.
Related MCP Servers
- FlicenseAqualityDmaintenanceAn MCP server that exposes a USB-connected Flipper Zero device as tools for controlling infrared devices. It enables listing, parsing, and transmitting IR signals from saved files and built-in universal remotes.10-
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to control and analyze RFID hardware through natural language: read, crack, emulate, and clone cards via MCP tools, with safety gates, offline dump analysis, and a host-side card library.1MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to capture, decode, and analyze signals from logic analyzers and measurement devices via sigrok-cli, supporting I2C, SPI, UART, CAN, and 100+ protocols.18MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to control Linux desktops and compositors, including Hyprland/Wayland window management, PipeWire audio routing, systemd diagnostics and self-healing, notifications, screenshots, and optional agent memory.MIT