platformio.mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| PLATFORMIO_MCP_PIO | No | Explicit path to the pio executable | auto-detect |
| PLATFORMIO_MCP_POLICY | No | Policy level: full, build_only, or read_only | full |
| PLATFORMIO_MCP_LOG_DIR | No | Where full command logs go | ~/.platformio-mcp/logs |
| PLATFORMIO_MCP_MAX_LOGS | No | How many log files to keep | 200 |
| PLATFORMIO_MCP_PROJECT_DIR | No | Project used when a tool is called without project_dir | server's cwd |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
PlatformIO MCP gives you hands on embedded hardware through the PlatformIO CLI.
Typical loop: pio_system_info (also lists installed platforms and tools) -> pio_project_envs (or pio_list_boards + pio_project_init for a new project) -> edit code -> pio_build (fix the returned errors; envs=[...] builds several envs in one call) -> pio_list_devices -> pio_flash_and_verify(expect="") which flashes, watches the boot log, and returns pass/fail with any crash decoded to file:line. For finer control use pio_upload then pio_monitor_capture or pio_monitor_start/pio_monitor_read with wait_for (an unmatched pattern returns ok=false, error=pattern_timeout). When the device prints a Guru Meditation / HardFault dump, call pio_decode_backtrace (on RISC-V ESP32 chips include the whole 'Stack memory:' block; it is unwound with GDB). When flash or RAM is tight, call pio_size_report to see the biggest symbols and files. Use pio_test for Unity tests and pio_check for static analysis. Every tool returns ok, a one-paragraph summary, structured fields, and a log_path with the full command output when it was long. Stop monitor sessions before flashing (or pass stop_open_sessions=true). When an upload cannot open the port, the result carries port_diagnosis; pio_port_diagnose gives the same answer on demand. On ESP32 call pio_partition_table before changing partitions or when a flash looks fine but the device misbehaves, and pio_coredump after a crash to pull and decode the core dump. pio_memory_watch turns heap/stack prints into leak and stack-headroom verdicts; pio_power_profile measures current from a serial meter or a PPK2. pio_deps_check audits lib_deps for name collisions and cycles. pio_upload_ota flashes over Wi-Fi. pio_debug_start opens a GDB session through the debug probe; drive it with pio_debug_cmd (bt, break, next, continue, p var) and stop it before flashing. For repeatable hardware checks use pio_test_plan_validate/start/status/cancel with a declarative JSON plan; it records per-iteration pass/fail/timeout/infra_error outcomes, evidence logs, and firmware/source identity. When a tool schema includes context, describe the user's goal and why this call helps achieve it in a short sentence. When available tools cannot fulfill the user's request, call get_more_tools if it is advertised, with context describing that goal and the missing capability. It records developer feedback; it does not add tools. Omit secrets and private source code from context. Do not report unavailable hardware or a failed operation as a missing server capability.
Active policy: full.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| 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. |
| 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 |
| pio_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. |
| pio_project_initA | Create a new PlatformIO project (or add an environment to an existing one) with |
| 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. |
| 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. |
| pio_buildA | Compile the project ( |
| pio_uploadA | Build and flash firmware to the connected board ( |
| pio_cleanA | Delete build artifacts for an env ( |
| pio_list_targetsB | List extra build targets the platform offers for this project, such as buildfs, uploadfs, erase, size, or menuconfig. |
| 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. |
| pio_list_devicesA | List serial ports ( |
| 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. |
| 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. |
| pio_monitor_readA | Read new serial lines from a session since |
| 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. |
| pio_monitor_stopC | Close a serial monitor session and release the port. |
| pio_monitor_listA | List open serial monitor sessions with port, baud, buffered line count, and next cursor. |
| pio_monitor_captureA | One-shot serial capture with no session to manage: open the port, collect output for up to |
| pio_testA | Run PlatformIO unit tests ( |
| pio_checkA | Static analysis ( |
| 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'. |
| pio_pkg_installA | Install a library/platform/tool into the project and add it to platformio.ini ( |
| pio_pkg_uninstallC | Remove a library/platform/tool from the project and platformio.ini. |
| pio_pkg_listC | List resolved platform, toolchain, and library packages for the project with versions. |
| pio_pkg_outdatedC | Show which project dependencies have newer versions available. |
| pio_pkg_updateC | Update dependencies within the version ranges declared in platformio.ini. |
| pio_decode_backtraceA | Turn a crash dump into source locations. Give |
| 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; |
| pio_flash_and_verifyA | Hardware-in-the-loop check with no human: build + flash ( |
| 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. |
| 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. |
| 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. |
| 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. |
| pio_upload_otaA | Flash firmware over Wi-Fi to an ESP32/ESP8266 running ArduinoOTA (espota). Give |
| 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. |
| 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 ( |
| pio_power_profileA | Measure the device's current draw for |
| 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_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 |
| pio_debug_startA | Open a live gdb session on the board through its debug probe ( |
| pio_debug_cmdA | Send one gdb command to an open debug session and get its output back, parsed from GDB/MI: |
| pio_debug_stopA | Quit gdb and the debug server, resume the target, and free the probe so pio_upload works again. |
| pio_debug_listB | List open debug sessions with env, debug tool, running/halted state, and the last stop frame. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
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.