Skip to main content

Dreamer

Browser-based Arduino workbench — real AVR emulation, AI circuit agent, MCP-native.

React 19TypeScriptBunavr8jsarduino-cliAI SDKMCPWeb Serial
current — active development
Active Development

Dreamer_

Design circuits. Write code. Simulate everything.

A browser-based Arduino workbench that builds circuits on a virtual breadboard, compiles real Arduino C++ with arduino-cli, runs the resulting AVR bytecode in-browser via avr8js, and connects to real hardware over Web Serial — all driven by an AI agent that designs circuits and writes sketches. Exposes an MCP server so Claude Desktop / Cursor can drive the board directly.

React 19TypeScriptBunavr8jsarduino-cliVercel AI SDKMCPWeb Serial
agent_demo
// Overview

A complete Arduino workbench, in the browser.

Most Arduino simulators either fake the execution (string-matching pseudo-interpreters) or force a desktop install. Dreamer does neither: arduino-cli produces a real .hex from your sketch, avr8js runs it instruction-by-instruction in the browser, and an agent can design the surrounding circuit for you. The same tools are exposed as a CLI binary and as an MCP server.

BOARD01

Virtual Breadboard

30-row breadboard with power rails, supporting Uno, Nano, Mega 2560, and RPi Pico. Components snap to grid, connect via internal bus strips. Drag to reposition, R to rotate. Environment layer drives ray-cast sensors (HC-SR04) against draggable obstacles.

AVR02

Real Bytecode Emulation

Sketches are compiled by arduino-cli into the exact .hex an Uno would run, then executed cycle-by-cycle in-browser by avr8js. No transpiler, no approximation — every #include, interrupt, and library just works.

AI03

Agent-Driven Workbench

A Claude-powered agent (Sonnet + Haiku, routed by complexity) designs circuits via a typed DSL — validate_design dry-runs diagrams before apply_design commits. Reachable from the web UI, the dreamer CLI, or any MCP client.

overview_demo
// Features

What powers Dreamer

Six core systems, each with distinct technical requirements.

RUN

arduino-cli → avr8js Pipeline

Sketches are compiled by arduino-cli against the real avr-gcc toolchain and the resulting .hex is executed cycle-accurately in-browser by avr8js. Interrupts, timers, USART, ADC, PWM, and EEPROM all run on the emulated AVR — not a JS shim.

avr8jsarduino-cliAVR-8
AGT

DSL-First Circuit Agent

A Claude-powered agent writes circuits as a typed DreamerDiagram DSL (v1.3.x). validate_design dry-runs the diagram and apply_design commits it atomically. Request routing picks Sonnet for complex builds, Haiku for simple ones, with snapshot-pinned behavior per run.

Claude SonnetClaude HaikuAI SDKDSL
PERF

Peripheral Bus + Electrical DRC

Peripherals (servo, LCD, OLED, HC-SR04, DHT, IR) talk to avr8js via a typed peripheral bus. A static electrical analyzer (disjoint-set net resolver) runs on every edit to flag shorts, missing grounds, non-rail-distributed fanout, and overloaded supplies — a design-rule check, not SPICE.

Peripheral BusDRCNet Resolver
MCP

Model Context Protocol Server

The `dreamer mcp` subcommand speaks MCP over stdio so any MCP client — Claude Desktop, Cursor, IDE plugins — can call validate_design / apply_design / update_sketch / analyze_power_budget and read project resources without routing through the chat UI.

MCP SDKstdioTool Protocol
I/O

Audio, Serial, Hardware Bridge

tone() emits real Web Audio square waves. The Serial Monitor supports bidirectional I/O, baud selection, line endings, timestamps — and can attach to a real Arduino via the Web Serial API to flash and watch output from the browser.

Web AudioWeb SerialSerial Monitor
REG

Component + Pin Registry

One schema per type drives the whole stack: footprint, renderer, pin-resolver, inspector, agent tool schema, power model, palette icon. 22+ component types and 4 board targets (Uno, Nano, Mega 2560, RPi Pico). Adding a part is a schemas-edit, not a refactor.

Zod v4Registry Pattern22+ Types
lib.png
Dreamer built-in libraries
docs_led.png
Dreamer LED documentation
docs_spi.png
Dreamer SPI documentation
// Demo

Five core workflows

01

Breadboard & Wiring

Place components from the palette, snap to grid, draw wires. The breadboard simulates internal bus connections — 5 holes per row, center gap, power rails. R to rotate, drag to reposition.

breadboard.webm
02

Sketch Editor & Execution

CodeMirror 6 with VS Code Dark+ highlighting, autocomplete, bracket matching, inline linting. Hit Run and arduino-cli compiles the sketch against the real avr-gcc toolchain; the resulting .hex runs cycle-accurately in-browser via avr8js, with setup() + loop() behaving exactly as they would on a physical Uno.

editor.webm
03

Electrical DRC + Live Visuals

Every board edit triggers a static electrical analyzer that walks the disjoint-set of nets to flag missing grounds, non-rail-distributed fanout, pin-mode mismatches, and over-drawn rails. Peripherals react to avr8js pin events in real time — LEDs glow with PWM duty cycle, LCDs render CGRAM, OLEDs rasterize framebuffers. Probe any node with the multimeter.

simulation.webm
04

Serial Monitor & Web Serial Bridge

Bidirectional serial communication against the emulated USART. Serial.print() streams live. Flip a switch and attach a real Arduino over USB via the Web Serial API — baud selector, line endings, autoscroll, timestamps all carry over.

serial.webm
05

AI Circuit Agent + MCP

Describe a circuit in natural language and the agent emits a DreamerDiagram, validates it, then commits atomically via apply_design — all through streaming tool calls. Toggle DSL vs auto-layout in the prompt bar. The same tools are exposed as an MCP server: Claude Desktop / Cursor / any MCP client can drive the board without opening the web UI.

agent.webm
// Stack
Runtime
BunTypeScript strict
Monorepo
packages/apppackages/apipackages/clipackages/schemaspackages/config
Frontend
React 19ViteTailwind v4Base UIDockviewCodeMirror 6XState v5
Backend
ElysiaBun.serve
Emulation
arduino-cliavr-gccavr8js (AVR-8)rp2040js (Pico)
Analysis
Disjoint-set net resolverElectrical DRCPower budgetRay-cast sensors
AI
Vercel AI SDK@ai-sdk/anthropicClaude SonnetClaude Haiku
Agent surface
Chat UIdreamer CLIMCP server (stdio)
Hardware
Web Serial APIWeb Audio API
Schemas
Zod v4DreamerDiagram DSLBoardOp union
// Conclusion

A real Arduino workbench,
with an AI agent at every layer.

Dreamer started as a transpiler-based toy and grew up. Today it compiles your sketch with the real arduino-cli toolchain and runs the resulting .hex in-browser via avr8js — interrupts, timers, USART, PWM, EEPROM, all cycle-accurate. Web Serial bridges the simulator to physical hardware when you want to flash for real.

The architecture centres on a single DreamerDiagram DSL (zod-schema v1) and a component registry. The same schema drives the agent's tool inputs, the CLI's headless diagram commands, the MCP server's tool surface, and the web UI's persistence layer — so the agent, a human in Claude Desktop, and a scripted pipeline all speak the same dialect.

The agent itself is versioned (snapshot-pinned per run), routes between Sonnet and Haiku by prompt complexity, and exposes a DSL-first / auto-layout toggle in the UI so you can A/B how different build strategies fare against the same prompt.

agent.png
Dreamer AI circuit agent
dreamer_doc.png
Dreamer documentation overview
> dreamer — browser + CLI + MCP, one codebase — built by zelong_