Skip to main content

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:8558. 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) and mcu assert (every --expect seen, no --forbid seen, exit 0 or 1); --json on every command; exit codes 0/1/2/3.
    • A verdict over a window with no lines is empty, exit 1.
  • Sessions: name a span of the capture, query, export or purge just that run; the daemon also opens an automatic one when it starts.
  • Exports: lines as text/JSONL/CSV, plot CSV with decoded enum labels and bit lanes, CAN CSV, or a whole session as a zip bundle, from the CLI or the web UI, over any clock-time window.
  • 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.
    • Built for a single-user machine: on a host shared with other accounts, every local account has full control of the daemon, device access included.
  • Linux and Windows 10/11, COMx, /dev/tty* and socket://host:port device 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.

MCUscope web UI

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 dialout group: sudo usermod -aG dialout $USER, then log out and back in. Without it, opening /dev/ttyACM0 fails 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:8558/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 :8558
# 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 machine-readable output (one object, or one per row from tail, log export and can dump). Exit codes are meaningful: 0 success/match, 1 error or bad usage (including a daemon that stopped answering), 2 a timeout the board or the wait reported, 3 daemon unreachable. With more than one port attached, commands that write need -p <alias>. 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.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcuscope 0.5.0
File Size Uploaded Provenance Actions
mcuscope-0.5.0.tar.gz 1.3 MB With provenance Details for mcuscope-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mcuscope 0.5.0
File Interpreter ABI Platform Actions
mcuscope-0.5.0-py3-none-any.whl Python 3 none any Details for mcuscope-0.5.0-py3-none-any.whl

Total release size: 1.8 MB

Release files / mcuscope-0.5.0.tar.gz

Download URL mcuscope-0.5.0.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
ade59b725594d4bd2acd6805ca4429fc0a8ded3a329761b9453cb9f251fd6a92
BLAKE2b-256 checksum
How to use checksums
da09a1b7b9b804a619d0cb75be527d2c8b37e3f8f924281167770e3cf9753413
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 24, 2026.

Transparency log

Release files / mcuscope-0.5.0-py3-none-any.whl

Download URL mcuscope-0.5.0-py3-none-any.whl
Size 532.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e4fce20488ebf80fe9dd1f6cec4d491f81884f17cd8f2001f2838e590e37cc92
BLAKE2b-256 checksum
How to use checksums
d546f573664881ab56f60a6b2143be9e51c0da48b5b6e392c05dc1eb20a2dbc0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 24, 2026.

Transparency log

Security for mcuscope 0.5.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mcuscope-0.5.0.tar.gz

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 Nov 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page