Skip to content

Multi-Device Setup

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:

TransportFormatExample
Serialid:port:baudrobot:/dev/ttyUSB0:115200
TCPid:host:port:tcpsensor:192.168.1.42:3000:tcp
Terminal window
# Two serial devices
DEVICES=robot:/dev/ttyUSB0:115200,display:/dev/ttyACM0:115200
# Serial + TCP mixed
DEVICES=robot:/dev/ttyUSB0:115200,sensor:192.168.1.42:3000:tcp
# Multiple TCP devices
DEVICES=esp1:192.168.1.10:3000:tcp,esp2:192.168.1.11:3000:tcp

When multiple devices are connected, tool names are prefixed with the device ID:

ScenarioTool name formatExample
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_write
  • robot__hello
  • display__gpio_write
  • display__show_text

Serial + 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:

  • Linux: ~/.config/claude/claude_desktop_config.json
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Imagine a robot arm on /dev/ttyUSB0 and an OLED display on /dev/ttyACM0:

Terminal window
DEVICES=arm:/dev/ttyUSB0:115200,display:/dev/ttyACM0:115200

Tools available:

  • arm__gpio_write
  • arm__adc_read
  • arm__move_servo
  • display__show_text
  • display__clear

A weather sensor connected via WiFi and a serial gateway:

Terminal window
DEVICES=sensor:192.168.1.50:3000:tcp,gateway:/dev/ttyUSB0:115200

When you create your McpDevice, give it a unique ID that matches your configuration:

McpDevice mcp("robot", "1.0.0"); // This becomes the device ID

Make 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.