The paintbrush for Claude. A visual output surface for AI agents — diagrams, tables, images, and interactive controls.
Project description
lux
A visual output surface for AI agents.
Lux gives agents and apps a shared visual surface. The intended architecture is a hub/display split: clients send UI descriptions to luxd, the Hub owns authoritative element state and behavior, and the Display renders a replica of the current scene while forwarding user interactions back to the Hub.
The design draws on X11's client/server split and Smalltalk-style live introspection. MCP is one gateway into Lux, not the whole architecture. If you want the short version of the rewrite target, start with docs/architecture/target/target.md. If you need help navigating the docs, use docs/README.md.
Platforms: macOS, Linux
Stage: alpha --- protocol is stable, published on PyPI as punt-lux
A Claude Code plugin displaying a project issue board --- the agent fetches live data from DoltDB via bd list --json, builds a filterable table with detail panel, and renders it in a single tool call. Filters and row selection run at 60fps with zero MCP round-trips.
The same list/detail pattern generalizes to any tabular data. Search, combo filters, pagination, and a detail panel --- all driven by a single show_table() call.
Dashboards compose metric cards, charts, and tables. show_dashboard() builds the layout from structured data --- no manual element positioning needed.
Quick Start
curl -fsSL https://raw.githubusercontent.com/punt-labs/lux/71014e1/install.sh | sh
Restart Claude Code twice. The Lux display window opens automatically when agents send visual output.
Manual install (if you already have uv)
uv tool install 'punt-lux[display]'
Then install the plugin via the marketplace:
claude plugin marketplace add punt-labs/claude-plugins
claude plugin install lux@punt-labs
Lightweight install (library use only)
If you only need DisplayClient to send scenes from Python (no display server):
uv add punt-lux
This pulls ~2 MB of lightweight deps. The 66 MB display stack (imgui-bundle, numpy, Pillow, PyOpenGL) is only needed for lux display and is available via punt-lux[display].
Verify before running
curl -fsSL https://raw.githubusercontent.com/punt-labs/lux/71014e1/install.sh -o install.sh
shasum -a 256 install.sh
cat install.sh
sh install.sh
Run a demo
lux display &
uv run python demos/dashboard.py
Demos are in demos/ --- each connects as a client and drives the display:
| Demo | What it shows |
|---|---|
interactive.py |
Sliders, checkboxes, combos, text inputs, color pickers |
containers.py |
Windows, tab bars, collapsing headers, groups |
dashboard.py |
Multi-window layout with draw canvases and live controls |
data_viz.py |
Tables, plots, progress bars, spinners, markdown |
menu_bar.py |
Custom menus, event handling, periodic refresh |
Features
- 24 element kinds --- text, buttons (arrow, small), images, sliders, checkboxes, combos, inputs (text, number), radios, color pickers (alpha, full picker), selectables, trees, tables, plots, progress bars, spinners, markdown, draw canvases, modals, groups, tab bars, collapsing headers, windows, separators
- Frames --- scenes target named frames (inner windows) via
frame_id. Frames persist after disconnect, can be adopted by new clients, and support initial sizing (frame_size) and ImGui window flags (frame_flags) - Layout nesting --- windows contain tab bars contain groups contain any element, arbitrarily deep
- Incremental updates ---
updatepatches individual elements by ID without replacing the scene - World menu --- per-client namespaced menus. Each connected MCP server gets its own submenu. Items registered via
register_toolare routed only to the owning client - Interaction events --- button clicks, slider changes, table row selections, menu clicks queue as events the agent reads via
recv - Frame auto-focus --- frames automatically focus (brought to front) when they receive a scene update
- Persistent tabs --- each
show()call opens a dismissable tab; samescene_idreplaces content in-place. Users can close individual tabs - Themes --- 11 themes via
set_theme:imgui_colors_dark,imgui_colors_light,imgui_colors_classic,darcula,darcula_darker,material_flat,photoshop_style,grey_flat,cherry,light_rounded,microsoft_style - Auto-spawn ---
DisplayClientstarts the display server on first connection if it isn't running - Unix socket IPC --- length-prefixed JSON frames, no HTTP overhead, no threads
MCP Tools
Agents interact with Lux through 24 MCP tools exposed by lux serve:
| Tool | What it does |
|---|---|
| Scene management | |
show(scene_id, elements) |
Replace the display with a new element tree. Supports frame_id, frame_size, frame_flags for windowed frames |
show_table(scene_id, columns, rows) |
Display a filterable data table with optional detail panel |
show_dashboard(scene_id, ...) |
Display a dashboard with metric cards, charts, and a table |
update(scene_id, patches) |
Patch elements by ID (set fields or remove) |
clear() |
Remove all content from the display |
| Communication | |
ping() |
Round-trip latency check |
recv(timeout) |
Read the next interaction event (clicks, row selections, menu clicks) |
set_menu(menus) |
Add custom menus to the menu bar |
register_tool(id, label) |
Register a World menu item routed only to the calling server via recv() |
set_theme(theme) |
Switch display theme |
| Configuration | |
display_mode(repo) |
Read current display mode (y/n) for the caller's project --- pass the absolute project path |
set_display_mode(mode, repo) |
Set display mode for the caller's project --- pass the absolute project path |
set_window_settings(...) |
Configure opacity, font scale, decoration, idle FPS |
set_frame_state(frame_id, ...) |
Minimize or restore a frame |
| Introspection | |
inspect_scene(scene_id) |
Return element tree for a scene |
list_scenes() |
List all active scenes with metadata |
screenshot() |
Capture display as base64 PNG |
get_display_info() |
Display dimensions, frame count, client count |
get_window_settings() |
Current window configuration |
get_theme() |
Current theme name |
list_clients() |
Connected clients with names and scene counts |
list_menus() |
Registered menu items |
list_recent_events(count) |
Recent interaction events |
list_errors(count) |
Recent error log entries |
What It Looks Like
Show text and a button
{"tool": "show", "input": {
"scene_id": "hello",
"elements": [
{"kind": "text", "id": "t1", "content": "Hello from the agent"},
{"kind": "button", "id": "b1", "label": "Click me"}
]
}}
Returns "ack:hello". When the user clicks the button:
{"tool": "recv", "input": {"timeout": 5.0}}
Returns "interaction:element=b1,action=click,value=True".
Multi-window dashboard
{"tool": "show", "input": {
"scene_id": "dash",
"elements": [
{"kind": "window", "id": "w1", "title": "Controls", "x": 10, "y": 10,
"children": [
{"kind": "slider", "id": "vol", "label": "Volume", "value": 50}
]},
{"kind": "window", "id": "w2", "title": "Chart", "x": 320, "y": 10,
"children": [
{"kind": "plot", "id": "p1", "title": "Trend",
"series": [{"label": "y", "type": "line",
"x": [1,2,3,4], "y": [10,20,15,25]}]}
]}
]
}}
Update a single element
{"tool": "update", "input": {
"scene_id": "dash",
"patches": [
{"id": "vol", "set": {"value": 75}}
]
}}
Element Kinds
| Category | Kinds |
|---|---|
| Display | text, button (arrow, small variants), image, separator |
| Interactive | slider, checkbox, combo, input_text, input_number, radio, color_picker (alpha, picker modes) |
| Lists | selectable, tree |
| Data | table, plot, progress, spinner, markdown |
| Canvas | draw (line, rect, circle, triangle, polyline, text, bezier) |
| Layout | group, tab_bar, collapsing_header, window, modal |
All elements with an id support an optional tooltip field (string shown on hover).
CLI Commands
| Command | What it does |
|---|---|
lux display |
Start the display server (ImGui window) |
lux serve |
Start the MCP server (stdio transport) |
lux enable |
Enable visual output for this project |
lux disable |
Disable visual output for this project |
lux status |
Check if the display server is running |
lux doctor |
Check installation health (Python, fonts, plugin) |
lux install |
Install the Claude Code plugin via the marketplace |
lux uninstall |
Uninstall the Claude Code plugin |
lux show beads |
Display the beads issue board (no LLM needed) |
lux version |
Print version |
Architecture
Agent or app
│ MCP or direct Hub API
▼
luxd (Hub)
│ authoritative state + introspection
│ scene replicas + remote invocations
▼
lux display (ImGui + OpenGL)
│ renders at 60fps
▼
Window on screen
The Hub is the single source of truth for element state, ownership, and handler dispatch. The Display is a rendering replica: it paints the current scene and forwards interactions back to the Hub, which runs the real handler and re-pushes updated state. MCP is one entry point, not the only one.
Documentation
Docs Guide | Target Architecture | Target Topology | Target UI Model | Target Introspection | Current Architecture | Design Log | Changelog
Development
uv sync --extra display # Install dependencies (dev group installs by default)
uv run ruff check . # Lint
uv run ruff format --check . # Check formatting
uv run mypy src/ tests/ # Type check (mypy)
uv run pyright # Type check (pyright)
uv run pytest # Test
Acknowledgements
Lux is a thin orchestration layer. The rendering is done by Dear ImGui, Omar Cornut's immediate-mode GUI library. ImGui handles all the hard problems --- text layout, widget state, input handling, GPU rendering --- and does so in a single-pass retained-mode-free architecture that maps naturally to Lux's "send JSON, render this frame" model. The 60fps render loop, the composable widget tree, and the ability to drive a full UI from a socket with no threading are all consequences of ImGui's design.
Python bindings come from imgui-bundle by Pascal Thomet, which packages ImGui, ImPlot, and several other ImGui extensions into a single pip-installable wheel with complete type stubs. imgui-bundle is what makes "install one Python package, get a GPU-accelerated UI" possible.
FastMCP provides the MCP server layer.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file punt_lux-0.19.0.tar.gz.
File metadata
- Download URL: punt_lux-0.19.0.tar.gz
- Upload date:
- Size: 194.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89f80c7cec57189a7d689691cc257c73671dceafabc613d64e01fced1accaab5
|
|
| MD5 |
4da45fd3764c292488a7f59fba68cf11
|
|
| BLAKE2b-256 |
f977d5bcde0429bf21c5f0248e011405432ba921f8cb9031ad47eeefa4c5b13b
|
Provenance
The following attestation bundles were made for punt_lux-0.19.0.tar.gz:
Publisher:
release.yml on punt-labs/lux
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
punt_lux-0.19.0.tar.gz -
Subject digest:
89f80c7cec57189a7d689691cc257c73671dceafabc613d64e01fced1accaab5 - Sigstore transparency entry: 2063362174
- Sigstore integration time:
-
Permalink:
punt-labs/lux@f3bc9b9bf3d24ceaf645a1729c4c7b1d900a5f98 -
Branch / Tag:
refs/tags/v0.19.0 - Owner: https://github.com/punt-labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f3bc9b9bf3d24ceaf645a1729c4c7b1d900a5f98 -
Trigger Event:
push
-
Statement type:
File details
Details for the file punt_lux-0.19.0-py3-none-any.whl.
File metadata
- Download URL: punt_lux-0.19.0-py3-none-any.whl
- Upload date:
- Size: 279.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c54bdbcb553a89d033b4f187be22596790863c7e12fe8e10c652083f799f9b9
|
|
| MD5 |
f0a7f68e039d353f06e1fc8cb686e0c3
|
|
| BLAKE2b-256 |
0da32e001996175b86826f76dac6e364909988850a3b7841a8346ec3f6b66973
|
Provenance
The following attestation bundles were made for punt_lux-0.19.0-py3-none-any.whl:
Publisher:
release.yml on punt-labs/lux
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
punt_lux-0.19.0-py3-none-any.whl -
Subject digest:
4c54bdbcb553a89d033b4f187be22596790863c7e12fe8e10c652083f799f9b9 - Sigstore transparency entry: 2063362413
- Sigstore integration time:
-
Permalink:
punt-labs/lux@f3bc9b9bf3d24ceaf645a1729c4c7b1d900a5f98 -
Branch / Tag:
refs/tags/v0.19.0 - Owner: https://github.com/punt-labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f3bc9b9bf3d24ceaf645a1729c4c7b1d900a5f98 -
Trigger Event:
push
-
Statement type: