Skip to main content

serio-mcp

PyPI version Python Version CI License: MIT

serio-mcp is a high-performance Model Context Protocol (MCP) server that equips AI assistants (Claude Desktop, Cursor, Antigravity, VS Code) with reliable, zero-loss Serial / UART communication capabilities.

Engineered specifically for embedded Linux development, hardware debugging, router recovery (U-Boot / Bootloader), and IoT automation, featuring a dedicated Expect State-Machine Engine and a continuous background ingestion daemon to eliminate race conditions and dropped bytes.


✨ Features

  • ⚡ Zero-Loss Background Daemon: A dedicated reader thread continuously ingests serial streams in the background—ensuring no characters or early bootlogs are dropped between tool calls.
  • 🎯 Atomic Expect Engine (serial_expect): Match multiple regular expressions or substring prompts (e.g. ['~ #', 'login:', 'Password:', 'IPQ807x#']) in real-time.
  • 🚀 Prompt-Aware Execution (serial_exec_expect): Send shell/bootloader commands and automatically wait for the prompt to return, returning clean, isolated output.
  • 🔌 Dynamic Port Discovery & Switching: Enumerate all attached hardware devices with VID/PID and switch ports or baud rates on the fly without restarting the server.
  • ⌨️ Raw Control Sequence Support: Send Ctrl+C (\x03), Enter (\r\n), break signals, and custom byte sequences.
  • 🛡️ Cross-Platform: Supports Linux, macOS, and Windows.

📦 Installation

No manual installation required! Run directly with uvx:

uvx serio-mcp

Installation with pip / pipx

pipx install serio-mcp
# or
pip install serio-mcp

⚙️ Configuration

1. Claude Desktop

Add this to your claude_desktop_config.json:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "serio": {
      "command": "uvx",
      "args": ["serio-mcp"]
    }
  }
}

2. Cursor IDE

Add to .cursor/mcp.json or Global Cursor Settings:

{
  "mcpServers": {
    "serio": {
      "command": "uvx",
      "args": ["serio-mcp"]
    }
  }
}

3. Antigravity / Google AI Assistant

Add to ~/.gemini/config/mcp_config.json:

{
  "mcpServers": {
    "serio": {
      "command": "uvx",
      "args": ["serio-mcp"]
    }
  }
}

🛠️ Available MCP Tools

Tool Description
serial_list_ports Enumerate all connected physical and virtual serial ports (with Device path, Description, VID, PID).
serial_configure Dynamically connect to or switch serial port (port='/dev/ttyUSB0', baudrate=115200).
serial_expect Atomically send an optional command and wait for prompt patterns (patterns=['# ', 'login:']).
serial_exec_expect Execute a command and automatically wait for the prompt to return, extracting clean output.
serial_send Send raw strings, keys, or escape sequences (e.g. \x03 for Ctrl+C, spaces for U-Boot intercept).
serial_read_buffer Non-blocking read of newly accumulated incoming stream from the background buffer.
serial_get_history Fetch recent line history captured by the background daemon.
serial_status Query connection health, baud rate, buffer usage, and background worker status.

💡 Practical Examples

1. Intercepting U-Boot Bootloader

// Tool call: serial_expect
{
  "patterns": ["IPQ807x#", "Hit any key to stop autoboot:"],
  "command": " ",
  "timeout": 15.0
}

2. Handling Login Prompts

// Step 1: Send username on login prompt
{
  "patterns": ["Password:", "# "],
  "command": "root",
  "timeout": 5.0
}

// Step 2: Send password on Password prompt
{
  "patterns": ["~ #", "# "],
  "command": "admin",
  "timeout": 5.0
}

3. Executing Shell Command

// Tool call: serial_exec_expect
{
  "command": "uname -a; ifconfig br0",
  "timeout": 5.0
}

🧪 Development & Testing

# Clone the repository
git clone https://github.com/weyou/serio-mcp.git
cd serio-mcp

# Set up virtual environment with uv
uv venv
source .venv/bin/activate

# Install in editable mode with development dependencies
uv pip install -e ".[dev]"

# Run tests
pytest -v

# Run linting
ruff check .

📄 License

This project is licensed under the MIT License.

Metadata

Release files for serio-mcp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for serio-mcp 0.1.0
File Size Uploaded Provenance Actions
serio_mcp-0.1.0.tar.gz 11.2 kB With provenance Details for serio_mcp-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for serio-mcp 0.1.0
File Interpreter ABI Platform Actions
serio_mcp-0.1.0-py3-none-any.whl Python 3 none any Details for serio_mcp-0.1.0-py3-none-any.whl

Total release size: 22.3 kB

Release files / serio_mcp-0.1.0.tar.gz

Download URL serio_mcp-0.1.0.tar.gz
Size 11.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ff2775cea32eb69e20faf5fd8c08abf784a7e77ba9c5ceff7f1f31e5f62f92a8
BLAKE2b-256 checksum
How to use checksums
61a51cb75aecdd0a0c442a671488e4aa37bc564176f7b40a40fc5eaed30a9527
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.

Transparency log

Release files / serio_mcp-0.1.0-py3-none-any.whl

Download URL serio_mcp-0.1.0-py3-none-any.whl
Size 11.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
86e725551464aceebd3a341db531a1f5515dca7d5d56b64b7690c39108f46e58
BLAKE2b-256 checksum
How to use checksums
a10d33a2b233a312393d7d1955d3fe0279400a34191983af42142e1454175958
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.

Transparency log

Security for serio-mcp 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for serio_mcp-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page