powerdragonfire/platformio
v0.6.2MIT
Build, flash, monitor, test, and debug embedded firmware through PlatformIO: 44 MCP tools plus a skill that teaches the build-flash-verify loop.
Changelog
All notable changes to this project are recorded here. The format follows Keep a Changelog and the project uses Semantic Versioning.
[Unreleased]
[0.6.2] - 2026-11-10
Changed
- Enable PostHog SDK intent context and missing-capability reporting using the release ingestion key by default, preserving token overrides, opt-outs, and a single remote sender.
- Ask agents to describe goals in context and report unsupported capabilities through
get_more_tools; document agent participation and context delivery.
[0.6.1] - 2026-11-10
Added
- Report available model and reasoning-effort metadata with provenance on both analytics paths, with explicit environment fallbacks. Expose the running release as
platformio_mcp_versionalongside$mcp_server_version. - Optional original prompt capture from explicit host metadata, disabled by default and bounded to 2,000 characters when users enable
PLATFORMIO_MCP_CAPTURE_PROMPTS=1. - Codex marketplace and compatibility manifest, portable MCP configuration, and documented Claude/Codex plugin installation. Plugin installs bundle PlatformIO Core through the existing extra.
- Enable the PostHog SDK's missing-capability reporting tool.
Fixed
- Wait for the GDB prompt following the initial stop before accepting commands, preventing a delayed startup prompt from making a running command appear complete on macOS.
[0.6.0] - 2026-11-10
Changed
- Add the PostHog MCP SDK when
POSTHOG_PROJECT_TOKENis set and remote analytics are allowed. The built-in recorder retains the local log and custom endpoint while the SDK handles PostHog delivery, preventing duplicate events. - Allow PostHog SDK updates within
>=7.86.6,<8.
Fixed
- Explicitly enable SDK context capture and infer intent from registered tool names when agents omit context or send an empty value. Preserve non-empty agent context and label fallback intent as inferred.
- Respect analytics opt-outs and CI before creating the SDK client. Importing the server no longer creates a PostHog client or emits a missing-token warning.
- Flush and close the SDK client during normal shutdown, ignoring cleanup failures. Remove the SDK SIGTERM handler and forced process exit.
[0.5.0] - 2026-11-10
Added
- PostHog events carry
$session_id(the per-process session),$mcp_source,$lib_version, and$mcp_protocol_version, so PostHog's MCP analytics Sessions tab and per-tool session counts work. $mcp_initializeand$mcp_tools_list(with$mcp_listed_tool_names) go to PostHog once per process each. Tools listed and never called become visible.- Tool-call events keep the
boardandplatformargument values when they are PlatformIO registry ids such asesp32devorespressif32. Paths and URLs in those arguments are dropped. All other argument values stay out.
Changed
- PostHog events go out through
/batch/in batches of up to 20 events or every 5 seconds, in place of one POST per event. Server shutdown flushes the open batch for up to 2 seconds. The local log andPLATFORMIO_MCP_ANALYTICS_URLare unchanged.
[0.4.1] - 2026-11-09
Changed
- PostHog usage events are now
$mcp_tool_callwith PostHog's MCP property names ($mcp_tool_name,$mcp_is_error,$mcp_error_type,$mcp_duration_ms,$mcp_client_name, ...). PostHog's MCP analytics views now break calls down by tool and client. 0.4.0 sent the same data astool_call.
[0.4.0] - 2026-11-09
Added
- Usage analytics: one JSON line per tool call in
~/.platformio-mcp/analytics/usage.jsonlwith tool, ok, error code, duration, argument names, and MCP client. Argument values, paths, ports, and serial output are never recorded.PLATFORMIO_MCP_ANALYTICS=offdisables it, andPLATFORMIO_MCP_ANALYTICS_URLalso POSTs each event to your own endpoint. - Anonymous usage events to PostHog EU Cloud, keyed by a random install id with no person profile. Off under
DO_NOT_TRACK=1,PLATFORMIO_MCP_ANALYTICS=local, or whenCIis set. The first sending run prints a notice on stderr. platformio.mcp statssummarises the usage log: calls, ok rate, and p50/p95 duration per tool, top errors, and clients.
Changed
- Releases tag themselves: merging a pull request that bumps the version makes
publish.ymlcreate thevX.Y.Ztag, publish to PyPI, and create the GitHub release. A release no longer needs a separate PR or a manual tag push.
[0.3.1] - 2026-11-09
Security
- CI and release workflows now default the
GITHUB_TOKENtocontents: read. Only the PyPI job (id-token: write) and the GitHub release job (contents: write) get more.
[0.3.0] - 2026-11-04
Added
- Declarative hardware test plans:
pio_test_plan_validate,pio_test_plan_start,pio_test_plan_status, andpio_test_plan_cancelrun a JSON plan for N iterations. Each iteration gets a verdict (pass,fail,timeout,infra_error), and evidence logs record the git and firmware identity. An example plan lives inexamples/ch32h4-spi-loopback. - Automated PyPI publishing through trusted publishing when a
v*tag is pushed. scripts/release.pykeeps every version string in sync, checks the changelog, and rolls[Unreleased]into a dated release. CI runs it on every pull request.
Fixed
- Cancelling a test-plan run before an iteration's upload no longer crashes the runner; the run now ends as
cancelledinstead offailed. pio_coredumpdecodes again on espressif32 6.x and later. GDB is now found in the separatetool-xtensa-esp-elf-gdb/tool-riscv32-esp-elf-gdbpackage, and--gdbis passed after theinfo_corefilesubcommand as esp-coredump 1.x requires. A failed decode now returnserror: "coredump_analyze_failed"and names the GDB it used (#21).
Changed
- Dependency updates:
mcp2.3.0,pyjwt2.15.0,certifi2026.10.18,opentelemetry-api1.45.1, and neweractions/checkoutandastral-sh/setup-uv.
[0.2.0] - 2026-09-18
Added
- 11 new tools (40 total):
pio_upload_ota: flash over Wi-Fi to ArduinoOTA (espota) boards with a reachability pre-check and failures mapped to the fix.pio_port_diagnose: explain why a serial port cannot be used (our session, another process via lsof/fuser, permissions, board not answering).pio_partition_table: validate the ESP32 partition CSV (alignment, overlaps, flash fit, OTA slots, app fit) and, withread_device, diff it against the table on the chip.pio_coredump: read the core dump partition over esptool and decode it with the optionalesp-coredumpanalyzer.pio_memory_watch: heap and stack telemetry parsed from serial output with leak, fragmentation, and stack-headroom verdicts.pio_power_profile: current draw from a serial meter or a Nordic PPK2 with sleep/active split, energy, and battery estimate.pio_deps_check: library name collisions, unpinned specs, missing and leftover libraries, circular dependencies, and the LDF dependency graph.pio_debug_start/pio_debug_cmd/pio_debug_stop/pio_debug_list: live GDB sessions overpio debug --interface=gdbwith GDB/MI parsed into structured results.
stop_open_sessionsonpio_uploadandpio_run_targetreleases our own monitor sessions before flashing; upload failures now carryport_errorandport_diagnosis.- Optional extras
coredump(esp-coredump) andpower(ppk2-api). - Community files: CONTRIBUTING, CODE_OF_CONDUCT, SECURITY, issue forms, PR template, Dependabot config.
- Open Plugins layout (
.mcp.json,plugin.json,skills/platformio/SKILL.md,rules/platformio.mdc) so the repo installs as a Claude Code or Cursor plugin and lists on cursor.directory. bad_regexstructured error when await_for,until,expect,fail_on, orfilterpattern is not a valid regular expression.- Log pruning: the log directory keeps the newest 200 files (
PLATFORMIO_MCP_MAX_LOGSoverrides). server.jsonand the README ownership marker for the official MCP Registry.- GitHub Actions CI on Linux, macOS, and Windows, plus an integration job that builds the native fixture with real PlatformIO.
Fixed
- Toolchain prefix derivation kept the caller's path separator, fixing
pio_decode_backtraceandpio_size_reporton Windows. - Any unexpected exception inside a tool now returns
ok: falsewith the exception text instead of a bare "Error executing tool".
Security
- Raised the
mcpfloor from>=1.0to>=2.2. The old floor let scanners resolve to SDK releases affected by CVE-2025-53365, CVE-2025-53366, CVE-2025-66416, CVE-2026-52869, and CVE-2026-59950 (all fixed by mcp 1.28.1). The server already required the 2.x API, so no behaviour changes.
[0.1.0] - 2026-09-16
First release.
Added
- 29 MCP tools over the PlatformIO CLI: system info, board search, project init and inspection, build / upload / clean / targets, serial device listing, background serial monitor sessions and one-shot capture, Unity tests, static analysis, and package management.
pio_flash_and_verify: flash, then watch the boot log until anexpectregex (pass), a crash signature (fail), or a timeout; failures are decoded automatically.pio_decode_backtrace: resolve ESP32 Guru Meditation backtraces and Cortex-M HardFault dumps to function, file, and line with the toolchain'saddr2line.pio_size_report: PlatformIO's RAM/Flash percentages plus GNUsize/nmbreakdowns of sections, biggest symbols, and per-file totals.- Safety policy via
PLATFORMIO_MCP_POLICY(full,build_only,read_only). installsubcommand that registers the server with Claude Code, Claude Desktop, Cursor, Codex, and Windsurf, or prints the JSON snippet.- Optional
[platformio]extra souvx "platformio.mcp[platformio]"works on machines without PlatformIO.