A professional Model Context Protocol (MCP) server for serial port communication. Provides AI assistants with comprehensive serial communication capabilities for embedded systems, IoT devices, and hardware debugging with real hardware integration. - π Production Ready: Real hardware integration with 5 comprehensive serial communication tools - π Cross-Platform Support: Windows, Linux, macOS with
Add this skill
npx mdskills install adancurusul/serial-mcp-serverProduction-ready serial port communication with 5 well-tested tools for embedded systems and IoT devices
1# Serial MCP Server23[](https://rust-lang.org)4[](https://github.com/modelcontextprotocol/rust-sdk)5[](LICENSE)67A professional Model Context Protocol (MCP) server for serial port communication. Provides AI assistants with comprehensive serial communication capabilities for embedded systems, IoT devices, and hardware debugging with real hardware integration.89> π **Language Versions**: [English](README.md) | [δΈζ](README_ZH.md)1011## β¨ Features1213- π **Production Ready**: Real hardware integration with 5 comprehensive serial communication tools14- π **Cross-Platform Support**: Windows, Linux, macOS with automatic port detection15- π‘ **Complete Serial Control**: List ports, connect, send/receive data with full configuration16- π **Multiple Data Formats**: UTF-8, Hex, Binary encoding support with timeout handling17- π οΈ **Hardware Integration**: Tested with STM32, Arduino, ESP32 and other embedded systems18- π€ **AI Integration**: Perfect compatibility with Claude and other AI assistants19- π§ͺ **Comprehensive Testing**: All 5 tools validated with real hardware20- β‘ **High Performance**: Built on Tokio async runtime with concurrent connection support2122## ποΈ Architecture2324```25βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ26β MCP Client βββββΊβ Serial MCP βββββΊβ Serial Device β27β (Claude/AI) β β Server β β Hardware β28βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ29 β30 βΌ31 ββββββββββββββββββββ32 β Target Device β33 β (STM32/Arduino) β34 ββββββββββββββββββββ35```3637## π Quick Start3839### Prerequisites4041**Hardware Requirements:**42- **Serial Device**: STM32, Arduino, ESP32, or any UART-compatible device43- **Connection**: USB-to-Serial converter or built-in USB-UART44- **USB Cables**: For connecting device to PC4546**Software Requirements:**47- Rust 1.70+48- Serial device drivers (automatically detected on most systems)4950### Installation5152```bash53# Clone and build from source54git clone https://github.com/adancurusul/serial-mcp-server.git55cd serial-mcp-server56cargo build --release57```5859### Basic Usage6061**Configure MCP Clients**6263#### Claude Desktop Configuration Example6465Add to Claude Desktop configuration file:6667**Windows Example:**68```json69{70 "mcpServers": {71 "serial": {72 "command": "C:\\path\\to\\serial-mcp-server\\target\\release\\serial-mcp-server.exe",73 "args": [],74 "env": {75 "RUST_LOG": "info"76 }77 }78 }79}80```8182**macOS/Linux Example:**83```json84{85 "mcpServers": {86 "serial": {87 "command": "/path/to/serial-mcp-server/target/release/serial-mcp-server",88 "args": [],89 "env": {90 "RUST_LOG": "info"91 }92 }93 }94}95```9697Other examples for other tools like cursor, claude code etc. please refer to the corresponding tool documentation9899## π― Try the STM32 Demo100101We provide a comprehensive **STM32 Serial Communication Demo** that showcases all capabilities:102103```bash104# Navigate to the example105cd examples/STM32_demo106107# Build and run the firmware108cargo run --release109110# Use with MCP server for complete serial communication experience111```112113**What the demo shows:**114- β **Interactive Serial Commands**: Send commands and get real-time responses115- β **All 5 MCP Tools**: Complete validation with real STM32 hardware116- β **Hardware Control**: LED toggle, counter system, blink patterns117- β **Command Interface**: Help system with interactive command processing118119[π View STM32 Demo Documentation β](examples/STM32_demo/README.md)120121### Usage Examples with AI Assistants122123#### List Available Serial Ports124```125Please list available serial ports on the system126```127128#### Connect to Serial Device129```130Connect to COM19 with baud rate 115200 for my STM32 device131```132133#### Send Interactive Commands134```135Send 'H' command to get help menu, then send 'L' to toggle the LED136```137138#### Read Device Responses139```140Read the response from the serial device with 2 second timeout141```142143#### Complete Communication Test144```145Please help me test all 5 MCP serial tools with my STM32 board on COM19. Start by listing ports, then connect, send some commands, read responses, and finally close the connection.146```147148## π οΈ Complete Tool Set (5 Tools)149150All tools tested and validated with real STM32 hardware:151152### π‘ Serial Communication (5 tools)153| Tool | Description | Status |154|------|-------------|----------|155| `list_ports` | Discover available serial ports on system | β Production Ready |156| `open` | Open serial connection with configuration | β Production Ready |157| `write` | Send data to connected serial device | β Production Ready |158| `read` | Read data from serial device with timeout | β Production Ready |159| `close` | Close serial connection cleanly | β Production Ready |160161**β 5/5 Tools - 100% Success Rate with Real Hardware**162163## π Supported Hardware164165### Serial Devices166- **STM32**: All STM32 series with UART capability167- **Arduino**: Uno, Nano, ESP32, ESP8266168- **Embedded Systems**: Any device with UART/USB-Serial interface169- **Industrial**: Modbus, RS485 converters170- **IoT Devices**: Sensors, actuators with serial communication171- **Other**: Any device with UART/USB-Serial interface172173### Serial Interfaces174- **USB-to-Serial**: CH340, CH343, FTDI, CP2102175- **Built-in USB**: STM32 with USB-CDC, Arduino Leonardo176- **Hardware UART**: Direct UART connections177178### Platform Support179180| Platform | Port Format | Examples |181|----------|-------------|----------|182| Windows | `COMx` | COM1, COM3, COM19 |183| Linux | `/dev/ttyXXX` | /dev/ttyUSB0, /dev/ttyACM0 |184| macOS | `/dev/tty.xxx` | /dev/tty.usbserial-1234 |185186## π Production Status187188### β Fully Implemented and Tested189190**Current Status: PRODUCTION READY**191192- β **Complete Serial Integration**: Real hardware communication with all 5 tools193- β **Hardware Validation**: Tested with STM32 + CH343 USB-Serial on COM19194- β **Interactive Communication**: Full bidirectional command/response system195- β **Multi-Platform**: Windows, Linux, macOS support with automatic detection196- β **Connection Management**: Robust connection handling with proper cleanup197- β **AI Integration**: Perfect MCP protocol compatibility198199## π¦ Technical Features200201### Serial Implementation202- **Cross-Platform**: Automatic port detection and configuration203- **Multiple Encodings**: UTF-8, Hex, Binary data support204- **Timeout Handling**: Configurable read/write timeouts205- **Connection Pooling**: Multiple concurrent serial connections206207### Performance Characteristics208- **Port Discovery**: Fast enumeration of available ports209- **Connection Speed**: Rapid connection establishment210- **Data Throughput**: Efficient data transfer with minimal latency211- **Session Stability**: Tested for extended operation periods212213## π Acknowledgments214215Thanks to the following open source projects:216217- [serialport-rs](https://crates.io/crates/serialport) - Serial port communication library218- [rmcp](https://github.com/modelcontextprotocol/rust-sdk) - Rust MCP SDK219- [tokio](https://tokio.rs/) - Async runtime220221## π License222223This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.224225---226227β If this project helps you, please give us a Star!
Full transparency β inspect the skill content before installing.