MCUscope
MCUscope is a hardware debug bridge for embedded targets. It lets both humans and AI agents (such as Claude Code) talk to an STM32 (or any) microcontroller over a serial link. They can send CAN/I2C/SPI/GPIO/ADC commands, stream and query timestamped debug output, and plot realtime data in the browser.
A single daemon (mcuscoped) owns the serial port, timestamps every line into SQLite, and serves a local REST + WebSocket API and a web UI on 127.0.0.1:8765.
The mcu CLI is a thin client over that API and is the primary interface for both the human and the agent.
What you get, with any line-based firmware and no changes to it: a timestamped capture of every line, a live terminal with per-pane filters, regex search over the whole capture, !p realtime plots and !m markers from plain printf.
On top of that:
- Agent primitives:
mcu wait(send, then block until a matching line or timeout) andmcu assert(every--expectseen, no--forbidseen, exit 0 or 1);--jsonon every command; exit codes 0/1/2/3. - Sessions: name a span of the capture, query, export or purge just that run; the daemon records one per run of its own.
- Commands and buses, with the C monitor module in your firmware:
can(up to nine controllers,--bus N),i2c,spi,gpio,adc, plus decoded CAN table, typed plot streams and digital/enum lanes. - PlotJuggler: mirror plot points to PlotJuggler's UDP Server source live (
mcu pj on). - LAN access with a runtime token, rate-limited; loopback clients never need it.
- Linux and Windows 10/11,
COMx,/dev/tty*andsocket://host:portdevice strings.
This package (mcuscope) is the host side.
The portable C firmware "monitor" module that runs on the target, a hardware-free simulator, and the full specification live in the project repository.
Install
Requires Python 3.10 or newer.
uv tool install mcuscope # or: pipx install mcuscope
This exposes three console scripts on your PATH: mcuscoped (the daemon), mcu (the CLI), and mcu-sim (the hardware-free simulator).
To reach a real serial port, one OS-specific step:
- Linux: your user must be in the
dialoutgroup:sudo usermod -aG dialout $USER, then log out and back in. Without it, opening/dev/ttyACM0fails with permission denied. - Windows 10/11: most USB-serial adapters and ST-Link VCPs work with the in-box driver; some need the vendor driver (CP210x, CH340, FTDI).
Neither is needed for the quickstart below, which runs with no hardware attached.
Quickstart
No hardware needed to try it:
mcuscoped --sim --open # daemon + built-in simulator; opens the web UI
The web UI at http://127.0.0.1:8765/ui/ shows the live terminal, CAN table, and realtime plots.
The Plots panel also renders a Digital/Enum view (logic-analyser bit traces and labelled enum/state bands) sharing the same time base and cursor as the analog charts.
With real hardware, start the daemon first (it owns the port and captures everything), then attach the port - from the UI's + Attach dialog, or the CLI:
mcuscoped # serves the API + web UI on :8765
# in another terminal (or use `mcu daemon start` to background the daemon):
mcu devices # find the port name
mcu attach /dev/ttyACM0 --baud 115200 --alias board # Linux
mcu attach COM7 --baud 115200 --alias board # Windows
mcu status # daemon + port health
mcu cmd ping # -> monitor 1 <project> (port-layer name, not the alias)
mcu cmd 'i2c scan' # -> 48 50
mcu tail -f # follow live capture
Every command takes --json for a single machine-readable object and returns meaningful exit codes (0 success/match, 1 error or bad usage, 2 timeout, 3 daemon unreachable).
Run mcu ai-guide for a compact, agent-oriented cheat sheet.
The simulator also runs standalone (mcu-sim, prints e.g. socket://127.0.0.1:9900); attach it like any device: mcu attach socket://127.0.0.1:9900 --alias sim.
What your firmware has to send
Nothing, to start with.
Any line-based printf output is captured, timestamped, filtered and searchable as-is, so MCUscope is useful as a better serial terminal with no firmware changes at all.
The only rule is that debug lines must not begin with < or !, which are reserved for the monitor protocol.
Two extra line formats get you realtime plots and timeline markers, with no library and no float printf:
printf("!p %lu temp=%d.%02d rpm=%d\n", tick_ms, whole, frac, rpm);
printf("!m @%lu calibration start\n", tick_ms); // marker; the @tick is optional
!p <tick> <name>=<value> ..., values integer, fixed-point or scientific notation.
Each name becomes a plot channel.
Adding the portable C monitor module is only needed when you want the host to send commands to the firmware, or want decoded CAN and typed digital/enum streams.
See What your firmware has to send.
Documentation
Full quickstart, configuration reference, protocol/API specification, and firmware integration guide are in the project repository.
License
MIT
Metadata
Release files for mcuscope 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mcuscope-0.3.0.tar.gz | 581.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mcuscope-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 910.1 kB
Release files / mcuscope-0.3.0.tar.gz
| Download URL | mcuscope-0.3.0.tar.gz |
|---|---|
| Size | 581.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
282b7c02a7f848f695d02f9ca4587e9ca589c0b07f4a65e3a9eb1a8cedd8648f
|
|
BLAKE2b-256 checksum How to use checksums |
456994a95d1fa033fbccaf43723f8f1bd1d6fca4d6cf51f17c640f2d3d730473
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.
Transparency logRelease files / mcuscope-0.3.0-py3-none-any.whl
| Download URL | mcuscope-0.3.0-py3-none-any.whl |
|---|---|
| Size | 328.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d505eb60dc8c7f3f9e1486f202e07f4cf332c5fa1e430b1eba892b92aa4b3468
|
|
BLAKE2b-256 checksum How to use checksums |
cf56a14b9cc5ca9a2ee956442f28d77b0467dddc2afab8970f46b1f6309f8850
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.
Transparency log