CLI Commands Reference
Claude Code
Section titled “Claude Code”Add via CLI (recommended)
Section titled “Add via CLI (recommended)”Serial:
claude mcp add --env SERIAL_PORT=/dev/ttyACM0 mcpu -- npx mcpu-clientWiFi TCP:
claude mcp add --env DEVICES=mydevice:192.168.1.42:3000:tcp mcpu -- npx mcpu-clientAll options (--env, --scope, --transport) must come before the server name. The -- separator isolates the command passed to the MCP server.
Or edit .mcp.json (shared with team)
Section titled “Or edit .mcp.json (shared with team)”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" } } }}Verify
Section titled “Verify”claude mcp listOr inside a Claude Code 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 directly
Section titled “Or edit ~/.gemini/settings.json directly”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" } } }}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:
{ "$schema": "https://opencode.ai/config.json", "mcp": { "mcpu": { "type": "local", "command": ["npx", "mcpu-client"], "enabled": true, "environment": { "SERIAL_PORT": "/dev/ttyACM0" } } }}WiFi TCP:
{ "$schema": "https://opencode.ai/config.json", "mcp": { "mcpu": { "type": "local", "command": ["npx", "mcpu-client"], "enabled": true, "environment": { "DEVICES": "mydevice:192.168.1.42:3000:tcp" } } }}Verify
Section titled “Verify”opencode mcp listComparison Summary
Section titled “Comparison Summary”| Claude Code | Gemini CLI | OpenCode | |
|---|---|---|---|
| Add command | claude mcp add --env KEY=VAL mcpu -- npx mcpu-client | gemini mcp add -e KEY=VAL mcpu npx mcpu-client | manual config only |
| Config file | .mcp.json (project) | ~/.gemini/settings.json | opencode.json |
| Env field | "env" | "env" | "environment" |
| Command format | string | string | array |
| Verify | claude mcp list / /mcp | gemini mcp list / /mcp | opencode mcp list |
Finding Serial Port
Section titled “Finding Serial Port”| OS | Typical port |
|---|---|
| Linux | /dev/ttyUSB0 or /dev/ttyACM0 |
| macOS | /dev/cu.usbserial-* |
| Windows | COM3, COM4, … |
# Linux / macOSls /dev/tty*Windows: Device Manager → Ports (COM & LPT)