platformio.mcp
platformio.mcp is an MCP server that gives AI agents end-to-end PlatformIO hardware workflow control, from project setup and builds to flashing, serial debugging, crash analysis, and test automation.
Inspect PlatformIO installation, boards, serial devices, and board details.
Create/manage PlatformIO projects, list environments, and inspect build metadata.
Build, clean, upload/flash firmware, run extra targets, and OTA-update devices.
Flash-and-verify firmware in one hardware-in-the-loop check.
Start/read/write/stop/capture serial monitor sessions and diagnose port issues.
Run unit tests and static analysis.
Search/install/uninstall/list/update packages and audit dependencies.
Decode crashes/backtraces, report firmware size, validate partition tables, and pull/decode core dumps.
Monitor heap/stack memory and profile power consumption.
Start live GDB debug sessions and send debug commands.
Validate, start, monitor, and cancel repeatable hardware test plans.
Respect safety policies for full, build-only, or read-only operation.
Provides tools for PlatformIO embedded development: project initialization and metadata, building, uploading/flashing, serial monitoring, running tests, decoding crash backtraces, and analyzing firmware size.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@platformio.mcp flash the esp32dev env and verify it boots"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
⚡ 60-second install
You need uv (curl -LsSf https://astral.sh/uv/install.sh | sh). Then:
uvx platformio.mcp install --claude-code # or --cursor --claude-desktop --codex --windsurfNo PlatformIO on this machine? Add --with-platformio and the server brings PlatformIO Core along. Optional extras: platformio.mcp[coredump] adds the ESP32 core-dump analyzer, platformio.mcp[power] adds the Nordic PPK2 driver.
uvx platformio.mcp install --print{ "mcpServers": { "platformio": { "command": "uvx", "args": ["platformio.mcp"] } } }Use "args": ["platformio.mcp[platformio]"] to bundle PlatformIO Core.
Install uv first. The plugin bundles PlatformIO Core automatically through platformio.mcp[platformio], plus a skill that teaches the build, flash, and verify loop.
In Claude Code, use /plugin (singular):
/plugin marketplace add powerdragonfire/platformio.mcp
/plugin install platformio@platformio.mcpThe same installation from a terminal:
claude plugin marketplace add powerdragonfire/platformio.mcp # Claude Code
claude plugin install platformio@platformio.mcpFor Codex, add the repository marketplace and install the plugin:
codex plugin marketplace add powerdragonfire/platformio.mcp
codex plugin add platformio@platformio.mcpIn Codex's plugin browser (/plugins where supported), add powerdragonfire/platformio.mcp as a marketplace source and select PlatformIO. Restart the client or open a new session after installation. Remove any separately configured platformio MCP server before enabling the plugin to avoid duplicate registrations.
The repo includes portable plugin.json and mcp.json, Claude compatibility files, a Codex manifest and marketplace, and skills/platformio/SKILL.md. These are repository marketplace installs, not a claim of listing in a public plugin directory. See the OpenAI packaging reference and Claude plugin reference.
Other MCP clients can use uvx platformio.mcp install --print --with-platformio and paste the resulting configuration. Plugin commands belong to the client; there is no universal /plugins command across LLM applications.
The server finds platformio / pio on your PATH or in ~/.platformio/penv. Override with PLATFORMIO_MCP_PIO=/path/to/pio. Run uvx platformio.mcp doctor to see what the agent will see.
Related MCP server: esp-idf-mcp
🎬 What it looks like
You: flash the
viewenv and make sure it boots.Agent →
pio_flash_and_verify(env="view", expect="setup done")FAIL: firmware flashed but the boot log matched the failure pattern: 'Guru Meditation Error: Core 1 panic'ed (LoadProhibited)'. Cause: LoadProhibited. 3/3 addresses resolved: DisplayTask::run() (display_task.cpp:22) <- DisplayTask::run() (display_task.cpp:23) <- vPortTaskWrapper (port.c:143)Agent: null pointer on line 22 of
display_task.cpp,tft_is used beforebegin(). Fixing, rebuilding, flashing again.PASS: flashed env view in 14.2s and saw 'setup done' on /dev/cu.usbserial-0001 after 2.1s of boot output.
No 40 KB build logs in the context window. No human reading the serial monitor. The agent gets a verdict, a file and a line.
🔁 The loop the agent runs
flowchart LR
A[pio_project_envs] --> B[edit code]
B --> C[pio_build]
C -- errors with file:line --> B
C -- ok --> D[pio_flash_and_verify]
D -- PASS --> E([done])
D -- FAIL: decoded backtrace --> B
D -- TIMEOUT --> F[pio_monitor_capture]
F --> B🧰 The 44 tools
Every tool returns ok, a one-paragraph summary written for the model, structured fields, and a log_path to the full output. Long output stays on disk under ~/.platformio-mcp/logs (newest 200 files kept).
The tools that go beyond the CLI
What it does | Under the hood | |
🚀 | Flash, open the port, read until |
|
🔁 | Run a declarative hardware test plan for N iterations with cancellation, per-iteration verdicts ( | Reuses upload + serial monitor tools, continues observing for a post-success window, and writes machine-readable reports with source+firmware identity |
🩺 | Turn an ESP32 | Toolchain located from |
📊 | Why is the firmware this big? Flash/RAM %, loaded sections, biggest symbols with |
|
💾 | Catch the silent ESP32 corruption where an app-only flash leaves an old partition table on the chip; alignment, overlap, OTA slot, and app-fit checks | Parses the env's partition CSV; |
🧯 | Pull the core dump from the |
|
📈 | Leak, fragmentation, and stack-headroom verdicts from what the firmware already prints | Parses |
🔋 | Average/min/max/p95 current, sleep vs active split, energy, battery-life estimate | A serial meter (INA219 sketch, USB meter log) or a Nordic PPK2 ( |
🐞 | Breakpoints, step, backtrace, and variable inspection through the debug probe |
|
🌐 | Flash over Wi-Fi with failures mapped to the fix (wrong password, no |
|
🔌 | Why the upload cannot open the port: our session, another process, permissions, or a board not in bootloader mode |
|
📚 | Library name collisions where | Manifests in |
🔁 Repeatable hardware test plans
Use declarative JSON plans when you need reproducible board validation over many iterations.
{
"plan_version": 1,
"name": "SPI loopback",
"project_dir": "/abs/project",
"environment": "ch32h4_loopback",
"device_identity": "bench-ch32h4-01",
"board": { "platformio_env": "ch32h4_loopback", "board_id": "genericCH32H4" },
"peripherals": ["SPI loopback"],
"pin_mapping": { "SPI_MOSI": "PB15", "SPI_MISO": "PB14" },
"fixture": { "required_wiring": ["PB15 to PB14"] },
"run": { "iterations": 100, "upload_each_iteration": true, "stop_open_sessions": true },
"serial_assertion": {
"success_pattern": "SPI_LOOPBACK_OK",
"failure_pattern": "panic|HardFault|assert failed|test-failure",
"timeout_s": 20,
"observation_window_s": 5,
"reconnect_attempts": 1
}
}Workflow:
pio_test_plan_validate(plan_path=...)pio_test_plan_start(plan_path=...)poll
pio_test_plan_status(run_id=...)optional cancel:
pio_test_plan_cancel(run_id=...)
Reports include source revision + dirty state, firmware hash, selected env, and detected device identity. Every non-pass iteration stores evidence logs with references in the JSON report.
An end-to-end CH32H4 fixture + firmware example is in examples/ch32h4-spi-loopback.
🔒 Safety policy
Set PLATFORMIO_MCP_POLICY in the server's env, or pass --policy to install:
Policy | Can build | Can flash / erase / write serial | Use it for |
| ✅ | ✅ | Your own bench |
| ✅ | ❌ | Shared labs, CI, "look but don't touch" |
| ❌ | ❌ | Code review, onboarding, untrusted prompts |
MCP clients also prompt before each tool call. Policies are the second layer, not the only one.
⚙️ Settings
Variable | Purpose | Default |
|
|
|
| Project used when a tool is called without | server's cwd |
| Explicit path to the | auto-detect |
| Where full command logs go |
|
| How many log files to keep |
|
|
|
|
|
| unset |
| Where the usage log goes |
|
| Also POST each usage event as JSON to this URL | unset |
|
| unset |
📊 Usage analytics
Each tool call writes one JSON line to ~/.platformio-mcp/analytics/usage.jsonl on your machine. Releases also send an event to PostHog EU Cloud (eu.i.posthog.com) as an anonymous event, so the maintainers can see which tools get used and which fail.
An event holds the tool name, ok, the error code, the duration, the names of the arguments passed, the server version, the policy, the OS, the Python version, the MCP client's name and version, and the MCP protocol version. When a tool receives a board or platform argument shaped like a PlatformIO registry id (esp32dev, espressif32), the event keeps that id. A path or URL in those arguments is dropped. Other argument values, tool results, error text, paths, ports, summaries, and serial output are excluded on both paths. Agent-written intent text and missing-capability reports are sent only after you opt in (see below). PostHog sees a random install id from ~/.platformio-mcp/analytics/install_id and no person profile. The first run that sends events prints this notice on stderr.
By default, the built-in recorder sends three PostHog event types in batches of up to 20 events or every 5 seconds, and flushes them when the server shuts down:
Event | When | Extra properties |
| each tool call |
|
| once per process, when the client connects | none |
| once per process, on the first tool list |
|
Every PostHog event also carries $session_id (a random id per server process, which is one client connection over stdio), $mcp_source, $mcp_client_name, $mcp_client_version, $mcp_protocol_version, $mcp_server_name, $mcp_server_version, $lib, $lib_version, policy, os, and python. The local log and PLATFORMIO_MCP_ANALYTICS_URL get tool calls only, one POST per event.
To | Set |
Keep the local log, send nothing |
|
Record nothing at all |
|
Also send raw events to your own endpoint |
|
Also send agent intent text and |
|
Nothing is sent to PostHog when CI is set, so CI runs do not count as usage.
Version, model, effort, and optional prompts
Both analytics paths report the installed server release as $mcp_server_version and platformio_mcp_version. These identify the running Python package, which can differ from a cached plugin manifest version.
Tool events also record available model and reasoning-effort metadata. Codex supplies model and reasoning_effort in _meta["x-codex-turn-metadata"] (upstream implementation). Other hosts can supply the same fields in _meta["platformio.mcp"]. Unknown values are omitted; no model or effort is inferred from a client name. Model names are bounded identifiers; effort accepts none, minimal, low, medium, high, xhigh, max, or ultra.
Property | Meaning |
| Model identifier and |
| Supplied effort and |
| Optional original prompt, host metadata source, and truncation flag |
If the host cannot send model or effort metadata, explicitly set PLATFORMIO_MCP_MODEL and PLATFORMIO_MCP_REASONING_EFFORT in the MCP server environment. Per-call metadata takes precedence. Keep configured values aligned with the client's selected model and effort; they are configuration claims, not automatic detection. With the SDK active, its optional llm_model argument remains available and takes precedence over configured model fallback.
Original prompt capture is off by default. A user must set PLATFORMIO_MCP_CAPTURE_PROMPTS=1 in their MCP server environment and their host must explicitly attach the prompt to each tool request:
{
"_meta": {
"platformio.mcp": {
"model": "actual-model-id",
"reasoning_effort": "high",
"prompt": "Build the firmware and inspect the serial output"
}
}
}The server retains at most the first 2,000 characters of this prompt, including in local logs and custom endpoint events. Enabled remote delivery sends it to PostHog. Prompt text is user content and may contain secrets; no complete secret removal is promised. Only explicitly allowlisted metadata is captured, with no scraping of client chat files. Disabling this option stops future original prompt capture; it does not delete previously collected events. Existing off, local, DO_NOT_TRACK, and CI delivery controls still apply.
Ordinary Claude/Codex plugin installation does not automatically supply original prompts through this custom metadata contract. A host integration must provide it. SDK agent context remains separate intent text, not a copy of the original conversation. These prompt settings control only the user_prompt field. SDK context capture has its own switch, described below.
The PostHog MCP SDK is enabled by default using the bundled public ingestion key. Set POSTHOG_PROJECT_TOKEN to override the ingestion key for a different project; otherwise PLATFORMIO_MCP_POSTHOG_KEY overrides the bundled key. With no non-empty key, the SDK is disabled. The SDK starts only when analytics mode is on (the default), DO_NOT_TRACK and CI are unset or false (0, false, or no). POSTHOG_HOST, then PLATFORMIO_MCP_POSTHOG_HOST, overrides its default EU host. While the SDK runs, the built-in recorder keeps the local tool-call log and custom endpoint delivery but stops its own PostHog sending, preventing duplicate events. Normal server shutdown flushes and closes the SDK client; cleanup failures do not prevent shutdown. Importing the server creates no PostHog client.
The SDK builds its own $mcp_tool_call event, and the server filters it before sending (before_send=analytics.strip_sdk_payloads):
SDK field | Default | With |
| removed | removed |
| removed | removed |
| removed | removed |
| not captured | not captured |
|
| agent-written |
| absent | present |
The remaining SDK properties are the tool name, $mcp_is_error, $mcp_error_type, $mcp_duration_ms, $mcp_input_keys (declared argument names), client, server and protocol versions, $session_id, $mcp_conversation_id (random), and the model and effort fields below.
With intent capture on, the SDK injects a required context argument and records the agent's sentence as $mcp_intent. get_more_tools lets agents report a missing capability; the SDK sends the supplied context as $mcp_missing_capability. Both are agent-written free text. Agents are instructed to omit secrets and private source code, and the SDK redacts credential-like keys, URLs and base64 blocks, but file paths and project names in that text are not redacted. The intent fallback reads no argument values or transport metadata and makes no LLM calls. Restart the server and refresh cached client tool lists after changing the setting. See PostHog's intent documentation.
uvx platformio.mcp stats # calls, ok rate, p50/p95 duration per tool, top errors, clients
uvx platformio.mcp stats --days 7 --jsonThe log rotates at 5 MB and keeps one previous file.
📝 Serial monitor notes
Sessions talk to the port with pyserial directly, because PlatformIO's own monitor needs an interactive terminal. PlatformIO monitor filters such as esp32_exception_decoder therefore do not apply; pio_decode_backtrace does that job. Baud and port default from monitor_speed / monitor_port in platformio.ini when project_dir is passed, otherwise the single detected dev board at 115200. Opening the port resets most dev boards, which is why pio_flash_and_verify sees the boot log from the top.
🧩 pioarduino
pioarduino is a community espressif32 platform, installed by URL, that supports every Espressif chip on Arduino core 3.x. It keeps the platform name espressif32, so projects use it with no server settings.
Tested with pioarduino 55.03.312 (Arduino 3.3.12, ESP-IDF 5.5.5) on ESP32-C6, ESP32-C2 and ESP32-C3 envs: pio_build (also envs=[...]), pio_size_report, pio_partition_table, and RISC-V unwinding in pio_decode_backtrace. On a physical ESP32 (Xtensa), pio_flash_and_verify flashed a crashing sketch and decoded the panic to level3 <- level2 <- level1 <- setup. RISC-V upload and serial tools have not run on hardware yet.
pioarduino refuses to run under Python 3.15 or newer. PlatformIO Core must run on Python 3.10 to 3.14.
The first hybrid-compile build of an ESP32-C2 env failed at
checkprogsizeand wiped the other envs' build folders. The second build passed. Build again when that happens.
🛠️ Development
git clone https://github.com/powerdragonfire/platformio.mcp && cd platformio.mcp
uv sync
uv run pytest # unit tests, no hardware or network
uv run pytest -m integration # builds the bundled native fixture with your PlatformIO
uv run platformio-mcp doctor # what the agent's pio_system_info sees
npx @modelcontextprotocol/inspector uv run platformio-mcp # poke tools interactivelyTo use your checkout in Claude Code instead of the PyPI release:
claude mcp add platformio -- uv run --directory /path/to/platformio.mcp platformio-mcpChanges are tracked in CHANGELOG.md.
🤝 Contributing
Bug reports from real boards are the most useful thing you can send. Use the issue forms, ask questions in Discussions, and read CONTRIBUTING.md before opening a PR. Issues tagged good first issue are scoped for newcomers.
🔭 Prior art
jl-codes/platformio-mcp is a TypeScript server with the same goal, a web dashboard, and a GPIO pin audit. This project exists for people who want a Python-only install through uvx, one that can bundle PlatformIO itself, and crash decoding, size budgeting, partition checks, core dumps, OTA, live GDB, and memory/power profiling built in.
License
MIT
Available Tools
44 toolspio_board_infoA
Full details for one board id: MCU, clock, RAM and flash sizes in bytes, supported frameworks, connectivity, and debug probes. Use it to learn memory limits before writing code.
Inputs: board_id (required), llm_model, conversation_id. Returns: _mcp_instructions
pio_buildA
Compile the project (pio run). Returns a status, parsed compiler errors and warnings with file/line/column, RAM and Flash usage percentages, the last 40 lines of output, and a path to the full log. Fix the listed errors, then build again. First builds may take minutes while toolchains download. Pass envs=[...] to build several environments in one call, one after another; the result lists ok, status, errors and memory per env and keeps going when one env fails.
Inputs: env, envs, jobs, verbose, +3 more. Returns: _mcp_instructions
pio_checkA
Static analysis (pio check, cppcheck by default; clangtidy/pvs-studio if configured). Returns defects grouped and sorted by severity with file, line, CWE, and message. severity is the minimum level to report (low|medium|high).
Inputs: env, tool, pattern, severity, +4 more. Returns: _mcp_instructions
pio_cleanA
Delete build artifacts for an env (pio run -t clean); full=true also removes downloaded dependencies (fullclean).
Inputs: env, full, llm_model, project_dir, +1 more. Returns: _mcp_instructions
pio_coredumpA
Pull the ESP32 core dump out of the coredump flash partition after a crash (esptool read_flash) and save it. When the optional esp-coredump analyzer is installed (platformio.mcp[coredump]), it runs esp-coredump info_corefile against the env's firmware.elf with the toolchain's gdb and returns the crashed task, reason, registers, and backtrace. Reports clearly when the partition is erased (no crash recorded) or the analyzer is missing. Stop monitor sessions on the port first.
Inputs: env, port, analyze, out_path, +3 more. Returns: _mcp_instructions
pio_debug_cmdA
Send one gdb command to an open debug session and get its output back, parsed from GDB/MI: bt, p var, p/x reg, info locals, info registers, x/16xw addr, break src/main.cpp:42, watch counter, next, step, finish, continue, monitor reset halt, or raw MI such as -stack-list-frames. Execution commands (continue/next/step/finish) block until the target stops again or timeout_s passes; on timeout the target keeps running and interrupt halts it. Returns result_class, console lines, error, and stopped {reason, frame{function,file,line}}.
Inputs: command (required), session_id (required), llm_model, timeout_s, +1 more. Returns: _mcp_instructions
pio_debug_listB
List open debug sessions with env, debug tool, running/halted state, and the last stop frame.
Inputs: llm_model, conversation_id. Returns: _mcp_instructions
pio_debug_startA
Open a live gdb session on the board through its debug probe (pio debug --interface=gdb, GDB/MI over pipes): starts the debug server (OpenOCD, J-Link, ST-Link, esp-prog, ...) from debug_tool in platformio.ini, builds a debug firmware, loads it (load=true) and halts at debug_init_break (default: main). Returns session_id, the .pioinit script PlatformIO generated, and the initial stop frame. The session holds the probe: stop it (pio_debug_stop) before pio_upload or pio_flash_and_verify. Blocked under build_only/read_only policy.
Inputs: env, load, llm_model, timeout_s, +2 more. Returns: _mcp_instructions
pio_debug_stopA
Quit gdb and the debug server, resume the target, and free the probe so pio_upload works again.
Inputs: session_id (required), llm_model, conversation_id. Returns: _mcp_instructions
pio_decode_backtraceA
Turn a crash dump into source locations. Give text containing an ESP32/ESP-IDF 'Guru Meditation' register dump and 'Backtrace: 0x...:0x...' line, a RISC-V ESP32 (C2/C3/C5/C6/C61/H2/H4/P4/S31) MEPC/RA register dump with its 'Stack memory:' block, or a Cortex-M HardFault pc/lr dump, or give session_id of an open monitor session to scan its buffer. Xtensa and Cortex-M addresses are resolved with the toolchain's addr2line; RISC-V stacks are unwound with the toolchain's GDB into a full call chain (method=gdb_unwind), or, without GDB, stack words pointing into code are resolved (method=stack_scan, may include stale frames). Returns function, file, line per frame, plus the crash cause and reset reason. The ELF must be from the same build that was flashed.
Inputs: env, text, llm_model, session_id, +3 more. Returns: _mcp_instructions
pio_deps_checkA
Audit the project's library dependencies before they bite: compares lib_deps against what is installed in .pio/libdeps/, lib/, and lib_extra_dirs, and reports name collisions (two libraries with the same name, where lib_deps order silently decides which one wins), unpinned specs, declared-but-missing and leftover libraries, and circular dependencies between manifests. build=true also runs pio run and returns the LDF dependency graph as a tree, flagging a RecursionError as a cycle. Each issue carries a severity, message, and a concrete fix.
Inputs: env, build, llm_model, project_dir, +1 more. Returns: _mcp_instructions
pio_flash_and_verifyA
Hardware-in-the-loop check with no human: build + flash (pio run -t upload), then open the serial port and watch the boot log until expect (regex) matches -> verdict pass, or fail_on matches -> verdict fail with the crash automatically decoded to file:line, or timeout_s elapses -> verdict timeout. Port and baud come from platformio.ini (monitor_port/monitor_speed) or the single detected board. Set expect to a line your firmware prints once it is healthy, e.g. 'WiFi connected'. Blocked under build_only/read_only policy.
Inputs: env, baud, expect, fail_on, +9 more. Returns: _mcp_instructions
pio_list_boardsA
Search PlatformIO's board catalogue (~1,700 boards). Query matches board id, name, MCU, or vendor, e.g. 'esp32-s3', 'uno', 'STM32F4', 'DOIT'. Returns board ids plus MCU, clock, RAM, flash, and frameworks. Use the returned id in platformio.ini or pio_project_init.
Inputs: query (required), limit, platform, framework, +2 more. Returns: _mcp_instructions
pio_list_devicesA
List serial ports (pio device list) and flag which ones look like USB dev boards (CP210x, CH340, FTDI, ESP, Arduino, ST-Link...). Use the port with pio_upload, pio_monitor_start, or pio_monitor_capture.
Inputs: llm_model, conversation_id. Returns: _mcp_instructions
pio_list_targetsB
List extra build targets the platform offers for this project, such as buildfs, uploadfs, erase, size, or menuconfig.
Inputs: env, llm_model, project_dir, conversation_id. Returns: _mcp_instructions
pio_memory_watchA
Watch serial output for heap and stack telemetry and diagnose leaks, fragmentation, and stack headroom. Give session_id of an open monitor session (its buffer plus seconds more) or a port for a one-shot capture. Understands Arduino-ESP32 'Free heap: N min: N largest: N', ESP.getFreeHeap() prints, ESP-IDF heap_caps_print_heap_info blocks, FreeRTOS vTaskList tables, and uxTaskGetStackHighWaterMark lines; pattern (regex with a (?P) group) adds a custom metric. Returns per-metric min/max/trend with a stable/shrinking/growing verdict, a per-task stack table flagged below stack_warn_bytes, and a fragmentation hint. When the firmware prints nothing usable, instrumentation_hint has copy-paste snippets.
Inputs: env, baud, port, pattern, +7 more. Returns: _mcp_instructions
pio_monitor_captureA
One-shot serial capture with no session to manage: open the port, collect output for up to seconds (or until regex until matches), close the port, and return the lines. Ideal right after pio_upload to grab the boot log.
Inputs: env, baud, port, until, +5 more. Returns: _mcp_instructions
pio_monitor_listA
List open serial monitor sessions with port, baud, buffered line count, and next cursor.
Inputs: llm_model, conversation_id. Returns: _mcp_instructions
pio_monitor_readA
Read new serial lines from a session since cursor (start at 0) and get the next cursor back. Set wait_for to a regex to block up to timeout_s until a matching line arrives (e.g. wait_for='setup done|Guru Meditation'). Without wait_for and with timeout_s>0 it waits for at least one new line. When wait_for never matches the result is ok=false with error=pattern_timeout (or session_closed), plus the lines seen so far and a cursor to continue from.
Inputs: session_id (required), cursor, wait_for, llm_model, +3 more. Returns: _mcp_instructions
pio_monitor_startA
Open a background serial monitor session and return a session_id. Port and baud default from platformio.ini (monitor_port/monitor_speed) when project_dir is given, else the single detected dev board and 115200. Output is buffered (ring buffer, max_lines); read it with pio_monitor_read. The session holds the port, so stop it before pio_upload.
Inputs: env, baud, port, llm_model, +3 more. Returns: _mcp_instructions
pio_monitor_stopC
Close a serial monitor session and release the port.
Inputs: session_id (required), llm_model, conversation_id. Returns: _mcp_instructions
pio_monitor_writeA
Send text to the device over the open session's serial port (newline appended by default). Blocked under build_only/read_only policy.
Inputs: text (required), session_id (required), newline, llm_model, +1 more. Returns: _mcp_instructions
pio_partition_tableA
Validate the ESP32 flash layout before it bites. Reads the partition CSV the env uses (board_build.partitions, project partitions.csv, or the Arduino framework default), checks alignment, overlaps, fit against the chip's flash size, OTA slot/otadata consistency, nvs/coredump presence, whether the built firmware.bin fits the smallest app slot, and whether the build dir's partitions.bin is stale. With read_device=true it also reads the live table at 0x8000 over serial (esptool) and diffs it against the CSV, catching the silent-corruption case where an app-only flash left an old table on the chip. Returns partitions plus issues with fixes.
Inputs: env, port, llm_model, project_dir, +2 more. Returns: _mcp_instructions
pio_pkg_installA
Install a library/platform/tool into the project and add it to platformio.ini (pio pkg install -l spec). spec examples: 'bblanchon/ArduinoJson@^7', 'adafruit/Adafruit NeoPixel', 'https://github.com/user/repo.git'. Restrict to one env with env=.
Inputs: spec (required), env, type, llm_model, +2 more. Returns: _mcp_instructions
pio_pkg_listC
List resolved platform, toolchain, and library packages for the project with versions.
Inputs: env, llm_model, project_dir, conversation_id. Returns: _mcp_instructions
pio_pkg_outdatedC
Show which project dependencies have newer versions available.
Inputs: env, llm_model, project_dir, conversation_id. Returns: _mcp_instructions
pio_pkg_searchA
Search the PlatformIO registry for libraries (default), platforms, or tools. Returns owner/name specs with the latest version and description. Example query: 'ArduinoJson', 'ssd1306 display', 'mqtt'.
Inputs: query (required), page, type, llm_model, +1 more. Returns: _mcp_instructions
pio_pkg_uninstallC
Remove a library/platform/tool from the project and platformio.ini.
Inputs: spec (required), env, type, llm_model, +2 more. Returns: _mcp_instructions
pio_pkg_updateC
Update dependencies within the version ranges declared in platformio.ini.
Inputs: env, llm_model, project_dir, conversation_id. Returns: _mcp_instructions
pio_port_diagnoseA
Explain why a serial port is unusable before or after a failed upload: whether it exists, whether one of our monitor sessions holds it, which other process has it open (lsof/fuser on macOS and Linux), and read/write permission, plus the concrete fix. Port defaults from platformio.ini or the single detected board. Reports only; it never closes anything.
Inputs: env, port, llm_model, project_dir, +1 more. Returns: _mcp_instructions
pio_power_profileA
Measure the device's current draw for seconds and report average/min/max/p95 mA, energy (mWh and µAh when voltage is known), a bucketed timeline, the share of time in sleep vs active (threshold auto-detected from the two dominant current levels, or sleep_threshold_ma), and a battery-life estimate. source='serial' reads a meter streaming readings on port (INA219/INA226 sketch, USB power meter log; pattern regex with (?P) and optional (?P)/(?P) groups, default: first number with uA/mA/A). source='ppk2' drives a Nordic Power Profiler Kit II (needs the power extra). Set trigger + trigger_session_id to start measuring when the firmware prints a line.
Inputs: baud, port, source, buckets, +8 more. Returns: _mcp_instructions
pio_project_envsA
Read platformio.ini and list every environment with its board, platform, framework, monitor/upload settings, lib_deps, and build_flags, plus which envs are default. Cheap; call before building or flashing.
Inputs: llm_model, project_dir, conversation_id. Returns: _mcp_instructions
pio_project_initA
Create a new PlatformIO project (or add an environment to an existing one) with pio project init. Give an absolute project_dir, a board id from pio_list_boards, and optionally a framework (arduino, espidf, stm32cube, zephyr, ...). project_options are extra platformio.ini keys like 'monitor_speed=115200' or 'lib_deps=bblanchon/ArduinoJson'. Never hand-write platformio.ini for a new project; use this.
Inputs: board (required), project_dir (required), framework, llm_model, +2 more. Returns: _mcp_instructions
pio_project_metadataA
Computed build metadata per environment: defines, include paths, compiler paths and flags, library dirs. Useful for understanding what the compiler actually sees. Triggers platform/toolchain install on first use.
Inputs: env, llm_model, project_dir, conversation_id. Returns: _mcp_instructions
pio_run_targetB
Run one named target from pio_list_targets (e.g. 'buildfs', 'uploadfs', 'erase', 'size'). Flash-related targets follow the same policy, stop_open_sessions, and port-diagnosis rules as pio_upload.
Inputs: target (required), env, llm_model, project_dir, +3 more. Returns: _mcp_instructions
pio_size_reportA
Explain where flash and RAM go in the built firmware.elf: text/data/bss totals with percent of the board's flash and RAM, loaded sections classified as flash/ram, the biggest symbols (demangled, with file:line), and per-source-file totals. Use it to shrink firmware on purpose: drop the largest fonts/tables, remove unused features, tune build flags. Run pio_build first; filter is a regex applied to symbol names and file paths.
Inputs: env, top, filter, llm_model, +2 more. Returns: _mcp_instructions
pio_system_infoA
Check that PlatformIO is installed and report its version, core directory, the active safety policy (full | build_only | read_only), the log directory, any open serial monitor sessions, and the globally installed platforms and tool packages (name, version, path), which works without a project. Call this first in a session; if PlatformIO is missing the result tells you how to install it.
Inputs: llm_model, conversation_id. Returns: _mcp_instructions
pio_testA
Run PlatformIO unit tests (pio test, Unity framework) and return per-case pass/fail with file, line, and message. Tests live in test/test_/. Native envs run on the host; embedded envs build, flash, and read results over serial (set without_uploading=true to only build them). filter/ignore take glob patterns like 'test_math*'.
Inputs: env, filter, ignore, verbose, +6 more. Returns: _mcp_instructions
pio_test_plan_cancelA
Request explicit cancellation of an in-progress test-plan run by run_id. The active iteration stops at its next safe check and the run is finalized as cancelled with completed iteration evidence retained.
Inputs: run_id (required), reason, llm_model, conversation_id. Returns: _mcp_instructions
pio_test_plan_startC
Start a repeatable hardware test-plan run in the background. Each iteration can upload firmware, monitor serial output for pass/fail assertions, keep observing after success for the configured window, classify outcomes, and write a machine-readable report with evidence paths.
Inputs: plan_path (required), env, llm_model, iterations, +3 more. Returns: _mcp_instructions
pio_test_plan_statusA
Read test-plan run progress and results: run status, pass/fail/timeout/infrastructure-error counts, firmware/source/device identity, and recent or full per-iteration outcomes with evidence references.
Inputs: run_id (required), llm_model, conversation_id, tail_iterations, +1 more. Returns: _mcp_instructions
pio_test_plan_validateA
Validate a declarative hardware test plan JSON file before execution. Checks required fields for a serial assertion workflow (project, success/failure patterns, timeout, observation window, iteration count) and returns the normalized plan.
Inputs: plan_path (required), env, llm_model, project_dir, +1 more. Returns: _mcp_instructions
pio_uploadA
Build and flash firmware to the connected board (pio run -t upload). Refuses while a serial monitor session holds the port unless stop_open_sessions=true, which closes our own session(s) first. Pass upload_port when several boards are attached. Port failures come back classified (port_busy, port_permission, port_missing, no_response) with a port_diagnosis naming the holder and the fix. Blocked when PLATFORMIO_MCP_POLICY is build_only or read_only.
Inputs: env, llm_model, project_dir, upload_port, +2 more. Returns: _mcp_instructions
pio_upload_otaA
Flash firmware over Wi-Fi to an ESP32/ESP8266 running ArduinoOTA (espota). Give host (IP or name.local); port defaults to 3232 (ESP32) / 8266 (ESP8266) and auth is the ArduinoOTA password. By default it resolves and pings the host first, then runs pio run -t upload --upload-port <host> so the image matches the current build; build=false sends the existing .pio/build//firmware.bin with espota.py directly. filesystem=true sends the SPIFFS/LittleFS image instead. Failures are mapped to what to fix: no_response (ArduinoOTA.handle not running), auth_failed, no_callback (firewall), device_rejected (partition table has no OTA slot). Blocked under build_only/read_only policy.
Inputs: host (required), env, auth, port, +7 more. Returns: _mcp_instructions
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 44 tools
Most tools target clearly distinct resources and actions (board lookup, project init, build, package management, debugging, diagnostics). There is some overlap in the upload/flash cluster (pio_upload, pio_run_target, pio_flash_and_verify, pio_upload_ota) and in monitor/test workflows, but the detailed descriptions make the intended boundaries mostly clear.
Every tool uses the pio_ prefix with snake_case and a predictable domain_action or action_domain pattern. The convention is consistent throughout, making names easy to scan and group.
At 44 tools, the surface is far above the typical 3-15 range and includes many specialized diagnostics and workflow variants. While each tool may be useful, the sheer count makes the set heavy for an agent to navigate efficiently.
The server covers the embedded development lifecycle comprehensively: project setup, board discovery, build, upload, serial monitoring, package management, testing, debugging, OTA, partition validation, coredumps, power profiling, and memory diagnostics. Any remaining gaps, such as deleting an environment or project, are minor and not central to the main workflows.
Maintenance
Related MCP Connectors
Run, build, and validate firmware on virtual hardware from your AI agent. Hardware knowledge corpus.
Design circuits, simulate and verify embedded firmware, and lay out PCBs with AI agents.
Build, validate, test-run and publish AIOS workflows from Claude Code, Codex, Cursor or VS Code.
Build, run, debug, test and ship Chrome, Firefox, Edge and Safari extensions from your AI agent.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI-driven embedded development: generate, build, flash, and debug firmware using natural language commands through MCP.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to build, flash, and monitor ESP-IDF projects on real hardware, including serial sessions and pytest-embedded hardware tests.1MIT
- FlicenseAqualityCmaintenanceEnables AI agents to compile, flash, erase, and read serial output from embedded development boards, with guardrails such as budget limits, serial port mutexes, and mandatory human confirmation for destructive operations.5-
- AlicenseNot gradedqualityBmaintenanceEnables MCP clients and AI agents to drive PlatformIO embedded workflows including board discovery, project setup, build, flash, monitor, diagnostics, and task orchestration, with policy-gated approvals and dashboard visibility.755 npm56MIT