Show the code in these languages

Getting started

From a Stackchan robot on your desk to your own program (or AI agent) driving it: about ten minutes. You need the robot, a computer with Chrome (for the USB setup), and a phone or the same computer for this site.

1. The robot gets Dev as one of its apps

Dev is an app like Pet or Focus: the robot connects to it, one app at a time.

On the robot: swipe up from the bottom edge, tap QR, then Next until it shows Dev, and Connect. The robot shows Dev's QR code.

2. Your browser gets the robot

3. A key for your program

On Your robots, New key (name it after where it will live: "laptop", "ci", "claude"). The key is shown once, with the three lines for your shell:

export SDEV_URL=https://dev.q41.eu            # where Dev runs
export SDEV_ROBOT=stackchan-0a1b2c3d4e50      # your robot
export SDEV_KEY=sdev_…                        # the key: keep it like a password

Put them in your shell's profile, or in a file you source (never in a repository). The key works for this robot only. You see it, with when it was last used, on Your robots and on the robot's card on m.i41.eu, and delete it in either place.

4. Your first program

In a clone of the repository (git clone https://github.com/i41-eu/q41eu-dev && cd q41eu-dev), the hello example: a card, green LEDs, a nod, a chime.

curl
sh examples/curl/hello.sh
Python
python3 examples/python/hello.py
JavaScript
node examples/js/hello.mjs
Go
go run ./examples/go/hello
MCP
claude mcp add --transport http stackchan "$SDEV_URL/mcp" --header "Authorization: Bearer $SDEV_KEY"

# then ask the agent:
#   Say hello on the robot: a green card "Hello", green LEDs, a nod and the tada chime.

Each example stands alone: copy one file, or run the Go ones without a clone (go run github.com/i41-eu/q41eu-dev/examples/go/hello@latest). Python needs only its standard library, JavaScript only Node 18 or newer.

Examples has them all in every language, each with a Run button that does the same from the page.

5. An AI agent

The same actions are MCP tools (robot_show, robot_ask, robot_events, …) at $SDEV_URL/mcp. For Claude Code:

claude mcp add --transport http stackchan "$SDEV_URL/mcp" --header "Authorization: Bearer $SDEV_KEY"

Then ask it, for example, "show on the robot what you are working on, and ask me there before you push". Any MCP client that speaks Streamable HTTP works the same way. Every action on the API page has its MCP tool call next to the other languages.

6. Your own program

Lower level

Dev is the robot's higher-level API. Underneath, the robot speaks the device wire protocol (every sensor raw, every command, video and audio): the Raw data app shows all of it, and an app of your own can speak it directly, with Dev's Go kit (robothub for the connection) or on its own.