Skip to content

MCP/U

Transform any Arduino-compatible MCU into an AI-ready device via the Model Context Protocol.
⚡ by 2edge.co · LGPL-3.0

Self-Describing Firmware

Devices auto-declare their tools via JSON Schema. The client registers tools dynamically — zero hardcoded names.

Universal Transport

Serial and WiFi (TCP) — one library, one API, any Arduino Stream.

Minimalist Integration

Just add_pin(), add_tool(), begin(). No protocol complexity in your sketch.

Multi-Device Ready

Connect any number of MCUs to a single MCP client. Tools auto-namespaced per device.


graph LR
A["Claude / LLM"]
B["mcpu-client (npm)<br/>Dynamic tool regist."]
C["MCU Firmware<br/>MCP-U lib"]
A <-->|"MCP (stdio)"| B
B <-->|"Serial / TCP"| C
  1. Client connects to MCU over Serial or TCP
  2. Calls list_tools — MCU responds with full tool + pin registry (JSON Schema)
  3. Client dynamically registers one MCP tool per MCU tool
  4. Claude can now call any MCU tool by name

#include <MCP-U.h>
McpDevice mcp("my-device", "1.0.0");
void setup() {
mcp.add_pin(2, "led", MCP_DIGITAL_OUTPUT, "Onboard LED");
mcp.add_pin(34, "sensor", MCP_ADC_INPUT, "Analog Sensor");
mcp.begin(Serial, 115200);
}
void loop() { mcp.loop(); }

Every device running MCP/U exposes these tools automatically:

ToolDescription
list_toolsDiscovery: tools + pin registry
get_infoDevice name, version, platform
gpio_writeSet digital output HIGH / LOW
gpio_readRead digital level
pwm_writePWM output (duty 0–255)
adc_readRead ADC value (volts on ESP32, mv on AVR)

Firmware API →

The complete McpDevice API: pins, tools, transport, and error handling. Read reference

Client Setup →

Configure the TypeScript MCP client for any AI agent. Read guide