Connect AI Agents
MCP/U works with any MCP-compatible AI agent. This guide covers configuration for all supported agents.
Quick Reference
Section titled “Quick Reference”| Agent | Config File | Add Command | Env Field |
|---|---|---|---|
| Claude Desktop | claude_desktop_config.json | N/A (manual) | "env" |
| Claude Code | .mcp.json | claude mcp add | "env" |
| Gemini CLI | ~/.gemini/settings.json | gemini mcp add | "env" |
| OpenCode | opencode.json | N/A (manual) | "environment" |
Claude Desktop
Section titled “Claude Desktop”Config file locations:
| OS | Path |
|---|---|
| Linux | ~/.config/claude/claude_desktop_config.json |
| macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Windows | %APPDATA%\Claude\claude_desktop_config.json |
Serial Connection
Section titled “Serial Connection”{ "mcpServers": { "mcpu": { "command": "npx", "args": ["mcpu-client"], "env": { "SERIAL_PORT": "/dev/ttyACM0" } } }}WiFi TCP Connection
Section titled “WiFi TCP Connection”{ "mcpServers": { "mcpu": { "command": "npx", "args": ["mcpu-client"], "env": { "DEVICES": "mydevice:192.168.1.42:3000:tcp" } } }}Mixed Serial + TCP
Section titled “Mixed Serial + TCP”{ "mcpServers": { "mcpu": { "command": "npx", "args": ["mcpu-client"], "env": { "DEVICES": "robot:/dev/ttyUSB0:115200,sensor:192.168.1.42:3000:tcp" } } }}Claude Code
Section titled “Claude Code”Add via CLI (recommended)
Section titled “Add via CLI (recommended)”Serial:
claude mcp add mcpu -e SERIAL_PORT=/dev/ttyACM0 -- npx mcpu-clientWiFi TCP:
claude mcp add mcpu -e DEVICES=mydevice:192.168.1.42:3000:tcp -- npx mcpu-clientMultiple devices:
claude mcp add mcpu -e DEVICES=robot:/dev/ttyUSB0:115200,sensor:192.168.1.42:3000:tcp -- npx mcpu-clientOr edit .mcp.json (project-level, shareable with team)
Section titled “Or edit .mcp.json (project-level, shareable with team)”{ "mcpServers": { "mcpu": { "command": "npx", "args": ["mcpu-client"], "env": { "SERIAL_PORT": "/dev/ttyACM0" } } }}Verify
Section titled “Verify”claude mcp listOr inside a session: /mcp
Gemini CLI
Section titled “Gemini CLI”Add via CLI (recommended)
Section titled “Add via CLI (recommended)”Serial:
gemini mcp add -e SERIAL_PORT=/dev/ttyACM0 mcpu npx mcpu-clientWiFi TCP:
gemini mcp add -e DEVICES=mydevice:192.168.1.42:3000:tcp mcpu npx mcpu-clientOr edit ~/.gemini/settings.json
Section titled “Or edit ~/.gemini/settings.json”{ "mcpServers": { "mcpu": { "command": "npx", "args": ["mcpu-client"], "env": { "SERIAL_PORT": "/dev/ttyACM0" } } }}Verify
Section titled “Verify”gemini mcp listOr inside a session: /mcp
OpenCode
Section titled “OpenCode”OpenCode has no CLI add command — edit opencode.json directly.
Serial Connection
Section titled “Serial Connection”{ "$schema": "https://opencode.ai/config.json", "mcp": { "mcpu": { "type": "local", "command": ["npx", "-y", "mcpu-client"], "enabled": true, "environment": { "SERIAL_PORT": "/dev/ttyACM0" } } }}WiFi TCP Connection
Section titled “WiFi TCP Connection”{ "$schema": "https://opencode.ai/config.json", "mcp": { "mcpu": { "type": "local", "command": ["npx", "-y", "mcpu-client"], "enabled": true, "environment": { "DEVICES": "mydevice:192.168.1.42:3000:tcp" } } }}Verify
Section titled “Verify”opencode mcp listEnvironment Variables Reference
Section titled “Environment Variables Reference”| Variable | Description | Example |
|---|---|---|
SERIAL_PORT | Serial port (single device) | /dev/ttyACM0, COM3 |
SERIAL_BAUD | Baud rate (default: 115200) | 9600 |
DEVICES | Multi-device config | id:port:baud, id:host:port:tcp |
DEVICES Format
Section titled “DEVICES Format”Serial: id:port:baudTCP: id:host:port:tcpExamples:
robot:/dev/ttyUSB0:115200sensor:192.168.1.42:3000:tcprobot:/dev/ttyUSB0:115200,sensor:192.168.1.42:3000:tcp
Summary Table
Section titled “Summary Table”| Serial | WiFi TCP | Multi-Device | |
|---|---|---|---|
| Env var | SERIAL_PORT=/dev/ttyACM0 | DEVICES=id:IP:port:tcp | DEVICES=a:/dev/ttyUSB0:115200,b:IP:port:tcp |
| Windows | SERIAL_PORT=COM3 | same format | same format |
| Claude Desktop | Claude Code | Gemini CLI | OpenCode | |
|---|---|---|---|---|
| Add command | N/A | claude mcp add | gemini mcp add | Manual only |
| Config file | claude_desktop_config.json | .mcp.json | ~/.gemini/settings.json | opencode.json |
| Env field | "env" | "env" | "env" | "environment" |
| Command format | string | string | string | array |
| Verify | Restart app | claude mcp list | gemini mcp list | opencode mcp list |
Next Steps
Section titled “Next Steps”- Connect via Serial — detailed serial setup
- Connect via WiFi TCP — detailed TCP setup
- Multi-Device Setup — multiple MCUs
- Debug Connection Issues — troubleshootingingtroubleshooting