Gives Claude direct access to UART and USB-serial hardware through 12 tools covering the full serial workflow: list and open ports, read with pattern matching and timeouts, write data, control DTR/RTS lines for board resets, manage flow control, and send break signals. Resources expose available ports and active connections, while background RX subscriptions let you stream data without blocking. Built for embedded workflows like flashing firmware, interactive serial terminals, and talking to Arduino or STM32 boards. Ships as a single binary with an optional allowlist for port security. If you're doing hardware bring-up or device automation with an LLM, this bridges the gap.
Serial monitors are something agents can't work with well natively. serial-mcp fixes this by giving agents powerful tools for reading, writing and subscribing to serial ports.
Non-blocking reads with timeouts and pattern matching, background RX streaming, frame decoding with AT/JSON/shell parsers, auto-reconnect, event logging, and full line control (DTR/RTS, BREAK, flow control) — so Claude, Codex, or any MCP client can flash, reset, and talk to your board without freezing the session.
MCP 2025-11-25 compliant · resource change notifications · port allowlist · stdio + HTTP transports
Exposes serial ports as MCP tools so agents like Claude can interact with embedded devices, Arduino boards, STM32 microcontrollers, and any UART/USB-serial hardware — all through natural language.
22 tools — list_ports, list_connections, open, close, read, write, flush, set_dtr_rts, set_flow_control, send_break, subscribe, unsubscribe, get_status, reconfigure, list_profiles, open_profile, save_profile, delete_profile, get_log, clear_log, export_log, reconnect
4 resources — serial://ports, serial://connections, serial://connections/{id}, serial://connections/{id}/raw, serial://connections/{id}/log (3 resource templates + 1 static)
2 prompt templates — diagnose_port, interactive_terminal
VERSION=$(curl -s https://api.github.com/repos/qarnet/serial-mcp/releases/latest | grep -oP '"tag_name": "\K[^"]+')
curl -L "https://github.com/qarnet/serial-mcp/releases/download/${VERSION}/serial-mcp-${VERSION#v}-x86_64-linux" \
-o serial-mcp && chmod +x serial-mcp && sudo mv serial-mcp /usr/local/bin/
Add user to dialout group for port access: sudo usermod -aG dialout $USER
VERSION=$(curl -s https://api.github.com/repos/qarnet/serial-mcp/releases/latest | grep -oP '"tag_name": "\K[^"]+')
ARCH=aarch64-macos
curl -L "https://github.com/qarnet/serial-mcp/releases/download/${VERSION}/serial-mcp-${VERSION#v}-${ARCH}" \
-o serial-mcp && chmod +x serial-mcp && sudo mv serial-mcp /usr/local/bin/
Download serial-mcp-{VERSION}-x86_64-windows.exe from the latest release and place it on your PATH.
cargo install serial-mcp
nix profile install github:qarnet/serial-mcp
→ Agent configuration guide — Claude Code CLI, Claude Desktop, Cursor, VS Code, Zed, opencode, HTTP transport
{
"mcpServers": {
"serial": {
"type": "stdio",
"command": "serial-mcp",
"args": ["--allowlist=/dev/ttyACM*,/dev/ttyUSB*"]
}
}
}
serial-mcp [OPTIONS]
--transport <stdio|http> Transport to use (default: stdio)
--allowlist <patterns> Comma-separated glob patterns for allowed ports
--bind <addr> HTTP bind address (default: 127.0.0.1:8000)
-h, --help Print help
RUST_LOG Log level env var (error/warn/info/debug/trace)
| Mode | How to activate | Use case |
|---|---|---|
| stdio | default | Desktop agents |
| HTTP | --transport=http | Remote / headless |
1. list_ports → ["/dev/ttyUSB0", "/dev/ttyACM0"]
2. open(port="/dev/ttyACM0", name="board-uart", baud_rate=115200) → { connection_id: "9f...", name: "board-uart" }
3. list_connections() → [{ connection_id: "9f...", name: "board-uart", port: "/dev/ttyACM0" }]
4. set_dtr_rts(id, dtr=false, rts=false) # Arduino reset
set_dtr_rts(id, dtr=true, rts=true)
5. read(id, match={ pattern: "OK>" }, timeout_ms=3000)
→ { stop_reason: "match_found", matched: true, match_index: 0,
bytes_observed: 37, bytes_returned: 37, truncated: false,
data: "...OK>" }
6. write(id, data="status\r\n")
7. close(id)
cargo test
cargo clippy --all-targets -- -D warnings
cargo fmt --all -- --check
# Firmware-based tests (require native_sim firmware, see firmware/AGENTS.md)
cargo test --test native_sim_validation -- --ignored
cargo test --test native_sim_connection_lifecycle -- --ignored --test-threads=1
Be sure to ask your agent to give honest feedback on the tool after they finish using it. Always looking for ways to improve serial-mcp :)
Available on the MCP Registry as:
mcp-name: io.github.qarnet/serial-mcp
MIT. See LICENSE.