Connect via Serial (USB)
USB Serial is the simplest way to connect your MCU to MCP/U. It works with any Arduino-compatible board and requires no network configuration.
Finding Your Serial Port
Section titled “Finding Your Serial Port”-
Connect your board via USB
-
Find the port using the commands below for your operating system:
ls /dev/ttyUSB* /dev/ttyACM*Typical output: /dev/ttyUSB0 or /dev/ttyACM0
ls /dev/tty.usbserial-* /dev/ttyUSB*Typical output: /dev/cu.usbserial-1420 or /dev/cu.usbserial-*
Open Device Manager → Ports (COM & LPT)
Typical output: COM3, COM4, etc.
Linux: Fix Permission Issues
Section titled “Linux: Fix Permission Issues”On Linux, you may get a “Permission denied” error when accessing the serial port. This is because only members of the dialout group can access serial devices.
-
Add your user to the dialout group
Terminal window sudo usermod -aG dialout $USER -
Log out and log back in (or reboot)
-
Verify membership
Terminal window groups | grep dialout
Configuring the Agent
Section titled “Configuring the Agent”Once you know your serial port, configure your AI agent:
{ "mcpServers": { "mcpu": { "command": "npx", "args": ["mcpu-client"], "env": { "SERIAL_PORT": "/dev/ttyACM0" } } }}Config file location:
- Linux:
~/.config/claude/claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
claude mcp add mcpu -e SERIAL_PORT=/dev/ttyACM0 -- npx mcpu-clientEdit ~/.gemini/settings.json:
{ "mcpServers": { "mcpu": { "command": "npx", "args": ["mcpu-client"], "env": { "SERIAL_PORT": "/dev/ttyACM0" } } }}Edit opencode.json:
{ "$schema": "https://opencode.ai/config.json", "mcp": { "mcpu": { "type": "local", "command": ["npx", "mcpu-client"], "enabled": true, "environment": { "SERIAL_PORT": "/dev/ttyACM0" } } }}Custom Baud Rate
Section titled “Custom Baud Rate”The default baud rate is 115200. If your project uses a different rate:
SERIAL_PORT=/dev/ttyACM0 SERIAL_BAUD=9600 npx mcpu-clientIn agent config:
"env": { "SERIAL_PORT": "/dev/ttyACM0", "SERIAL_BAUD": "9600"}Multiple Serial Devices
Section titled “Multiple Serial Devices”For more than one serial device, use the DEVICES format:
DEVICES=robot:/dev/ttyUSB0:115200,display:/dev/ttyACM0:115200 npx mcpu-clientFormat: id:port:baud
See Multi-Device Setup for full details.
Common Issues
Section titled “Common Issues”Device Not Appearing
Section titled “Device Not Appearing”- Check the USB cable — some charge-only cables don’t carry data
- Try a different USB port — some ports may not provide enough power
- Check if it’s detected:
ls /dev/tty*before and after plugging in
Wrong Baud Rate
Section titled “Wrong Baud Rate”If you see garbled output in Serial Monitor, verify the baud rate matches what your firmware uses (default 115200).
Port In Use
Section titled “Port In Use”Another application may be holding the port:
# Linuxlsof /dev/ttyACM0Close any other Serial Monitor instances or Arduino IDE upload windows.
Next Steps
Section titled “Next Steps”- Add a Sensor or Peripheral — wrap sensors in custom tools
- Connect via WiFi TCP — for wireless connections
- Debug Connection Issues — troubleshooting guide