Use Descriptive IDs
Choose IDs that describe the device: robot, display, sensor, weather-station — not dev1, dev2.
MCP/U supports connecting multiple devices simultaneously. Each device gets a unique ID that’s used to prefix all its tools, preventing name collisions.
The DEVICES environment variable accepts a comma-separated list of devices:
| Transport | Format | Example |
|---|---|---|
| Serial | id:port:baud | robot:/dev/ttyUSB0:115200 |
| TCP | id:host:port:tcp | sensor:192.168.1.42:3000:tcp |
# Two serial devicesDEVICES=robot:/dev/ttyUSB0:115200,display:/dev/ttyACM0:115200
# Serial + TCP mixedDEVICES=robot:/dev/ttyUSB0:115200,sensor:192.168.1.42:3000:tcp
# Multiple TCP devicesDEVICES=esp1:192.168.1.10:3000:tcp,esp2:192.168.1.11:3000:tcpWhen multiple devices are connected, tool names are prefixed with the device ID:
| Scenario | Tool name format | Example |
|---|---|---|
| Single device | {tool_name} | gpio_write |
| Multiple devices | {device_id}__{tool_name} | robot__gpio_write |
So if you have a robot device and a display device:
robot__gpio_writerobot__hellodisplay__gpio_writedisplay__show_textSerial + TCP mixed:
{ "mcpServers": { "mcpu": { "command": "npx", "args": ["mcpu-client"], "env": { "DEVICES": "robot:/dev/ttyUSB0:115200,sensor:192.168.1.42:3000:tcp" } } }}Config file location:
~/.config/claude/claude_desktop_config.json~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.jsonclaude mcp add mcpu -e DEVICES=robot:/dev/ttyUSB0:115200,sensor:192.168.1.42:3000:tcp -- npx mcpu-clientEdit ~/.gemini/settings.json:
{ "mcpServers": { "mcpu": { "command": "npx", "args": ["mcpu-client"], "env": { "DEVICES": "robot:/dev/ttyUSB0:115200,sensor:192.168.1.42:3000:tcp" } } }}Edit opencode.json:
{ "$schema": "https://opencode.ai/config.json", "mcp": { "mcpu": { "type": "local", "command": ["npx", "mcpu-client"], "enabled": true, "environment": { "DEVICES": "robot:/dev/ttyUSB0:115200,sensor:192.168.1.42:3000:tcp" } } }}Imagine a robot arm on /dev/ttyUSB0 and an OLED display on /dev/ttyACM0:
DEVICES=arm:/dev/ttyUSB0:115200,display:/dev/ttyACM0:115200Tools available:
arm__gpio_writearm__adc_readarm__move_servodisplay__show_textdisplay__clearA weather sensor connected via WiFi and a serial gateway:
DEVICES=sensor:192.168.1.50:3000:tcp,gateway:/dev/ttyUSB0:115200When you create your McpDevice, give it a unique ID that matches your configuration:
McpDevice mcp("robot", "1.0.0"); // This becomes the device IDMake sure the ID in your firmware matches the ID in your DEVICES string!
Use Descriptive IDs
Choose IDs that describe the device: robot, display, sensor, weather-station — not dev1, dev2.
Consistent Naming
Keep the same ID across restarts. If you restart and the ID changes, your agent’s tool calls will break.
Mix Freely
Serial and TCP can be combined in any configuration. There’s no limit on mixing.
Check Tool List
Use MCP Inspector or call list_tools to verify all devices are connected and tools are properly namespaced.