serial-mcp
This MCP server gives an LLM reliable serial-port access to microcontrollers, routers, modems, and embedded systems.
Discover serial ports, USB metadata, and auto-detect baud rates.
Open local or network serial ports with configurable baud, data bits, stop bits, parity, and timeouts.
Send commands and wait for regex-based responses, including immediate triggered text or hex replies for boot prompts.
Read/write text, raw bytes, and hex data while preserving buffered output between calls.
Control DTR/RTS, send serial break signals, and read CTS/DSR/RI/CD signals.
Manage sessions: list sessions, inspect status/health, change settings, and close ports.
Log incoming serial data and transfer files using XMODEM or XMODEM-CRC.
Identify and explicitly terminate a process holding a busy port with
serial_force_release.
Allows interaction with Arduino and other microcontroller boards over serial, enabling commands, file transfer (XMODEM), and bootloader entry.
Supports communication with Cisco devices (e.g., routers) over serial, including sending break signals for ROMMON and boot sequence handling.
Enables interaction with embedded Linux devices over serial, including shell access, file transfer, and system commands.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@serial-mcp List all available serial ports"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
serial-mcp
Give an LLM a reliable serial connection to microcontrollers, routers, modems, embedded Linux systems, and anything else with a UART.
serial-mcp is an MCP server built for real
device work: interactive shells, bootloader prompts, binary protocols, logging,
and file transfers. It continuously buffers incoming data so output is not lost
between tool calls. Serial I/O is handled by
serialx, and the server is built on the
MCP Python SDK 2.x.
Clients that support elicitation are prompted to pick a port (when several are connected) and to confirm a detected baud rate, on both the 2025-11-25 and 2026-07-28 protocols. Other clients get the same information back as tool output.
Install
The PyPI package is named pyserial-mcp; the command it installs is
serial-mcp. Python 3.10 or newer is required.
For a persistent installation with explicit upgrades:
uv tool install pyserial-mcpOr with pip:
pip install pyserial-mcpUpgrade an existing uv installation with uv tool upgrade pyserial-mcp.
Related MCP server: silotek-serial-mcp
Connect it to your MCP client
For Codex (the desktop app, CLI, and IDE extension share this configuration):
codex mcp add serial-mcp -- serial-mcpFor Claude Code:
claude mcp add --scope user serial-mcp -- serial-mcpThe quickest setup skips the separate installation and lets uvx download and
run the package. Use the command for your client:
codex mcp add serial-mcp -- uvx pyserial-mcp
claude mcp add --scope user serial-mcp -- uvx pyserial-mcpFor clients that use an MCP JSON configuration:
{
"mcpServers": {
"serial": {
"command": "uvx",
"args": ["pyserial-mcp"]
}
}
}What it can do
Discover serial ports and USB metadata, then detect an unknown baud rate.
Open local devices or ports exposed over the network:
socket://host:port(ser2net, socat) andrfc2217://host:port.Run a single command with automatic open/close, or keep a session open for an interactive shell.
Read and write text, raw bytes, and hex data without losing output between calls.
React immediately to boot prompts with regex-triggered text or binary replies.
Control DTR, RTS, break, and read CTS, DSR, RI, and CD signals.
Capture logs and send or receive files with XMODEM checksum or CRC-16.
Identify the process holding a busy port and, with explicit use of
serial_force_release, terminate it.
Open sessions automatically close after 15 minutes of inactivity by default.
Clients should still call serial_close as soon as a session is finished so the
port is available to other programs.
Typical workflows
Ask your LLM naturally, for example:
Find the connected serial device, detect its baud rate, and show me its shell prompt.
For one command, the server provides a safe one-shot tool:
serial_execute(port="/dev/ttyUSB0", data="uname -a", expect="\\$")For longer work, use serial_open, one or more serial_command calls, and
serial_close. Use serial_wait_for(..., respond=" ") to catch a time-sensitive
prompt such as U-Boot's autoboot interruption.
Tool profiles
The default full profile exposes all 24 tools. If your client loads every tool
schema and you only need common text workflows, use the smaller seven-tool
profile:
serial-mcp --profile coreYou can also set SERIAL_MCP_TOOL_PROFILE=core in the server environment.
Development
No hardware is required to run the test suite:
git clone https://github.com/alxgmpr/serial-mcp.git
cd serial-mcp
uv pip install -e ".[dev]"
pytest -vLicense
Available Tools
24 toolslist_serial_portsARead-onlyIdempotent
List available serial ports and USB metadata.
Inputs: no named parameters. Returns: result
serial_change_settingsCIdempotent
Change settings on an open serial session.
Inputs: parity, baud_rate, data_bits, stop_bits, +1 more.
serial_clear_historyBDestructiveIdempotent
Clear a session's receive history.
Inputs: session_id.
serial_closeBDestructive
Close a serial session and release its port.
Inputs: session_id. Returns: result
serial_commandC
Send text and collect output until a regex matches, timeout, or silence.
Inputs: data (required), expect, respond, timeout, +5 more.
serial_detect_baudCIdempotent
Try common baud rates and rank readable responses.
Inputs: port (required), probe.
serial_executeB
Open 8N1, run one text command, and always close.
Inputs: data (required), port, expect, timeout, +4 more.
serial_force_releaseCDestructive
Terminate the process holding a serial port. Destructive.
Inputs: port (required).
serial_get_signalsCRead-onlyIdempotent
Read modem-control signal states.
Inputs: session_id.
serial_list_sessionsARead-onlyIdempotent
List open serial sessions and cleanup deadlines.
Inputs: no named parameters.
serial_log_startCDestructive
Start logging received data to a file.
Inputs: file_path (required), append, session_id.
serial_log_stopCIdempotent
Stop logging and return capture statistics.
Inputs: session_id.
serial_openB
Open a serial session. Close it with serial_close when finished.
Inputs: port, parity, timeout, baud_rate, +3 more.
serial_readBRead-only
Consume buffered text, returning the newest bytes up to the output limit.
Inputs: timeout, encoding, session_id, max_output_bytes.
serial_read_hexCRead-only
Consume buffered bytes and return limited hexadecimal output.
Inputs: timeout, session_id, max_output_bytes.
serial_read_sinceBRead-onlyIdempotent
Read history without consuming it, returning the newest bytes up to the limit.
Inputs: since, encoding, session_id, max_output_bytes.
serial_send_breakC
Send a serial break signal.
Inputs: duration, session_id.
serial_set_signalsBIdempotent
Set DTR or RTS on an open session.
Inputs: dtr, rts, session_id.
serial_statusCRead-onlyIdempotent
Return connection health and session statistics.
Inputs: session_id.
serial_wait_forC
Wait for a regex in incoming output, optionally responding on match.
Inputs: pattern (required), respond, timeout, encoding, +3 more.
serial_writeC
Write text without waiting for a response.
Inputs: data (required), encoding, session_id, append_newline.
serial_write_hexC
Write raw bytes supplied as hexadecimal.
Inputs: hex_string (required), session_id.
serial_xmodem_receiveBDestructive
Receive a file with XMODEM checksum or CRC mode.
Inputs: file_path (required), mode, timeout, session_id.
serial_xmodem_sendCDestructive
Send a file with XMODEM checksum or CRC mode.
Inputs: file_path (required), mode, session_id.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 24 tools
Most tools target clearly distinct operations (read vs read_since vs read_hex are well differentiated by consuming vs non-consuming and text vs binary semantics; write vs write_hex likewise). The boundaries between serial_execute, serial_command, and serial_wait_for are subtler since all send/wait for output, but the descriptions spell out the differences (one-shot close, regex/timeout collection, passive wait-and-respond). Only minor potential confusion remains.
Nearly all tools follow a predictable serial_verb_noun pattern (serial_open, serial_read, serial_write_hex). The one outlier is list_serial_ports, which puts the noun before receiving a serial_ prefix, a small inconsistency. Otherwise the convention is stable and readable.
24 tools is on the heavy side for a serial-port server and pushes into the borderline range. While each tool covers a genuinely different capability (signals, hex I/O, XMODEM, logging, baud detection), the surface feels large enough that some consolidation (e.g. read variants) could have trimmed it.
The surface covers a full lifecycle: open/close/force-release, settings changes, text and hex read/write, signal control, break, baud detection, history, logging, and XMODEM transfer. A minor gap is the absence of a get-settings/read-back tool to complement serial_change_settings, but overall coverage is strong.
Maintenance
Related MCP Connectors
MCP server for AI dialogue using various LLM models via AceDataCloud
Talk to your public-facing AI from any MCP client — Claude, ChatGPT, Cursor, Cline, Windsurf.
Remote MCP server exposing your Node Command fleet (files, shell, processes, browser) to AI hosts.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA 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.2MIT
- FlicenseAqualityDmaintenanceA headless MCP server that enables AI tools (like Claude Code) to read and analyze serial logs from embedded boards (ESP32, STM32) for firmware debugging, with read-only tools for log retrieval and a built-in web viewer.61-
- FlicenseAqualityDmaintenanceAn MCP server that enables AI agents to read serial output from devices by buffering lines in the background and allowing polling for new output, preventing blocking on long-running serial monitors.3-

sbl-probeofficial
AlicenseNot gradedqualityDmaintenanceSerial communication and protocol analysis MCP server that gives AI coding assistants direct access to serial ports for reading, writing, decoding, and capturing embedded device output.MIT