mcp-iot-go
MCP Server for Sensors
Documentation
MCP for IOT
Model Context Protocol (MCP) Server for IoT Devices (Arduino)
Overview
MCP for IOT is a Go implementation of the Model Context Protocol (MCP) server that allows AI models like Claude to directly interact with IoT devices, specifically Arduino boards. This server acts as a bridge between Claude and your Arduino hardware, enabling AI-controlled hardware automation.
Features
- ๐ List available serial ports
- ๐ก Read data from Arduino's serial port
- ๐ฆ Control digital pins (LEDs, relays, etc.)
- ๐ Control buzzers with on/off and duration settings
- ๐ค Seamless integration with Claude AI
Usage
https://github.com/user-attachments/assets/46d7d731-f5d0-4acd-b53e-c00be8b83215
Prerequisites
- Go (version 1.24 or later)
- Arduino hardware with USB connection
- Claude Desktop App or compatible MCP client
Installation
Build from Source
git clone https://github.com/sukeesh/mcp-iot-go.git
cd mcp-iot-go
go installThe binary will be installed to your GOBIN directory, which should be in your PATH.
Arduino Setup
1. Connect your Arduino to your computer
2. Upload the provided Arduino firmware:
arduino/firmware.inoThis firmware accepts commands via serial communication:
- `M,pin,mode` - Sets pin mode (e.g., `M,6,OUTPUT`)
- `D,pin,value` - Controls digital pins (e.g., `D,6,HIGH` or `D,6,LOW`)
- `BZ,pin,state` - Controls buzzers (e.g., `BZ,8,ON` or `BZ,8,OFF`)
Configuration with MCP Client
Configure Claude Desktop:
1. Open Claude Desktop โ Settings โ Developer โ Edit Config
2. Add the following to your `claude_desktop_config.json`:
{
"mcpServers": {
"iot": {
"command": "",
"env": {}
}
}
}3. Restart Claude Desktop
Available Tools
| Tool | Description |
|---|---|
| `port_list` | Lists all available serial ports |
| `read_serial_line` | Reads a single line of data from a specified serial port |
| `write_digital` | Writes a digital value (HIGH/LOW) to a pin on a specified port |
| `buzzer_control` | Controls a buzzer connected to an Arduino pin with optional duration |
Usage Examples
After setup, you can interact with your Arduino hardware directly through Claude:
- "List all available serial ports"
- "Read data from the Arduino on port /dev/cu.usbmodem12401"
- "Turn on the red LED on pin 6"
- "Activate the buzzer on pin 8 for 2 seconds"
Development
Project Structure
- `main.go` - MCP server setup and tool definitions
- `internal/tools.go` - Tool implementation for Arduino communication
- `arduino/firmware.ino` - Arduino firmware for processing commands
Dependencies
- mcp-go - Go library for MCP implementation
- go.bug.st/serial - Serial port communication library
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Frequently asked questions
What is mcp-iot-go?
mcp-iot-go is MCP Server for Sensors
How do I install mcp-iot-go?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is mcp-iot-go open source?
Yes โ it is hosted on GitHub at https://github.com/sukeesh/mcp-iot-go and has 8 stars.
Related MCP tools
MCP server for Grafana Go-based implementation. Trusted by 1700+ developers. Trusted by 1700+ developers. Trusted by 1700+ developers.
Flux Operator is a Kubernetes controller for managing the lifecycle of Flux CD for the Model Context Protocol. Enhance AI assistants with powerful integrations.
MCP server connecting to Kubernetes Go-based implementation.
:robot: The free, Open Source alternative to OpenAI, Claude and others. Self-hosted and local-first. Drop-in replacement for OpenAI, running on consumer-gra...
MCP Toolbox for Databases is an open source MCP server for databases. Go-based implementation. Trusted by 10900+ developers.
A Go implementation of the Model Context Protocol (MCP), enabling seamless integration between LLM applications and external data sources and tools.
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP