pixoo-mcp-server
Divoom Pixoo LED control
Install
Install and configure the MCP from https://github.com/cyanheads/pixoo-mcp-server now. Follow the repository's installation instructions, ask me for anything you can't complete yourself, and verify its tools load.@cyanheads/pixoo-mcp-server
Render and push styled pixel art, text, dashboards, and animations to Divoom Pixoo LED displays on your local network via MCP. STDIO or Streamable HTTP.
Overview
Divoom Pixoo LED matrix displays on the local network, with the Pixoo-64 as the primary target and the 16 and 32 also supported. Render and push styled text, layered scenes, dashboards, animations, and HTML pages, or read and change device state. Runs as a stdio process or a local Streamable HTTP server.
Tools
| Tool | Description |
|---|---|
pixoo_display_text | Render styled text with themes, gradients, shadows, and auto-fit, static or animated, and push it |
pixoo_compose_scene | Compose layered scenes of text, icons, widgets, shapes, bitmaps, images, and sprites, static or animated |
pixoo_push_image | Resize a local or https image to the LED grid and push it, an animated GIF or WebP as an animation |
pixoo_render_html | Render an HTML page (CSS, SVG, Canvas, WebGL) in a headless browser at the panel size, still or animated frame by frame on a virtual clock, and push it |
pixoo_overlay_text | Set or clear a device-rendered scrolling text overlay |
pixoo_control_device | Read or change brightness, screen state, channel, or clock face |
pixoo_discover_devices | Find Pixoo devices and their LAN IPs through Divoom's cloud discovery |
pixoo_design_brief | Craft guidance for a design topic, with live device state and pre-filled next calls |
Resources
| Resource | Description |
|---|---|
pixoo://device/status | Live device snapshot: reachability, channel, brightness, screen state, display size |
pixoo://reference/themes | Theme and palette registry |
pixoo://reference/icons | Built-in icon names by category |
pixoo://reference/design-guide | Long-form craft guide for the 64px display |
Tools cover the same ground for tool-only clients: pixoo_control_device reads the live device state, and pixoo_design_brief returns craft guidance, theme names, and icon names.
Capability reference
pixoo_display_text tool
textas a string or an array of lines;theme(midnight,ember,claude,ice,neon,forest,mono) sets the background and default palette.styletakes apaletteramp (ember,ice,neon,fire,lavender,claude,mono) or a custom{ from, to }, plusshadow,outline, andscale1–8;positionis semantic or in pixels, andalignlines up multi-line textfont:standard(5×7) andcompact(3×5) draw printable ASCII plus° ← ↑ → ↓ ▲ ▼ ♥ · …, and any other character (€,’, a newline inside one string) as?, named with its code point and line index in the responsenotice;numeralsis an 11×18 digit face for clocks and readouts that draws 0–9, space, and: . - + / % ° ?, and text holding any other character fails validation, naming those characterslayout[]reports every fit decision as anaction(shrunk-to-compactwhen the text fits only in the compact font,scrollingwhen the returned frames scroll,noneotherwise), thefontused, and whether each line's boxfitson the panel; a single line too wide for the panel starts at x 0, cut at the right edge when it does not scroll. Single-line text falls back from the standard to the compact font unlessfontis set — never tonumerals— and text still too wide only scrolls undereffect: "auto"or"scroll"effect:scrollmakes one pass in up to 40 frames,autoscrolls only on overflow, andfloatandpulseloop over 20 frames;framesreports the count, and the animation pushes as one device animation
pixoo_compose_scene tool
- Up to 50
elementsdrawn back-to-front:text(in the same three fonts aspixoo_display_text),icon,rect,circle,line,progress,sparkline,bitmap,pixels,image(absolute path or https URL, with the samefinishaspixoo_push_image),sprite(absolute path). Thebackgroundis a solid color, av/h/rgradient, or atheme - Every element takes
opacity(each pixel lands at its own alpha ×opacity, so soft edges fade evenly) andblend:normal,add(glows and light beams),screen, ormultiply.lineand outlinecircletakestrokeWidthandantialias, and arectborder takesstrokeWidth, growing inward; either field on a shape that draws no stroke fails validation, naming it - Returns
layout[]: each element's placed box — for a wide or anti-aliased stroke, every pixel it draws — and whether itfitson the panel. Elements are placed as given and never refit, soactionis alwaysnone. An absoluteoutputpath saves the first frame as a PNG in place of thePIXOO_OUTPUT_DIRauto-save. Typed failures:asset_not_found,invalid_image(an image or sprite that was read but does not decode),invalid_color,unknown_icon,invalid_output_path - Animation through per-element
effectpresets (float,scroll-left,scroll-right,pulse,blink,twinkle,drift,fade-in,fade-out) or rawanimatekeyframes overdx,dy,opacity(numbers or numeric strings),visible(true/false), andcolor(interpolated through RGB on any element with acolor), each track holding at least one keyframe;frames1–800,speed10–2000 ms per frame (default 150). Past 40 frames the scene plays as one GIF the device downloads from this host, withspeedrounded to 10 ms. An element takeseffectoranimate, not both. An effect'samplitudesets the movement offloat,scroll-*, anddrift, and the 0–1 depth of thepulseandtwinkleopacity dip
pixoo_push_image tool
sourceis an absolute local path or an https URL, with downloads capped at 10 MB;fitiscontain(default),cover, orfill, andkernelisnearest(default, for pixel art),lanczos3(photos), ormitchell- A source that decodes as an animated GIF or WebP, whatever its file name, pushes as an animation of up to
maxFramesframes (1–800, default 40), sampled evenly from a longer source; past 40 frames it plays as one GIF the device downloads from this host. It plays at the source's total duration over the pushed frame count (150 ms when the source records no delays), or atspeed(10–2000 ms per frame);frames,sourceFrames, andspeedreport what was pushed finishreduces the image to a palette before the push: exactly one ofcolors(2–256, built from the image) orpalette(1–256 hex or named colors), plusdither(none,bayer4,floyd-steinberg). Transparent pixels stay unlit, and an animation'scolorspalette is shared by every frame- An unreadable path or URL fails as
asset_not_found, a source that is read but does not decode (a text file, an HTML page, a truncated download) fails asinvalid_image, and an unresolvablefinishpalette entry fails asinvalid_color; the preview is the exact frame the device receives, or a grid of an animation's frames
pixoo_render_html tool
-
htmlis a full document or a body fragment, up to 500,000 characters, laid out in a square viewport one CSS pixel per LED. The page is the panel:bodyhas no margin, scrollbars are hidden, and a page that paints no background renders on black (unlit). Its own CSS overrides each -
frames1–800 (default 1),speed10–2000 ms per frame (default 150). Each frame advances a virtual clock byspeed:window.render(t, frame), when the page defines it, runs before each capture witht = frame / frames, so periodic motion loops seamlessly;requestAnimationFrame,setTimeout/setInterval(4 ms floor for nested and repeating timers),Date(starting at the real time), andperformance.now()(0 at load) follow the same clock, and CSS animations are paused and seeked to it, so every frame is deterministic.requestIdleCallbackand iframes keep real time. Past 40 frames the page plays as one GIF the device downloads from this host, as onpixoo_compose_scene -
sampling:native(default) orsupersample, which renders at 8× and area-averages into each LED, smoothing transforms, text, SVG, and canvas. Chromium snaps a plain box's edges to whole CSS pixels before scaling, so a box atleft: 0.5pxstill lands on one LED; move it withtransformfor sub-pixel motion.finishtakes the same palette reduction aspixoo_push_image, applied before the preview -
Nothing loads from the network and workers are blocked.
pageErrorsreturns the page's uncaught errors,console.erroroutput, and blocked URLs (a blocked navigation asBlocked navigation: <url>): the first 20, each cut to 500 characters. Awindow.renderthat throws or rejects fails aspage_error, naming the frame; with no browser found, the call fails asbrowser_unavailablewith install steps (see Prerequisites);render_timeoutandrender_crashedcover a render past 30 s and a crashed browser or page.PIXOO_HTML_ENABLED=falseremoves the tool -
Every page gets a
pixooglobal before its own scripts run, for the crisp bitmap text, palettes, and icons that browser anti-aliasing would smear across LEDs:pixoo.context()is the 2D context of a transparent panel-size canvas fixed over the page.pixoo.text(ctx, text, x, y, { font, color, palette, scale, shadow, outline })drawspixoo_display_text's fonts.pixoo.icon(ctx, name, x, y, { w, h, color, palette })draws a registry icon.pixoo.palettesholds the 7 palettes, andpixoo.sizeis the panel size.
Text and icons drawn this way match
pixoo_compose_scenepixel for pixel in both sampling modes. An unknown palette, icon, or color throws naming it:<script> const ctx = pixoo.context(); pixoo.text(ctx, 'HELLO', 'center', 4, { palette: 'ember', scale: 2, shadow: true }); pixoo.icon(ctx, 'check-circle', 50, 50, { color: 'green' }); </script> -
pixoo_design_briefwith topichtmlcovers loops, the clock, sampling, thepixooruntime, and legibility at 64 px. A dot orbiting the panel once per loop:
{
"html": "<svg viewBox=\"0 0 64 64\" style=\"display:block;width:100vw;height:100vh\"><circle id=\"dot\" r=\"6\" fill=\"#ffb000\"/></svg><script>const dot = document.getElementById('dot'); window.render = (t) => { const a = 2 * Math.PI * t; dot.setAttribute('cx', 32 + 20 * Math.cos(a)); dot.setAttribute('cy', 32 + 20 * Math.sin(a)); };</script>",
"frames": 20,
"speed": 100,
"sampling": "supersample"
}
pixoo_overlay_text tool
mode: "set"or"clear"on one of 20 slots (id0–19).setrequirestextand takes a devicefontID (0–114),x/ywithinPIXOO_SIZE,color,speed(0–100),direction,align, andwidth- Returns
acknowledged,mode, andid. The device renders the overlay, so there is no preview, and it persists across channel switches until cleared
pixoo_control_device tool
- No params reads state; any of
brightness(0–100),screen(on/off),channel(faces/cloud/visualizer/custom), orclockFaceIdis applied before the read-back - Returns
reachable,channel,brightness,screenOn, andclockId(absent when unreachable) plusapplied; a failed setting is left out ofappliedand named in the notice instead of failing the call
pixoo_discover_devices tool
- Queries Divoom's cloud endpoint (
app.divoom-gz.com), so it needs internet access;timeoutMs1000–30000 (default 5000) - Returns each device's
name,id, andip; withPIXOO_IPset,configuredIpFoundsays whether it matched. An unreachable endpoint fails asdiscovery_failed
pixoo_design_brief tool
topic:text,scene,dashboard,animation,pixel-art,html, ortroubleshooting; works without a reachable device- Returns markdown
craftGuidance, a livedeviceContext,htmlRenderer(available,disabledwhenPIXOO_HTML_ENABLED=false, orno_browser, found without launching a browser),nextToolSuggestionsas{ toolName, reason, args }with arguments pre-filled for the topic and device state, plusavailableThemesandiconCategories
pixoo://device/status resource
- Uncached live read:
reachable,channel,brightness,screenOn,clockId,displaySize,configuredIp - Returns
reachable: falserather than an error when the device can't be reached orPIXOO_IPis unset
pixoo://reference/themes resource
- Every theme (background,
textPalette,accent,shadow) and palette (from/tostops), plusthemeNamesandpaletteNamesfor thethemeandpaletteparameters - Static registry, cached for 24h
pixoo://reference/icons resource
- Each icon's
name,category, andviewBox, plus abyCategorygrouping (weather, arrows, status, media); anamegoes in apixoo_compose_sceneicon element - Static registry, cached for 24h
pixoo://reference/design-guide resource
text/markdown: legibility floors, palette discipline, layout zones, animation budget, effect presets, pixel art rules, push pacing, and known device behaviors- The whole guide in one document, where
pixoo_design_briefreturns guidance per topic; cached for 24h
Features
Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.
Pixoo-specific:
- All composition happens on the host in an RGBA canvas pipeline (
@cyanheads/pixoo-toolkit); the device receives finished RGB frames - Pushes switch the device to the custom channel and run one at a time, spaced by
PIXOO_PUSH_MIN_INTERVAL_MS(default 1000) so rapid pushes don't freeze the device - Up to 40 animation frames push one request each; more frame pushes make the device unstable. Past 40,
pixoo_compose_scene,pixoo_push_image, andpixoo_render_html(up to 800 frames) serve one GIF from a one-shot listener on this host, which the device downloads and loops, so the device must be able to reach this host.pixoo_display_textstays within 40
Agent-friendly output:
- Preview on every render:
pixoo_display_text,pixoo_compose_scene,pixoo_push_image, andpixoo_render_htmlreturn the frame as an 8× upscaled PNG image block, pushed or not, sopush: falsechecks a design with no device attached. Animations preview as a grid of their frames (every frame while 1× tiles fit the 512 px sheet, an even sample past that), since GIF display varies across MCP clients; the GIF itself is saved toPIXOO_OUTPUT_DIRwhen set — an 8× preview GIF, or past 40 frames the panel-size GIF the device downloads - Layout transparency:
layout[]reports every renderer decision (font fallback, scrolling, and whether each box fits on the panel) so agents can refine a design - Device truth:
pushedreflects the device ACK (past 40 frames, the ACK of the play plus the device's request for the GIF, with the whole file handed to the OS to send; the device does not confirm receipt), and thedeviceStateread back after a push comes with a notice naming the fix when the render won't be visible (screen off, brightness ≤ 10, off the custom channel) - Renders survive failed pushes: on all four render tools, the typed error (
device_unreachable,device_http_error,device_rejected,gif_serve_failed,no_device_configured) carriesoutputFilespointing at the saved preview (thePIXOO_OUTPUT_DIRcopy, or a temp file when that is unset)
Getting started
Add the following to your MCP client configuration file, with PIXOO_IP set to your Pixoo's LAN address. pixoo_discover_devices finds it if you don't know it.
{
"mcpServers": {
"pixoo-mcp-server": {
"type": "stdio",
"command": "bunx",
"args": ["@cyanheads/pixoo-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info",
"PIXOO_IP": "192.168.1.50"
}
}
}
}
Or with npx (no Bun required):
{
"mcpServers": {
"pixoo-mcp-server": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@cyanheads/pixoo-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info",
"PIXOO_IP": "192.168.1.50"
}
}
}
}
Or with Docker:
{
"mcpServers": {
"pixoo-mcp-server": {
"type": "stdio",
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "MCP_TRANSPORT_TYPE=stdio",
"-e", "PIXOO_IP=192.168.1.50",
"-e", "PIXOO_SERVE_HOST=192.168.1.20",
"-e", "PIXOO_SERVE_PORT=8765",
"-p", "8765:8765",
"ghcr.io/cyanheads/pixoo-mcp-server:latest"
]
}
}
}
The device downloads an animation of more than 40 frames from this host, and on Docker's default bridge network the address routed to the device is the container's own, which the device can't reach. Set PIXOO_SERVE_HOST to the Docker host's LAN address and publish a fixed PIXOO_SERVE_PORT, as above; 40 frames or fewer need neither.
For Streamable HTTP, set the transport and start the server:
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 PIXOO_IP=192.168.1.50 bun run start:http
# Server listens at http://localhost:3010/mcp
Prerequisites
- Bun v1.4.0 or higher (or Node.js v24+).
- A Divoom Pixoo on the local network (Pixoo-64, Pixoo-32, or Pixoo-16).
- Optional, for the HTML renderer: chrome-headless-shell.
npx @puppeteer/browsers install chrome-headless-shell@stable --path ~/.cache/puppeteerinstalls it where the server looks by default. Installed anywhere else with--path <dir>, setPIXOO_BROWSER_PATHto the executable path the install prints. The server launches it headless, with no DevTools port, only when a render needs it.
Installation
- Clone the repository:
git clone https://github.com/cyanheads/pixoo-mcp-server.git
- Navigate into the directory:
cd pixoo-mcp-server
- Install dependencies:
bun install
- Configure environment:
cp .env.example .env
# edit .env and set PIXOO_IP
Configuration
| Variable | Description | Default |
|---|---|---|
PIXOO_IP | Device IP on the local network. Required for pushes, overlays, and device control; discovery, design briefs, and push: false renders work without it. | — |
PIXOO_SIZE | Display size in pixels: 16, 32, or 64. | 64 |
PIXOO_OUTPUT_DIR | Directory where render tools save preview PNG and GIF files. A relative path resolves against the directory the server was launched from, so the saved paths it reports are absolute. Unset, previews are returned only in the response. | — |
PIXOO_PUSH_MIN_INTERVAL_MS | Minimum gap between device pushes, in ms. | 1000 |
PIXOO_SERVE_HOST | Host advertised in the URL the device downloads an animation of more than 40 frames from, in place of the local address the OS routes to PIXOO_IP. The listener binds that routed address either way. Set it behind NAT or in a container. | — |
PIXOO_SERVE_PORT | Fixed port for that download's one-shot listener, for firewall rules and container port publishing. Unset, a free port per play. | — |
PIXOO_BROWSER_PATH | Browser executable for HTML rendering. When set, the only browser tried: a path that is not an executable file fails rather than falling back. A relative path resolves against the launch directory. Unset, the newest chrome-headless-shell in Puppeteer's cache (~/.cache/puppeteer). The Docker image ships no browser. | — |
PIXOO_HTML_ENABLED | Offer pixoo_render_html. false removes it from tools/list; a value that is not a boolean fails startup. | true |
MCP_TRANSPORT_TYPE | Transport: stdio or http. | stdio |
MCP_HTTP_PORT | HTTP server port. | 3010 |
MCP_SESSION_MODE | HTTP session mode: stateless, stateful, or auto. A value set here overrides the server's declared stateless. | stateless |
MCP_AUTH_MODE | Authentication: none, jwt, or oauth. | none |
MCP_LOG_LEVEL | Log level (debug, info, warning, error, etc.). | info |
LOGS_DIR | Directory for log files (Node.js only). | <project-root>/logs |
LOG_TOOL_FAILURE_PAYLOADS | Log each failed tool call's arguments and result, redacted by key name and capped at LOG_TOOL_FAILURE_PAYLOAD_MAX_BYTES (default 16384). A secret inside a free-form value is not redacted. | false |
OTEL_ENABLED | Enable OpenTelemetry. | false |
See .env.example for the full list of optional overrides.
Running the server
Local development
-
Build and run:
# One-time build bun run rebuild # Run the built server bun run start:stdio # or bun run start:http -
Run checks and tests:
bun run devcheck # Lint, format, typecheck, security bun run test # Vitest test suite bun run lint:mcp # Validate MCP definitions against spec # Real-browser suite for the HTML renderer (opt-in; launches the named browser) PIXOO_TEST_BROWSER_PATH=/path/to/chrome-headless-shell bun run test:browser
Docker
docker build -t pixoo-mcp-server .
docker run --rm -e PIXOO_IP=192.168.1.50 -p 3010:3010 \
-e PIXOO_SERVE_HOST=192.168.1.20 -e PIXOO_SERVE_PORT=8765 -p 8765:8765 \
pixoo-mcp-server
PIXOO_SERVE_HOST (the Docker host's LAN address) and the published PIXOO_SERVE_PORT let the device download animations of more than 40 frames from inside the container, as in the stdio configuration above.
The Dockerfile defaults to HTTP transport, stateless session mode, and logs to /var/log/pixoo-mcp-server. OpenTelemetry peer dependencies are installed by default; build with --build-arg OTEL_ENABLED=false to omit them.
Project structure
| Directory | Purpose |
|---|---|
src/index.ts | createApp() entry point: registers tools and resources and initializes the Pixoo service. |
src/config/ | Server-specific environment variable parsing and validation with Zod. |
src/mcp-server/tools/ | Tool definitions (*.tool.ts), the shared post-render push path, and the shared finish input schema. |
src/mcp-server/resources/ | Resource definitions (*.resource.ts). |
src/services/pixoo/ | PixooService: wraps @cyanheads/pixoo-toolkit with push pacing, result mapping, and device state reads. |
src/services/browser/ | BrowserRenderer: renders HTML in an isolated headless chrome-headless-shell, driven over the DevTools Protocol pipe, and captures it as a panel frame. |
src/renderer/ | Pure rendering pipeline with no device dependency: element renderers, styled-text engine, themes, icons, effect compiler, palette finishing, preview encoding, remote image fetch, and the virtual clock injected into HTML pages. |
tests/ | Unit and integration tests mirroring src/. |
Development guide
See CLAUDE.md/AGENTS.md for development guidelines and architectural rules. The short version:
- Handlers throw, framework catches — no
try/catchin tool logic - Use
ctx.logfor request-scoped logging,ctx.statefor tenant-scoped storage - The renderer (
src/renderer/) is pure — no device dependency, testable without hardware - All device calls go through
PixooService; everyPixooResultis checked — never assume a push succeeded
Contributing
Issues are welcome. Run checks and tests before submitting:
bun run devcheck
bun run test
License
Apache-2.0 — see LICENSE for details.