Skip to main content
Glama

PixelBlaze AI

Create and iterate on LED patterns for a PixelBlaze controller using Claude Code. An MCP server connects Claude directly to your PixelBlaze so it can create, update, and manage patterns on the device.

The included patterns and design guidance (CLAUDE.md) are built for a 2D grid mapped as rows and columns — specifically an edge-lit acrylic depth display where each row is a separate physical layer. The Y axis represents discrete layers (not a smooth gradient), so patterns are designed to create strong visual contrast and coordinated animation across layers while running smooth effects within each layer.

This approach works well for any 2D PixelBlaze setup where one axis has significantly fewer pixels than the other (e.g. 8 rows x 32 columns), and where per-row visual differentiation matters more than smooth vertical blending.

Note: This project assumes the PixelBlaze's Mapper has already been configured correctly for your hardware. The mapper defines the 2D pixel map that tells PixelBlaze which physical LED corresponds to which (x, y) coordinate — patterns depend on this being set up before they can work properly.

Adapting for your hardware

The patterns auto-detect the grid dimensions at startup using mapPixels(), so they adapt to different sizes without code changes. To adapt the design guidance for a different display:

  1. Edit CLAUDE.md to describe your hardware — pixel layout, how light works physically, what effects look good and which don't

  2. Update the pixel map on your PixelBlaze to match your physical layout

  3. Ask Claude to help you adapt — for example:

"I have a 16x16 LED matrix mounted flat on a wall. Both axes have equal resolution and smooth blending. Update CLAUDE.md to reflect this — we don't need to treat Y as discrete layers, and effects should work as true 2D patterns."

"I have a cylindrical display with 12 rings of 30 LEDs each. X wraps around the cylinder and Y is the vertical axis. Update CLAUDE.md so patterns account for the X-axis wrapping and create effects that look good on a cylinder."

Related MCP server: io.github.jonnyblankinship/hue-ble-mcp

What's in the box

  • src/pixelblaze_mcp/ -- MCP server that exposes PixelBlaze controls (create/update/delete patterns, set brightness, read device info, etc.)

  • docs/pixelblaze/ -- Cached PixelBlaze language reference, available to Claude via the docs_get_api_reference tool

  • patterns/ -- Pattern JS files with documentation headers, tracked in git

  • CLAUDE.md -- Project instructions that Claude reads automatically (hardware context, design principles, coding conventions, pattern templates)

Setup

Prerequisites

1. Clone and install dependencies

git clone <repo-url>
cd pixelblaze-ai
uv sync

2. Create the MCP config

Create .mcp.json in the project root (this file is gitignored). This tells Claude Code how to connect to your PixelBlaze:

{
  "mcpServers": {
    "pixelblaze": {
      "type": "stdio",
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/pixelblaze-ai",
        "run",
        "python",
        "-m",
        "pixelblaze_mcp.server"
      ],
      "env": {
        "PIXELBLAZE_HOST": "192.168.2.97"
      }
    }
  }
}

Replace /path/to/pixelblaze-ai with the absolute path to this directory, and 192.168.2.97 with your PixelBlaze's IP.

3. Start Claude Code

cd pixelblaze-ai
claude

Claude will automatically pick up CLAUDE.md for project context and .mcp.json for the PixelBlaze connection.

Usage

Once Claude Code is running, you can ask it to create and modify patterns conversationally. Claude has access to the PixelBlaze API reference and can deploy patterns directly to the device.

Sample prompts

Creating patterns:

  • "Create a new pattern that looks like rain falling through the layers"

  • "Make a bouncing ball effect with configurable speed and size"

  • "Create an aurora effect using Perlin noise"

Modifying patterns:

  • "The heartbeat effect has too much dark time between beats, make it faster"

  • "Make the fire pattern symmetric -- both edges should be white-hot"

  • "Add more randomization to the comet so it doesn't repeat the same path"

Adjusting parameters:

  • "Increase the brightness of the fireflies effect"

  • "The aurora layers look too similar -- add more color contrast between them"

  • "Make the glitch effect more chaotic with panel blackouts and freezes"

Working with the display:

  • "List all patterns on the device"

  • "Switch to the plasma pattern"

  • "Set the display brightness to 50%"

Available MCP tools

Claude has access to these PixelBlaze tools:

Tool

Description

pixelblaze_create_pattern

Create and activate a new pattern

pixelblaze_update_pattern

Update an existing pattern's code

pixelblaze_delete_pattern

Remove a pattern from the device

pixelblaze_list_patterns

List all patterns on the device

pixelblaze_set_active_pattern

Switch to a specific pattern

pixelblaze_get_active_pattern

See which pattern is running

pixelblaze_get_pattern_code

Read a pattern's source code

pixelblaze_set_brightness

Set display brightness (0-1)

pixelblaze_get_controls

Read current slider/control values

pixelblaze_set_control

Set a slider/control value

pixelblaze_get_device_info

Get device status and config

docs_get_api_reference

Get the PixelBlaze language reference

Project structure

pixelblaze-ai/
  .mcp.json             # MCP server config (gitignored)
  CLAUDE.md             # Project instructions for Claude
  pyproject.toml        # Python project config
  src/pixelblaze_mcp/   # MCP server source
  docs/pixelblaze/      # Cached API reference
  patterns/             # Pattern JS files (deployed to device)

Available Tools

14 tools
docs_fetch_pageA

Fetch the text content of a PixelBlaze documentation page from the web.

Use this to look up specific pages on electromage.com/docs/ that aren't covered by the cached API reference, such as hardware-specific guides, GPIO, networking, or advanced topics.

Args: url: Full URL of the documentation page (e.g. https://electromage.com/docs/GPIO/).

Returns the page text content, or an error message if unreachable.

Inputs: url (required). Returns: result

docs_get_api_referenceA

Get the full PixelBlaze language reference (electromage.com/docs/language-reference).

This covers all built-in functions available when writing pattern code: render(index), beforeRender(delta), color functions (hsv, rgb), math/waveform functions (time, wave, triangle, sin, cos, etc.), array functions, 2D/3D rendering, UI controls (sliders, pickers), language features and limitations, variables, constants, and more.

Always call this before writing or editing any PixelBlaze pattern code.

Inputs: no named parameters. Returns: result

docs_get_mapper_referenceA

Get the PixelBlaze 2D/3D pixel mapping reference documentation.

This covers how to define spatial coordinates for pixels using the mapper, coordinate systems, and the render2D/render3D pattern functions.

Call this when working with multi-dimensional LED layouts or spatial effects.

Inputs: no named parameters. Returns: result

pixelblaze_create_patternA

Create a new pattern on the PixelBlaze with the given JavaScript code, then activate it.

Args: name: Display name for the new pattern. code: PixelBlaze JavaScript source code (must define a render(index) function).

Returns a dict with the new pattern's 'id' and 'name'.

Inputs: code (required), name (required). Returns: object

pixelblaze_delete_patternC

Delete a pattern from the PixelBlaze device.

Args: pattern_id: The ID of the pattern to delete.

Returns a confirmation message.

Inputs: pattern_id (required). Returns: result

pixelblaze_get_active_patternA

Get the currently active (running) pattern on the PixelBlaze.

Returns a dict with 'id' and 'name' of the active pattern.

Inputs: no named parameters. Returns: object

pixelblaze_get_controlsA

Get the UI controls for the currently active pattern.

Returns a list of control dicts, each with 'name', 'value', and 'type' keys. The controls correspond to exported slider/toggle/picker variables in the pattern code.

Inputs: no named parameters. Returns: result

pixelblaze_get_device_infoA

Get hardware and runtime information about the PixelBlaze device.

Returns a dict with keys: host, pixel_count, fps, uptime_s, version_major, version_minor.

Inputs: no named parameters. Returns: object

pixelblaze_get_pattern_codeA

Get the JavaScript source code of a pattern.

Args: pattern_id: The pattern ID to retrieve code for.

Returns the JavaScript source code string.

Inputs: pattern_id (required). Returns: result

pixelblaze_list_patternsA

List all patterns stored on the PixelBlaze device.

Returns a list of dicts with 'id' and 'name' keys.

Inputs: no named parameters. Returns: result

pixelblaze_set_active_patternA

Switch the PixelBlaze to run a specific pattern by its ID.

Args: pattern_id: The pattern ID to activate (from pixelblaze_list_patterns).

Returns a confirmation message.

Inputs: pattern_id (required). Returns: result

pixelblaze_set_brightnessA

Set the global brightness of the PixelBlaze.

Args: value: Brightness level from 0.0 (off) to 1.0 (full brightness).

Returns a confirmation message.

Inputs: value (required). Returns: result

pixelblaze_set_controlA

Set the value of a UI control (slider, toggle, etc.) on the active pattern.

Args: name: The control variable name (as it appears in pixelblaze_get_controls). value: Numeric value (sliders: 0.0–1.0; toggles: 0 or 1).

Returns a confirmation message.

Inputs: name (required), value (required). Returns: result

pixelblaze_update_patternA

Replace the JavaScript source code of an existing pattern.

Args: pattern_id: The ID of the pattern to update. code: New PixelBlaze JavaScript source code.

Returns a confirmation message.

Inputs: code (required), pattern_id (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 14 tools

    Disambiguation5/5

    Each tool targets a distinct action: documentation tools are separated by page type, and device tools cover unique operations (CRUD, controls, brightness, info) with no overlap.

    Naming Consistency5/5

    All tools follow a consistent snake_case format with the server name prefix (docs_ or pixelblaze_) followed by a verb and noun, making the purpose clear.

    Tool Count5/5

    14 tools is well-scoped for managing PixelBlaze patterns, controls, brightness, and documentation; neither too sparse nor overwhelming.

    Completeness5/5

    Covers full lifecycle of patterns (CRUD, activation), brightness, control manipulation, device info, and essential documentation references with no obvious gaps.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Enables programmatic control of Divoom Pixoo LED matrices to display layered pixel art, animations, and hardware-rendered scrolling text. Users can compose complex visual scenes, push images, and manage device settings like brightness and channels through an LLM.
      8
      213 npm
      11
      Apache 2.0
    • A
      license
      A
      quality
      B
      maintenance
      Enables Claude to control Philips Hue lights through a Hue Bridge on the local network, handling plain-language requests for on/off, brightness, color, scenes, looping effects, and whole-room power budgets. Fades and timers run on the bridge itself, and no Hue cloud account is required.
      9
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      Enables Claude to control Tuya and Smart Life Wi-Fi bulbs over the local network without cloud dependence, including power, brightness, color, presets, scenes, zones, and delayed or ambient lighting changes.
      10
      43 PyPI
      MIT