Command line
Call any Remote API method from a shell script with lightair call, or run Lightair's MCP server over stdio with lightair mcp, on macOS and Windows.
In short
lightair call <method> [params]makes one call to the running Lightair and prints the result as JSON.lightair mcpis Lightair's MCP server on stdin and stdout, for agents that start their tools as programs.- Both read the Remote API password from the system's credential store, so you never type it.
- The program is
/Applications/Lightair.app/Contents/MacOS/lightairon a Mac andlightair.exein Lightair's folder on Windows.
The Lightair program has two commands for scripts and agents. Both talk to the Lightair that’s already running, through its Remote API on this computer.
Where the program is
Section titled “Where the program is”| Platform | Path |
|---|---|
| macOS | /Applications/Lightair.app/Contents/MacOS/lightair |
| Windows | C:\Program Files\Lightair\lightair.exe when installed for all users |
Settings › Remote API › Connect › AI agents (MCP) shows the path of the copy you’re running.
On a Mac, add an alias to your shell so the examples below work as written:
alias lightair="/Applications/Lightair.app/Contents/MacOS/lightair"Call a method
Section titled “Call a method”lightair call <method> [params as JSON]The method is any Remote API method; the parameters are one JSON object, in single quotes so the shell leaves it alone. Without parameters, {} is sent.
lightair call app.versionlightair call scene.switch '{"scene": "Main"}'lightair call object.update '{"object": "Webcam", "visible": false}'lightair call record.startThe result is printed on stdout as indented JSON. Use it with jq:
lightair call state.get | jq -r '.program.name'How it connects
Section titled “How it connects”- It connects to
ws://127.0.0.1:<port>/rpc, the port set in Settings › Remote API. TheLIGHTAIR_REMOTE_PORTenvironment variable overrides it. - When Ask for the password or Other devices on your network is on, it reads the password from the Keychain or Windows Credential Manager and sends it.
- It waits up to 60 seconds for the answer, and ignores any event that arrives first.
- Lightair must be running with Let other apps control Lightair on.
lightair calldoesn’t open it.
Exit codes
Section titled “Exit codes”| Code | Meaning |
|---|---|
0 |
The call worked. The result is on stdout |
1 |
The call failed. The error’s message is on stderr, for example “no scene Main”, or “Lightair isn’t running (…)” when nothing answers on the port |
2 |
Used wrongly: no method (“usage: lightair call |
if ! lightair call stream.start; then echo "Couldn't go live" >&2fiThe command line is the person’s own tool: going live and the other on-air actions don’t ask for confirmation, as they do for AI agents.
On Windows
Section titled “On Windows”lightair.exe is a windowed program, so a console doesn’t wait for it or show what it prints unless its output is captured. In PowerShell, capture it:
$lightair = "C:\Program Files\Lightair\lightair.exe"$result = & $lightair call record.start | Out-String$LASTEXITCODEOlder versions of PowerShell remove the double quotes inside an argument before the program sees them, so check that JSON parameters arrive intact.
Run the MCP server over stdio
Section titled “Run the MCP server over stdio”lightair mcplightair mcp reads MCP messages from stdin, one JSON message per line, and writes the answers, and any notifications for resources the agent subscribed to, to stdout, one per line. It passes them to the running Lightair’s /mcp with the password from the credential store. You don’t run it yourself: an agent starts it. For example, for Claude Code:
claude mcp add lightair -- "/Applications/Lightair.app/Contents/MacOS/lightair" mcpWhat it adds to the HTTP server:
- Lightair can be closed. It answers
initialize,ping, the lists andprompts/getby itself. On the first tool call it opens Lightair (on a Mac, in the background) and waits up to 40 seconds for the Remote API. If the Remote API is off in Settings, the call fails with “Lightair isn’t running (open it, and turn on Settings › Remote API)”. - Lightair can restart. If Lightair quits and starts again, it starts a new session with the agent’s own
initializeand makes its subscriptions again. - Questions can wait. A tool call that makes Lightair ask the person runs while other messages go on, and waits up to 150 seconds for its answer.
Everything else, the tools, resources, prompts and confirmations, is in MCP server.