Quick Start
Prerequisites
Section titled “Prerequisites”- ESP32 board (or any Arduino-compatible MCU)
- PlatformIO or Arduino IDE
- Node.js 18+
- Claude Desktop or any MCP-compatible agent (Claude Code, Gemini CLI, etc.)
Step 1 — Choose a Transport
Section titled “Step 1 — Choose a Transport”MCP/U supports two transports. Pick one based on your setup:
| Serial (USB) | WiFi TCP | |
|---|---|---|
| Cable required | Yes | No |
| Board support | All | ESP32 / ESP8266 |
| Setup complexity | Minimal | Needs SSID + password |
| Use case | Development | Deployment / wireless |
Step 2 — Flash Firmware
Section titled “Step 2 — Flash Firmware”Clone the repo and flash the matching example:
Serial
Section titled “Serial”git clone https://github.com/ThanabordeeN/mcpucd mcpu/firmwarepio run -t uploadOr open firmware/ in Arduino IDE and upload src/main.cpp.
The default example exposes:
- GPIO 2 —
led(digital output) - GPIO 5 —
buzzer(digital output) - GPIO 34 —
sensor(ADC input)
WiFi TCP
Section titled “WiFi TCP”Edit the credentials at the top of the sketch before uploading:
static const char* WIFI_SSID = "YOUR_SSID";static const char* WIFI_PASSWORD = "YOUR_PASSWORD";static const uint16_t TCP_PORT = 3000;After flashing, open the Serial Monitor — the ESP32 prints its IP address on boot:
Connecting to WiFi....IP: 192.168.1.42TCP server listening on port 3000Note that IP — you’ll need it in Step 4.
Step 3 — Find your serial port
Section titled “Step 3 — Find your serial port”(Skip this step if you’re using WiFi TCP.)
Linux:
ls /dev/ttyUSB* /dev/ttyACM*macOS:
ls /dev/tty.usbserial-*Windows: Device Manager → Ports (COM & LPT)
Step 4 — Add to your AI agent
Section titled “Step 4 — Add to your AI agent”The MCP/U client is published on npm — no local clone needed.
Claude Desktop
Section titled “Claude Desktop”Serial — Linux / macOS (~/.config/claude/claude_desktop_config.json):
{ "mcpServers": { "mcpu": { "command": "npx", "args": ["mcpu-client"], "env": { "SERIAL_PORT": "/dev/ttyACM0" } } }}Serial — Windows (%APPDATA%\Claude\claude_desktop_config.json):
{ "mcpServers": { "mcpu": { "command": "npx", "args": ["mcpu-client"], "env": { "SERIAL_PORT": "COM3" } } }}WiFi TCP (replace IP with the one printed by your ESP32):
{ "mcpServers": { "mcpu": { "command": "npx", "args": ["mcpu-client"], "env": { "DEVICES": "mydevice:192.168.1.42:3000:tcp" } } }}Multiple devices (mix Serial and TCP freely):
{ "mcpServers": { "mcpu": { "command": "npx", "args": ["mcpu-client"], "env": { "DEVICES": "robot:/dev/ttyUSB0:115200,sensor:192.168.1.42:3000:tcp" } } }}Claude Code (CLI)
Section titled “Claude Code (CLI)”# Serialclaude mcp add mcpu -e SERIAL_PORT=/dev/ttyACM0 -- npx mcpu-client
# WiFi TCPclaude mcp add mcpu -e DEVICES=mydevice:192.168.1.42:3000:tcp -- npx mcpu-clientGemini CLI
Section titled “Gemini CLI”Edit ~/.gemini/settings.json:
Serial:
{ "mcpServers": { "mcpu": { "command": "npx", "args": ["mcpu-client"], "env": { "SERIAL_PORT": "/dev/ttyACM0" } } }}WiFi TCP:
{ "mcpServers": { "mcpu": { "command": "npx", "args": ["mcpu-client"], "env": { "DEVICES": "mydevice:192.168.1.42:3000:tcp" } } }}OpenCode
Section titled “OpenCode”opencode.json — Serial:
{ "$schema": "https://opencode.ai/config.json", "mcp": { "mcpu": { "type": "local", "command": ["npx", "mcpu-client"], "enabled": true, "environment": { "SERIAL_PORT": "/dev/ttyACM0" } } }}WiFi TCP — replace SERIAL_PORT with DEVICES:
"environment": { "DEVICES": "mydevice:192.168.1.42:3000:tcp" }Restart your agent. Claude can now control your MCU.
Verify with MCP Inspector
Section titled “Verify with MCP Inspector”SERIAL_PORT=/dev/ttyACM0 npx @modelcontextprotocol/inspector npx mcpu-clientOpen the browser URL shown and try calling list_devices or gpio_write.
Next Steps
Section titled “Next Steps”- Firmware Guide — full
McpIotAPI reference - Client Guide — multi-device setup, TCP transport
- Protocol Spec — JSON-RPC wire format