{"id":50762174,"url":"https://github.com/okhsunrog/flashprobe-mcp","last_synced_at":"2026-06-11T11:01:49.414Z","repository":{"id":361275407,"uuid":"1253805996","full_name":"okhsunrog/flashprobe-mcp","owner":"okhsunrog","description":"MCP server to flash \u0026 monitor embedded firmware over probe-rs (JTAG/SWD + RTT) or espflash (UART) — any probe-rs target (STM32, nRF, RP2350, ESP…), defmt-aware, with bounded LLM-token-efficient capture","archived":false,"fork":false,"pushed_at":"2026-06-02T19:27:48.000Z","size":155,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-02T21:16:27.628Z","etag":null,"topics":["debugging","defmt","embedded","embedded-rust","esp32","espflash","firmware","mcp","microcontroller","model-context-protocol","probe-rs","rtt","rust","stm32","swd"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/okhsunrog.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-29T20:44:16.000Z","updated_at":"2026-06-02T19:27:52.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/okhsunrog/flashprobe-mcp","commit_stats":null,"previous_names":["okhsunrog/espflash-mcp","okhsunrog/flashprobe-mcp"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/okhsunrog/flashprobe-mcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okhsunrog%2Fflashprobe-mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okhsunrog%2Fflashprobe-mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okhsunrog%2Fflashprobe-mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okhsunrog%2Fflashprobe-mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/okhsunrog","download_url":"https://codeload.github.com/okhsunrog/flashprobe-mcp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okhsunrog%2Fflashprobe-mcp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34195117,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["debugging","defmt","embedded","embedded-rust","esp32","espflash","firmware","mcp","microcontroller","model-context-protocol","probe-rs","rtt","rust","stm32","swd"],"created_at":"2026-06-11T11:01:47.264Z","updated_at":"2026-06-11T11:01:49.408Z","avatar_url":"https://github.com/okhsunrog.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# flashprobe-mcp\n\nAn [MCP](https://modelcontextprotocol.io) server for flashing and monitoring\nembedded targets from any MCP client (Claude Code, Claude Desktop, …). It covers\nthe whole bench from one tool surface, over two backends:\n\n- **probe-rs** — JTAG/SWD flashing + **RTT** capture. Any\n  [probe-rs-supported](https://probe.rs/targets/) chip: ESP (Xtensa + RISC-V),\n  STM32, nRF, RP2040/RP2350, …\n- **espflash** — UART flashing + serial capture for ESP32-family chips.\n\nOutput is decoded as **defmt** when the firmware uses it (`defmt-rtt`,\n`rtt-target`, or `esp-println`'s `defmt-espflash`) and plain text otherwise —\ndetected automatically from the ELF.\n\n## Why a server instead of the CLI\n\nThe win for an agent is **bounded, early-exiting capture**. `probe-rs run` /\n`espflash monitor` never terminate on their own — an agent either forgets a\ntimeout and hangs, or sets one and burns the whole window every time. This\nserver stops the instant an expected line (or defmt error) appears — the\nprogrammatic equivalent of watching the log and pressing Ctrl-C — and returns a\ncompact, cleaned result.\n\n## Build\n\n```sh\ncargo build --release\n# binary at: target/release/flashprobe-mcp\n```\n\nprobe-rs is a default-on feature. For a lean espflash-only (serial) build with a\nmuch smaller dependency tree:\n\n```sh\ncargo build --release --no-default-features\n```\n\nThe server speaks MCP over stdio.\n\n## Configure your MCP client\n\n```sh\nclaude mcp add flashprobe -- /absolute/path/to/target/release/flashprobe-mcp\n```\n\nOr generic `mcpServers` JSON:\n\n```json\n{\n  \"mcpServers\": {\n    \"flashprobe\": {\n      \"command\": \"/absolute/path/to/target/release/flashprobe-mcp\"\n    }\n  }\n}\n```\n\nSerial access needs your user in the `dialout`/`uucp` group; probe access needs\nthe [probe-rs udev rules](https://probe.rs/docs/getting-started/probe-setup/).\n\n## Choosing a backend (required)\n\nEvery flash/monitor call takes an explicit **`backend`**: `\"probe-rs\"` or\n`\"espflash\"`. Both work on ESP chips, and the right one depends on **where the\nfirmware emits output** — RTT (probe-rs) vs UART (espflash). Picking the wrong\none flashes fine but shows no logs, so the server asks rather than guessing.\n\n- defmt-rtt / rtt-target firmware → `probe-rs`\n- esp-println / UART firmware → `espflash`\n- any non-ESP chip → `probe-rs`\n\n## Auto-detection\n\nEverything except the backend is derived from the project on disk (no config\nfile, no state) and can be overridden per call:\n\n| Derived | From | Override |\n|---------|------|----------|\n| ELF / file to flash | `cargo metadata` build artifact | `file_path` / `elf`, `project_dir`, `bin` |\n| chip (probe-rs) | `.cargo/config.toml` runner `--chip` | `chip` |\n| serial port (espflash) | the sole USB serial port | `port` |\n| defmt vs text | the ELF's `.defmt` section | — (reliable) |\n\nSo from a project directory, `flash_monitor { \"backend\": \"probe-rs\", \"stop\":\n\"ready\" }` flashes the built artifact to the detected chip and decodes defmt —\nnothing else to pass.\n\n## Tools\n\nAll flash/monitor/device tools work on **both backends** (each using its native\nmechanism); only `list_ports` is serial-specific.\n\n| Tool | Purpose | Backend notes |\n|------|---------|---------------|\n| `flash` | Flash an ELF/binary (no monitor) | espflash: IDF format / raw `flash_address`; probe-rs: flash-algo |\n| `flash_monitor` | Flash, then capture from boot | |\n| `rerun` | Reset (no reflash) + capture; `repeat \u003e 1` for flaky-bug runs | |\n| `monitor` | Attach + capture only | |\n| `reset_device` | Reset the device | espflash: DTR/RTS; probe-rs: core reset |\n| `erase_flash` / `erase_region` | Erase flash (destructive) | espflash: ROM erase (4 KiB-aligned region); probe-rs: flash-algo (sector-covering) |\n| `read_flash` | Read a memory/flash region to a file | espflash: ROM read; probe-rs: debug-port memory read |\n| `chip_info` | Device/target info | espflash: ESP type/revision/MAC/crystal/flash; probe-rs: target name + cores + memory map |\n| `checksum_md5` | MD5 of a region | espflash: on-device ROM MD5; probe-rs: read + host-side hash |\n| `list_ports` | Discover serial ports | espflash/serial only |\n\n## Capture\n\n`flash_monitor`, `monitor`, and `rerun` capture until the first of:\n\n- **`stop`** — an unanchored regex on the rendered line (`RESULT (PASS|FAIL)`,\n  `panic|abort`). Plain text is a valid pattern.\n- **`stop_on_level`** — defmt only: stop on the first frame at/above a level\n  (e.g. `error`) — the \"did it panic?\" button.\n- **`idle_ms`** — no new data for this long (default `4000`).\n- **`timeout_s`** — max wall-clock window (default `5`).\n- **`max_bytes`** — byte cap; stops early and marks the output truncated\n  (default `65536`).\n\n**Show filters:** `grep` (regex, both modes), `context` (N lines around the\n`stop` match), and defmt-only `level` (minimum to show) / `module` (regex on the\nmodule path). In defmt mode a suppressed-by-level count reports what a looser\n`level` would reveal. In text mode, ROM/bootloader boot noise (`strip_boot_noise`)\nand ANSI codes (`strip_ansi`) are stripped by default.\n\n## defmt note\n\ndefmt decode needs the **exact ELF that's running** — version skew yields\ngarbage, not an error. It's free in the flash-then-monitor flow (just built it);\nfor bare `monitor`/`rerun`, make sure the auto-detected (or passed) ELF matches.\nThe server surfaces a warning when a non-empty stream decodes to zero frames.\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fokhsunrog%2Fflashprobe-mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fokhsunrog%2Fflashprobe-mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fokhsunrog%2Fflashprobe-mcp/lists"}