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.
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-mcp
Or with pip:
pip install pyserial-mcp
Upgrade an existing uv installation with uv tool upgrade pyserial-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-mcp
For Claude Code:
claude mcp add --scope user serial-mcp -- serial-mcp
The 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-mcp
For 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.
- 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 core
You 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 -v
License
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 pyserial_mcp-0.7.3.tar.gz.
File metadata
- Download URL: pyserial_mcp-0.7.3.tar.gz
- Upload date:
- Size: 102.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee4cb0b970ba4a1bc5bbc258c2482e9483f954a58f92663fd7eabef65bf224a7
|
|
| MD5 |
713bcaad47e885be702083e7e246b776
|
|
| BLAKE2b-256 |
7752080571359f3de7961b03996db590df34e14a44b9679386b4d622695a0597
|
Provenance
The following attestation bundles were made for pyserial_mcp-0.7.3.tar.gz:
Publisher:
release.yml on alxgmpr/serial-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyserial_mcp-0.7.3.tar.gz -
Subject digest:
ee4cb0b970ba4a1bc5bbc258c2482e9483f954a58f92663fd7eabef65bf224a7 - Sigstore transparency entry: 2626105772
- Sigstore integration time:
-
Permalink:
alxgmpr/serial-mcp@5a18842e48b1dbfac1236eb12548ed96fd3583fb -
Branch / Tag:
refs/tags/v0.7.3 - Owner: https://github.com/alxgmpr
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@5a18842e48b1dbfac1236eb12548ed96fd3583fb -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyserial_mcp-0.7.3-py3-none-any.whl.
File metadata
- Download URL: pyserial_mcp-0.7.3-py3-none-any.whl
- Upload date:
- Size: 24.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d636739597cbf03bfc37ef314868f00796aa96d72fad766eb6263291f0c280d
|
|
| MD5 |
97195b86a134802d89c02cba1512c2f6
|
|
| BLAKE2b-256 |
750ef32c7ed8b3cda64955d3cc36272a47366af874418c087589886b66abe513
|
Provenance
The following attestation bundles were made for pyserial_mcp-0.7.3-py3-none-any.whl:
Publisher:
release.yml on alxgmpr/serial-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyserial_mcp-0.7.3-py3-none-any.whl -
Subject digest:
8d636739597cbf03bfc37ef314868f00796aa96d72fad766eb6263291f0c280d - Sigstore transparency entry: 2626105832
- Sigstore integration time:
-
Permalink:
alxgmpr/serial-mcp@5a18842e48b1dbfac1236eb12548ed96fd3583fb -
Branch / Tag:
refs/tags/v0.7.3 - Owner: https://github.com/alxgmpr
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@5a18842e48b1dbfac1236eb12548ed96fd3583fb -
Trigger Event:
push
-
Statement type: