PlatformIO MCP Server
PlatformIO for AI agents: build, flash, serial monitor, tests, crash decoding, size reports.
PlatformIO scores 70 (Good), licensed MIT and written in Python. It installs as a local process. It does not declare tools yet. Filed under Uncategorized. GitHub shows 10 stars. Package registries report about 179 downloads a week. Install configs are generated for 12 clients. Being listed in the registry is not the same as being vendor-official.
Good trust
70 of 100 from six public signals. Nobody can buy a point.
- Listed in the official MCP registry.
- OSI-style license: mit.
License, quality and maintenance
Quality: Grade C
65/100 for listing completeness. Lost points: no listed tools, short summary.
How quality is graded
Where the 70 comes from
22 + 20 + 7 + 10 + 4 + 7 = 70. Each factor is capped, so no single signal can carry a listing.
Active in the official MCP registry, plus a known vendor namespace.
Registry: 22 of 30 points.How recently the repository saw a commit or release.
Maintenance: 20 of 20 points.GitHub stars and weekly downloads, on a log scale.
Popularity: 7 of 20 points.A clear, OSI-style open-source license.
License: 10 of 10 points.Not archived, a secure install path, a pinned version.
Security: 4 of 10 points.A real summary, a README with depth, listed tools.
Docs: 7 of 10 points.Install
Pick your client, copy the config, paste it in.
Needs Cursor or VS Code installed on this device. The button opens the app and asks you to confirm before it adds the server.
{ "mcpServers": { "powerdragonfire-platformio-mcp": { "command": "uvx", "args": [ "platformio.mcp" ], "env": { "PLATFORMIO_MCP_POLICY": "full", "PLATFORMIO_MCP_PROJECT_DIR": "", "PLATFORMIO_MCP_PIO": "" } } }}
Environment variables
| Name | Required | Notes |
|---|---|---|
PLATFORMIO_MCP_POLICY | Optional | full (default), build_only, or read_only |
PLATFORMIO_MCP_PROJECT_DIR | Optional | Default project directory when a tool is called without project_dir |
PLATFORMIO_MCP_PIO | Optional | Explicit path to the pio executable (auto-detected otherwise) |
Tools
All capabilitiesTools show up when the registry metadata or the repository README lists them. Public READMEs are read directly. A GitHub token is used only when one is already configured.
About
⚡ 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 --windsurf
No 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.
The repo follows the Open Plugins layout: .mcp.json, skills/platformio/SKILL.md, rules/platformio.mdc, plugin.json.
claude plugin marketplace add powerdragonfire/platformio.mcp # Claude Code
claude plugin install platformio@platformio.mcp
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.
🎬 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 40 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 | |
|---|---|---|
🚀 pio_flash_and_verify | Flash, open the port, read until expect matches (pass), a crash signature matches (fail, auto-decoded), or the timeout passes (timeout) | pio run -t upload + pyserial; fail_on defaults to Guru Meditation, HardFault, abort(), assert failed, watchdog, brownout, heap corruption |
🔁 pio_test_plan_* | Run a declarative hardware test plan for N iterations with cancellation, per-iteration verdicts (pass/fail/timeout/infra_error), and evidence logs | Reuses upload + serial monitor tools, continues observing for a post-success window, and writes machine-readable reports with source+firmware identity |
🩺 pio_decode_backtrace | Turn an ESP32 Backtrace: 0x400d... dump or a Cortex-M pc/lr dump into function, file, line, inlined frames, cause, reset reason | Toolchain located from pio project metadata, then <target>-addr2line -pfiaC on firmware.elf; fixes Xtensa A0 window bits |
📊 pio_size_report | Why is the firmware this big? Flash/RAM %, loaded sections, biggest symbols with file:line, per-file totals, regex filter | pio run -t checkprogsize (partition-aware) + GNU size -A + nm -S -C -l --size-sort |
💾 pio_partition_table | 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; read_device=true reads 0x8000 with esptool read_flash and diffs |
🧯 pio_coredump | Pull the core dump from the coredump partition after a crash and decode task, registers, and backtrace | esptool read_flash + optional esp-coredump info_corefile (platformio.mcp[coredump]) |
📈 pio_memory_watch | Leak, fragmentation, and stack-headroom verdicts from what the firmware already prints | Parses Free heap:, heap_caps_print_heap_info, vTaskList, uxTaskGetStackHighWaterMark lines; least-squares slope |
🔋 pio_power_profile | 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 (platformio.mcp[power]) |
🐞 pio_debug_* | Breakpoints, step, backtrace, and variable inspection through the debug probe | pio debug --interface=gdb driven over GDB/MI with parsed *stopped events |
🌐 pio_upload_ota | Flash over Wi-Fi with failures mapped to the fix (wrong password, no ArduinoOTA.handle(), firewall, no OTA slot) | pio run -t upload --upload-port <ip> (espota auto-switch) or espota.py directly |
🔌 pio_port_diagnose | Why the upload cannot open the port: our session, another process, permissions, or a board not in bootloader mode | lsof/fuser + pio device list; never kills anything |
📚 pio_deps_check | Library name collisions where lib_deps order silently picks the winner, unpinned specs, leftovers, cycles | Manifests in .pio/libdeps and lib/, plus the LDF dependency graph with build=true |
🔁 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 |
|---|---|---|---|
full (default) | ✅ | ✅ | Your own bench |
build_only | ✅ | ❌ | Shared labs, CI, "look but don't touch" |
read_only | ❌ | ❌ | 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 |
|---|---|---|
PLATFORMIO_MCP_POLICY | full, build_only, read_only | full |
PLATFORMIO_MCP_PROJECT_DIR | Project used when a tool is called without project_dir | server's cwd |
PLATFORMIO_MCP_PIO | Explicit path to the pio executable | auto-detect |
PLATFORMIO_MCP_LOG_DIR | Where full command logs go | ~/.platformio-mcp/logs |
PLATFORMIO_MCP_MAX_LOGS | How many log files to keep | 200 |
📝 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.
🛠️ 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 interactively
To use your checkout in Claude Code instead of the PyPI release:
claude mcp add platformio -- uv run --directory /path/to/platformio.mcp platformio-mcp
Changes 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
Frequently asked questions
What is PlatformIO MCP Server?
PlatformIO for AI agents: build, flash, serial monitor, tests, crash decoding, size reports.
How do I install PlatformIO MCP Server in Claude Desktop, Cursor, or VS Code?
Pick your client in the Install section on this page and copy the generated config into the client's config file. Step-by-step guides: Claude Desktop, Cursor, and VS Code. PlatformIO MCP Server runs locally from the PyPI package platformio.mcp with the command uvx platformio.mcp.
Is PlatformIO MCP Server free and open source?
Yes. PlatformIO MCP Server is released under the MIT license, an OSI-approved open-source license, so you can use, modify, and self-host it under those terms.
Does PlatformIO MCP Server support remote (HTTP) connections?
No remote endpoint is listed for PlatformIO MCP Server. It runs locally on your machine over stdio, started by your MCP client.
How is PlatformIO MCP Server's trust score calculated?
PlatformIO MCP Server scores 70 out of 100 (Good). The score adds six capped public signals: registry status, maintenance, popularity, license, documentation, and security. Nobody can pay for points. Read the methodology for the full formula.
Reviews
No reviews yet—Be the first to review
No published reviews yet. Used it? Tell the next person how it went.
Sign inA verified email is required to review this server.
Add badge to your README
Paste either snippet into the repository README. The image links to this listing.