← Crafts
Pio-mcp preview

Pio-mcp

Platform tooling Solo engineer

An MCP server that wraps PlatformIO Core CLI commands — embedded builds, uploads, and board operations exposed as typed tools for agent workflows.

Problem

Embedded development in agent-assisted editors still means dropping to a terminal for pio run, pio test, and board-specific flags. Agents cannot see PlatformIO unless you hand-copy command output back into context.

pio-mcp loads command definitions from YAML, registers them as MCP tools, and executes PlatformIO through a sanitized executor with structured error handling.

Server capabilities

  • Dynamic tool registration from pio_commands.yaml configuration
  • stdio MCP transport compatible with Claude Desktop and other MCP hosts
  • Generic tool handler that maps MCP calls to argv execution
  • Config loader with validation and structured logging
  • Sanitized command output suitable for agent consumption
CallTool (e.g. pio_run) load command config argv execution stdout/stderr TextContent result Agent pio-mcp server PlatformIO CLI
MCP to PlatformIO
class McpServerApp:
    def __init__(self, config_path: Path):
        self.config_loader = ConfigLoader(self.config_path)
        self.app = mcp.server.Server(
            "pio-mcp",
            "0.1.0",
            capabilities=mcp.types.ServerCapabilities(tools={})
        )

    def _load_and_register_tools(self):
        self._command_configs = self.config_loader.load_config()
        self._tool_handler = GenericToolHandler(self._command_configs)
pio-mcp tool list placeholder
Screenshot placeholder — swap for an MCP client showing registered PlatformIO tools.