🔌 serial-mcp
MCP server for serial port communication. Provides tools to open, read, write, and manage serial ports through the Model Context Protocol.
🤖 Written by and for AI.
✨ Features
- 📋 List available serial ports on the system
- ⚙️ Open ports with configurable baud rate, parity, stop bits, and flow control
- 📖 Read data by byte count, terminator character, or duration
- ✍️ Write string or hex data
- 💥 Send BREAK signals
- 📊 Monitor port status and control line states
📦 Prerequisites
- Python 3.10+
- uv package manager
🚀 Installation
Via PyPI
uvx serial-mcp@latest
Local Clone
git clone https://github.com/davidalo/serial-mcp.git
cd serial-mcp
uvx --from "$(pwd)" serial-mcp
🔗 Integration
Via PyPI
# Claude Code
claude mcp add serial -- uvx serial-mcp@latest
# Codex CLI
codex mcp add serial -- uvx serial-mcp@latest
Local Clone
git clone https://github.com/davidalo/serial-mcp.git
cd serial-mcp
# Claude Code
claude mcp add serial -- uvx --from "$(pwd)" serial-mcp
# Codex CLI
codex mcp add serial -- uvx --from "$(pwd)" serial-mcp
🛠️ Tools
| Tool | Description |
|---|---|
list_ports |
List available system serial ports |
open_port |
Open a serial port with configuration (baud rate, parity, stop bits, etc.) |
close_port |
Close an open port |
write_data |
Write string or hex data to a port |
read_bytes |
Read N bytes with timeout |
read_until |
Read until a terminator character |
read_for_duration |
Read continuously for N seconds |
send_break |
Send a BREAK signal |
get_port_status |
Get port status and control line states |
list_open_ports |
List all currently managed ports |
🧪 Testing with Virtual Ports
Use socat to create virtual serial port pairs for testing:
# Create virtual port pair
socat -d -d pty,raw,echo=0,link=/tmp/ttyV0 pty,raw,echo=0,link=/tmp/ttyV1
Then open /tmp/ttyV0 with the MCP server and /tmp/ttyV1 with another terminal program to test communication.
📄 License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
serial_mcp-0.3.0.tar.gz
(6.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file serial_mcp-0.3.0.tar.gz.
File metadata
- Download URL: serial_mcp-0.3.0.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
49ddcc8ad13dcad23ea112ef526f85ddba0ae3420b6e553afaaed6510074a46e
|
|
| MD5 |
513a3eefc1061c75dc806d4406a3e5f9
|
|
| BLAKE2b-256 |
ff152f8690ea977c2e4232935a8793c3e6232ad13cf6ce0ddc9a06d806548873
|
File details
Details for the file serial_mcp-0.3.0-py3-none-any.whl.
File metadata
- Download URL: serial_mcp-0.3.0-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
985c532f85e64104a47ab298e52a38ca2d876b70bc306d720771e43b2d2a07ec
|
|
| MD5 |
94a59e83575dbcc8e63e2f76c41d7b9c
|
|
| BLAKE2b-256 |
6d5b8fb80feafdad72f813f37b6999eb0da5b5e54d5fddcd8c5948c926fdab2a
|