Quickstart: connect Claude Code or Claude Desktop to a microcontroller
Three steps: install the vendor CLI for your board, register the server with your MCP client, and ask the agent to list your boards. The config below is copied from the server's own README.
Last checked against the source code on 2026-09-20.
1. Install the CLI for your board
The server finds boards by USB vendor ID and product ID and flashes them with the vendor's own tool. Install only the ones you need:
- ESP32 family:
pip install esptool - Raspberry Pi RP2040 / RP2350:
brew install picotool, or skip it and let the server copy the .uf2 file to the board's BOOTSEL drive - Arduino Uno R4:
brew install arduino-cli
2. Get the server
The published install command will be npm install -g @mcuport/server, which puts a mcuport command on your PATH. The package is not published to npm yet, so today the server is built from source: run npm install and npm run build in the server/ directory, which writes dist/index.js.
3. Register it with Claude Code or Claude Desktop
For Claude Desktop on macOS, edit ~/Library/Application Support/Claude/claude_desktop_config.json. Claude Code reads the same mcpServers shape from its config, or you can use claude mcp add. With the npm install:
{
"mcpServers": {
"mcuport": {
"command": "mcuport",
"env": {
"MCUPORT_LICENSE_KEY": "only needed for the Pro phone bridge"
}
}
}
}From a source build, point the client at Node and the built entry point:
{
"mcpServers": {
"mcuport": {
"command": "node",
"args": ["/absolute/path/to/mcu-mcp/server/dist/index.js"]
}
}
}The same source build registered from the Claude Code command line:
claude mcp add mcuport -- node /absolute/path/to/mcu-mcp/server/dist/index.jsLeave MCUPORT_LICENSE_KEY out entirely on the free tier. Restart the client after editing its config so it starts the server.
4. The tools your agent gets
| Tool | What it does |
|---|---|
list_boards | Lists connected boards detected by USB VID/PID, with each one's serial path and family, plus the phone bridge (Pro) and, with MCUPORT_SIMULATOR=1, three simulated boards |
board_info | What a port is running (MicroPython and its version, or the bridge sketch) and its family; the first call when a pin tool fails |
flash_firmware | Flashes a board through esptool, picotool (or a UF2 copy) or arduino-cli |
board_reset | Run-mode reset or bootloader entry via DTR/RTS on an ESP32, or the 1200-baud touch on a Pico or Arduino R4 |
install_bridge_sketch | Uploads the bridge sketch to an Arduino so the pin and bus tools work there |
serial_open | Opens a serial port at a baud rate (default 115200) and returns a handle; an always-on 1 MiB buffer keeps what the board prints between calls |
serial_read | Reads what the board printed since the last read, as text and base64, with a dropped-bytes count and an optional until regex to wait for a line |
serial_write | Writes base64-encoded bytes to a handle |
serial_close | Closes a handle |
gpio_mode, gpio_read, gpio_write | Sets a pin's mode and pull, reads its level, or drives it high or low |
adc_read | Reads an analog input, raw and as estimated volts, with optional averaging |
pwm_write | Starts PWM on a pin at a frequency and duty cycle |
i2c_scan, i2c_read, i2c_write | Scans an I2C bus for devices, and reads or writes a device register |
spi_transfer | Sends bytes over SPI and returns what came back |
mpy_exec | Runs MicroPython code on the board and returns its output or traceback |
compile_sketch | arduino-cli compile with the compiler's diagnostics returned as data |
build_project | PlatformIO pio run, optionally uploading, with diagnostics returned as data |
That is the whole tool list: 21 tools. The pin and bus tools need no custom firmware on an ESP32 or Pico that runs MicroPython; they drive it through its raw REPL, the way mpremote does. An Arduino has no interpreter, so install_bridge_sketch puts a small sketch on it first. The server does not run ESP-IDF or Pico SDK CMake builds; your agent does that with the toolchain you already use, then calls flash_firmware with the output.
What is proven where, as of 2026-09-20
Nothing in the server has been run on a real board by the studio yet, and this page will say so until it has. list_boards, flash_firmware and the serial tools are proven by unit tests over a mocked serial port. The GPIO, ADC, PWM, I2C, SPI, mpy_exec and board_info tools are proven against the real MicroPython interpreter (its WebAssembly build) with only the machine module faked, and, for an Arduino, against an emulator of the bridge sketch's protocol; the sketch itself has not been compiled. compile_sketch and build_project are proven against recorded arduino-cli and PlatformIO output. Set MCUPORT_SIMULATOR=1 to get the same three simulated boards the tests use, so your agent can be exercised end to end before a board arrives.
5. First prompt
Plug a board in and ask the agent: "List my connected boards, then open the serial port of the first one at 115200 and show me what it prints." A misconfigured tool fails loudly: an unknown board family, a missing CLI or a half-configured phone bridge each come back as an error result with the reason, never as an empty success.
Guides for specific boards: ESP32 with Claude Code, Raspberry Pi Pico, Arduino Uno R4, and the phone bridge.
Frequently asked questions
- Do I need a license key to use the MCP server?
- No. All 21 tools, from list_boards and flash_firmware through the serial, GPIO, ADC, PWM, I2C, SPI and build tools, work with no key set, for every supported board family and any number of local USB boards. MCUPORT_LICENSE_KEY is only read when you use the phone bridge, which is the Pro unlock.
- Which MCP clients does it work with?
- Any client that can start a stdio MCP server: Claude Code, Claude Desktop, Cursor and others. The server speaks MCP over stdin and stdout, so the client starts it as a local process and nothing listens on a network port.
- Why does flashing fail with a 'not found on PATH' message?
- The server never bundles vendor tools. It calls esptool for ESP32, picotool for the Pico, arduino-cli for the Uno R4 and PlatformIO for build_project, and when one is missing the tool result names the exact install command so the agent can tell you what to run.
- Can I install it from npm today?
- Not yet. The package is named @mcuport/server but it is not published to the npm registry, so the npm command on this page will fail until it is. Until then the server runs from a source build, using the second config shown on this page.
- Where do I get the Pro license key after buying?
- Checkout emails the key to the address you paid with, and the same key is returned by GET /api/auth/me when you are signed in. Put it in MCUPORT_LICENSE_KEY in the server's env block.