serial-mcp
Provides tools for reading, writing, and subscribing to serial ports, enabling interaction with Arduino boards and other serial devices.
serial-mcp for UART and USB serial access
serial-mcp is an MCP server for direct access to serial ports. It reads,
writes, and streams UART or USB-serial data to microcontrollers, Arduino boards,
STM32 chips, and other embedded targets. Reads use timeouts and pattern matching
instead of blocking on a serial monitor.
The server provides always-on RX capture. It decodes TX and RX frames using line, delimiter, length-prefixed, start/end, SLIP, and COBS formats. It provides AT, JSON, shell, NMEA-0183, and Modbus ASCII parsers.
Protocol presets provide checksum validation. The server also supports auto-reconnect, event logging, DTR/RTS, BREAK, and flow control. MCP clients can use these features with serial bootloaders, resets, and embedded boards.
Quick start
Install the server. See Install for Cargo, Nix, and prebuilt binary options.
Connect an agent. Follow the agent configuration guide, or use the example below.
Discover devices. Call
list_ports()and inspectprofile_matches. The result shows what a bareopenwould reuse.Open a port. Call
open(port=...)with only the port. Baud defaults to 115200/8-N-1. The server reuses the most recently used high-confidence profile for a known device. It creates a durable generated profile for a new device.Talk to the device. Use
transact()for command and response exchanges. Useread()for buffered or unsolicited data. Usewrite()for send-only operations.
Related MCP server: embedded-serial-mcp
Capabilities
Area | What it provides |
RX model | An always-on ring buffer captures bytes from open to close. |
Framing and parsing | Both directions support line, delimiter, length-prefixed, start/end, SLIP, and COBS framing. Parsers include AT, JSON, shell, NMEA-0183, and Modbus ASCII. |
Protocol presets | Seven presets are available. They are |
Device profiles | The server creates automatic profile sessions. High-confidence devices get durable generated profiles. Learned settings persist across sessions. |
Boot capture |
|
Reliability | Ring wrap is reported through |
Operations | Event logging supports persistent JSONL capture through |
Tool catalog (25 tools)
Group | Tools |
Discovery |
|
Connection lifecycle |
|
I/O |
|
Line control |
|
Profiles & config |
|
Logs & capture |
|
Utility |
|
Resources and prompts
Kind | Items |
Resources (5) |
|
Prompts (2) |
|
Install
Cargo (all platforms)
cargo install serial-mcpNix
nix profile install github:qarnet/serial-mcpPrebuilt binary
No toolchain is required. Each release publishes one binary per platform. The
latest/download URLs resolve to the newest release.
Platform | Command |
Linux x86_64 |
|
Linux ARM64 | Same command with the |
macOS (Apple Silicon) | Same command with the |
Windows (x86_64) | Download |
On Linux, add your user to the dialout group for port access:
sudo usermod -aG dialout $USERConnect an agent
For client-specific setup, see the agent configuration guide. It covers Claude Code CLI, Claude Desktop, Cursor, VS Code, Zed, opencode, Codex, Hermes, and HTTP transport.
{
"mcpServers": {
"serial": {
"type": "stdio",
"command": "serial-mcp",
"args": ["--allowlist=/dev/ttyACM*,/dev/ttyUSB*"]
}
}
}Core workflow
Use this sequence for common work: discover, open, talk, verify the learned profile, then use advanced tools when needed.
Call
list_ports(). Itsprofile_matchesentries correspond toports.selectedmeans a bareopenreusesselected_profile.ambiguousmeans equal-ranked profiles requireopen_profile.duplicate,ineligible, andnonemean a bare open starts fresh or transient.
Call bare
open(port=...). The result includes theprofilebinding. The binding reports its name, source, confidence, persistence, generated flag, revision, and dirty state.Use
transact(data=..., match=..., timeout_ms=...)to write and await a response in one call. Useread()for buffered or unsolicited data.After
reconfigure,set_flow_control, or connection-modeconfigure, inspectprofile_persistence. It reportspersisted,not_needed,transient, orfailed. Also inspect the updatedprofilebinding.Call
close(). A clean close retries a dirty binding as a safety measure.
For boot and reset capture, call capture_boot. It handles Arduino auto-reset,
power-cycle banners, and boot prompts.
The call purges unread OS input. It marks the RX live edge. It can pulse DTR/RTS,
with guaranteed release. It captures only post-mark bytes on a private cursor.
The result is bounded in memory and does not write a file. See RX and
reading for the from cursor model. See Device
profiles for profile behavior.
Protocols
The protocol field supplies framing and parser defaults for both directions.
NMEA and Modbus ASCII presets validate checksums:
Preset | Wire name | Framing / parser |
AT commands |
| Line (CR) + AT parser |
SLIP |
| RFC 1055 byte stuffing |
JSON lines |
| Line + JSON-lines parser |
COBS |
| Consistent Overhead Byte Stuffing |
NDJSON |
| Line + JSON-lines parser, skips blank lines |
NMEA-0183 |
| Start/end |
Modbus ASCII |
| Start/end |
Field precedence is explicit call field, call-time preset, connection default, then connection preset. The Protocol guide documents this order, checksum behavior, and the framing and parser reference.
Key concepts and guides
Guide | What it covers |
Ring buffer and shared cursor. Tagged | |
| |
The | |
Client setup. HTTP transport. Troubleshooting. | |
Framing and parsers. Presets and precedence. Checksum behavior. | |
User and development guides |
Transports and options
Mode | How to activate | Use case |
stdio | default | Desktop agents |
HTTP |
| Remote and headless use |
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)
--max-program-buffered-bytes <N> Global budget for all in-flight RX tools
--max-tool-buffered-bytes <N> Per-tool ceiling for max_buffered_bytes
--profiles-path <path> Profile store file path (default: OS user config dir + serial-mcp/profiles.toml)
--capture-dir <absolute-dir> Enable persistent export_log capture into an existing absolute directory (disabled by default; no fallback to cwd/config/temp)
--capture-max-file-bytes <N> Per-file quota for a capture JSONL snapshot (default: 16777216 / 16 MiB)
--capture-max-total-bytes <N> Total-byte quota across committed capture files (default: 268435456 / 256 MiB)
--capture-max-files <N> File-count quota across committed capture files (default: 256)
-V, --version Print version and exit (also: `serial-mcp version`)
-h, --help Print help
RUST_LOG Log level env var (error/warn/info/debug/trace)The profile store is one TOML file shared by every session. Use --profiles-path
for an isolated store. See Device profiles.
Persistent capture
export_log writes portable .jsonl filenames into the --capture-dir root.
It never accepts arbitrary paths and never overwrites files. See Persistent
capture.
MCP compatibility
serial-mcp supports MCP 2025-11-25. This version uses the legacy session
lifecycle.
It also supports MCP 2026-07-28. This version uses modern discovery and
stateless requests with SEP-2549 cache fields. Both stdio and HTTP transports
support the port allowlist.
CI runs official conformance checks and Inspector interoperability checks. The
validation tools come from the committed npm lockfile. CI installs them with
npm ci --ignore-scripts. It runs them as local binaries, never through npx.
An actual historical rmcp 1.7.0 client tests backward compatibility over HTTP
and stdio. Run the complete local and CI version gate with:
bash scripts/test-mcp-compat.shDevelopment
Before pushing or opening a pull request, run cargo fmt --all. CI runs
cargo fmt --all -- --check once in standalone Ubuntu format job first.
Formatting failures block dependent expensive Nix, build/test/Clippy, and MCP
conformance jobs.
cargo test --locked
cargo clippy --all-targets --locked -- -D warnings
cargo fmt --all -- --check
# Linux-only required Rust PTY fixture suites
cargo test --locked --test device_fixture -- --test-threads=1
cargo test --locked --test device_command_parity -- --test-threads=1
cargo test --locked --test device_framing_parity -- --test-threads=1
cargo test --locked --test device_protocol_parity -- --test-threads=1
cargo test --locked --test device_parity_repeat public_boundary_repeat_gate -- --ignored --test-threads=1Production-path real-PTY fixture tests run on Linux. macOS and Windows run normal Rust build/test/clippy plus controlled-backend coverage.
Documentation and status
The product backlog tracks planned and in-progress work, and the documentation index links user guides, reference contracts, and reports. Report issues and feature requests on the tracker.
AGENTS.md, contributor guidelines
MCP registry
The package is available on the MCP Registry as:
mcp-name: io.github.qarnet/serial-mcp
License
MIT. See LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MCP server for mandates, delegation, policy-gated execution, credential grants, and audit.
MCP server wrapping the Tesla Fleet API and TeslaMate API
QuLab MCP remote server (Streamable HTTP) for computational science and lab tools.
MCP server for secureFlows (secure-flows.com). Alias of io.github.michal-lefler/secureflows-mcp.
Related MCP Servers
- AlicenseAqualityAmaintenanceMCP server that lets LLMs talk to serial devices: microcontrollers, routers, modems, embedded Linux, anything with a UART.235MIT
- AlicenseNot gradedqualityCmaintenanceA professional MCP server for serial port communication, enabling AI assistants to list, connect, send/receive data, and manage serial connections with embedded systems, IoT devices, and hardware debugging hardware.1MIT
- FlicenseAqualityDmaintenanceMCP server for serial port communication. Provides tools to open, read, write, and manage serial ports through the Model Context Protocol.10-
- FlicenseNot gradedqualityDmaintenanceMCP server for controlling MicroPython devices (ESP32, RP2040, etc.) via USB Serial or WebREPL, enabling code execution, file operations, and device management from MCP clients.9-
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/qarnet/serial-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server