Install litra via Cargo
mainOn macOS, Linux, or Windows, you can install the litra crate using Rust's package manager, Cargo. Ensure Rust is installed on your machine first.
cargo install litrarepository·main·Indexed 41 days ago
https://github.com/timrogers/litra-rsA tool and Rust library for controlling Logitech Litra lighting devices (Glow, Beam, and Beam LX). It provides a command-line interface, a Model Context Protocol (MCP) server for AI agents, and a Rust crate for application integration. Version 3.3.0 supports power control, brightness (lumens/percentage), color temperature (Kelvin), and RGB backlight management for the Beam LX model.
On macOS, Linux, or Windows, you can install the litra crate using Rust's package manager, Cargo. Ensure Rust is installed on your machine first.
cargo install litraOn macOS or Linux, you can install the latest version of litra using Homebrew.
Note for older installations: If you installed via the timrogers/homebrew-tap before January 30, 2026, you should reinstall it from homebrew-core by running:
brew uninstall litra && brew install litra.
brew install litraYou can run litra mcp to start a Model Context Protocol (MCP) server, allowing AI agents (like Claude Desktop) to control your lights.
Add the following to your mcpServers configuration in the Claude App Config file:
{
"mcpServers": {
"litra": {
"command": "litra",
"args": [
"mcp"
]
}
}
}litra_devices: List devices.litra_on / litra_off / litra_toggle: Power control.litra_brightness / litra_brightness_up / litra_brightness_down: Brightness control (lumens or percentage).litra_temperature / litra_temperature_up / litra_temperature_down: Temperature control (Kelvin, multiples of 100).litra_back_on / litra_back_off / litra_back_toggle: Backlight power.litra_back_brightness / litra_back_brightness_up / litra_back_brightness_down: Backlight brightness (percentage).litra_back_color: Set backlight color (hex code) and optional zone (1-7).On Linux, you must configure udev permissions to allow non-root users to manage Litra devices.
video group:
sudo usermod -aG video $USER99-litra.rules file into /etc/udev/rules.d/.sudo udevadm control --reload-rules
sudo udevadm triggersudo usermod -aG video $USER
# After copying 99-litra.rules to /etc/udev/rules.d/
sudo udevadm control --reload-rules
sudo udevadm triggerOn macOS, Linux, or Windows, you can download the latest release directly from GitHub.
$PATH.litra on macOS/Linux or litra.exe on Windows.The library supports the following Logitech Litra models:
LitraGlow: Streaming light with TrueSoft.LitraBeam: LED streaming key light.LitraBeamLX: Dual-sided RGB streaming key light (supports back-side color/brightness controls).// Check if a device has a colorful back side
if device.device_type().has_back_side() {
// ...
}The LitraMcpServer implements the Model Context Protocol (MCP) to allow AI agents and other clients to control Litra hardware via standard input/output (stdio).
stdio for communication.tool_router to map incoming MCP tool calls to specific Rust handler functions.McpError and communicated back to the client as text content within a CallToolResult error block.LitraMcpServer::new(), served via .serve(stdio()), and enters a waiting state with .waiting().To run the MCP server, the handle_mcp_command() function must be called. This initializes tracing (logging to stderr) and starts the Tokio runtime to manage the asynchronous MCP service.
LITRA_DISABLE_UPDATE_CHECK environment variable.Most litra CLI commands allow you to target specific devices instead of all connected devices. You can use one of the following three methods to filter your target. Note that these options are mutually exclusive: you cannot use more than one at a time.
--serial-number (-s): Target a device by its unique serial number.--device-path (-p): Target a device by its system path (useful if the device lacks a serial number).--device-type (-t): Target all devices of a specific type. Supported types are glow, beam, or beam_lx.# Examples of targeting specific devices
litra on --serial-number "12345"
litra brightness --device-path "/dev/bus/usb/001/002"
litra off --device-type beamTo interact with Logitech Litra lights, you must first create a Litra context. This context manages the underlying HID API and provides methods to discover connected devices. Use Litra::new() to initialize the context and get_connected_devices() to retrieve an iterator of available Device objects. If you need to detect newly plugged-in devices, call refresh_connected_devices() on the context.
use litra::Litra;
let context = Litra::new().expect("Failed to initialize litra.");
for device in context.get_connected_devices() {
// Work with device...
}litra crate provides a public API for interacting with Litra devices directly from Rust code. For full API details, refer to the documentation on Docs.rs.To prevent the CLI from checking for new versions on GitHub, set the following environment variable:
LITRA_DISABLE_UPDATE_CHECK