PIO Agent — Claude Code MCP server: firmware and setup
PIO Agent lets a coding agent inspect PlatformIO projects, build and flash firmware, and monitor device output. Use it to run embedded-development tasks through an MCP client.
claude mcp add platformio-mcp -- npx -y platformio-mcpWhat PIO Agent does
The server exposes PlatformIO tools for discovering boards and devices, initializing projects, building firmware, flashing hardware, and monitoring serial output. It can also diagnose build and upload failures, audit GPIO use for board safety, and check runtime output against expected conditions. Add --json to CLI commands when you need machine-readable results.
Policy rules and approval gates apply to risky operations. The agent can inspect approval status, while a person retains control over approval. Flashing is therefore subject to those checks. In Claude Code, connect the server with claude mcp add platformio-mcp -- npx -y platformio-mcp; each session using this setup starts its own server process.
What it helps with
- discover connected boards and devices
- initialize a PlatformIO project for a board
- build firmware and inspect build failures
- flash a device and check serial output
- audit GPIO use against board safety
Example prompts for the agent
- Find the connected boards and devices with PIO Agent.
- Build the PlatformIO project in
./firmwareand return JSON output. - Flash the project in
./firmwareand check the monitor forBOOT_OK.
How to install PIO Agent
Platform CLI
claude mcp add platformio-mcp -- npx -y platformio-mcpPlatform CLI
codex mcp add pio-agent -- npx -y platformio-mcpConfig file
{
"mcpServers": {
"pio-agent": {
"command": "npx",
"args": [
"-y",
"platformio-mcp"
]
}
}
}Config file
{
"servers": {
"pio-agent": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"platformio-mcp"
]
}
}
}Platform CLI
gemini mcp add pio-agent npx -y platformio-mcpStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about PIO Agent
How do I install PIO Agent in Claude Code?
Run claude mcp add platformio-mcp -- npx -y platformio-mcp. An alternative server name is pio-agent: claude mcp add pio-agent -- npx -y platformio-mcp.
What does PIO Agent do?
It gives an agent PlatformIO tools to find boards, set up projects, build and flash firmware, and monitor devices. It also provides diagnostics and GPIO safety audits.
Who approves risky operations?
Policy rules and approval gates govern risky actions. The agent can read approval status, but approval remains under human control.