serial-mcp AGENTS.md

serial-mcp AGENTS.md is an instructions file for Codex, OpenCode from alxgmpr/serial-mcp. It costs 1,396 tokens per session, scanned A, original, MIT.

Developer instructions for an MCP server that lets AI agents communicate with serial devices, such as microcontrollers, routers, modems, and embedded Linux systems. MCP is a standard way for software tools to communicate with AI assistants.

In plain words
What is it for?
Building or maintaining integrations that connect an AI agent to serial ports and hardware devices.
Why use it?
They explain how to install, run, test, and check the server while describing its sessions and available tools.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/alxgmpr/serial-mcp/agents-md
Clone the repo
git clone --depth 1 https://github.com/alxgmpr/serial-mcp

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for serial-mcp AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/alxgmpr/serial-mcp/agents-md.svg)](https://agentmods.dev/instructions/alxgmpr/serial-mcp/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/alxgmpr/serial-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/alxgmpr/serial-mcp/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,396 This file is loaded in full into every session.
When invoked 1,396 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01396 $0.01396
Opus 5 $0.00698 $0.00698
Sonnet 5 $0.00279 $0.00279
Haiku 4.5 $0.00140 $0.00140

Measured 4d ago against content hash 802a26a0af41, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

serial-mcp AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 79 lines

How it starts

The opening of the file, as written. The whole thing — 79 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

serial-mcp is an MCP (Model Context Protocol) server that enables LLMs to communicate with serial devices (microcontrollers, routers, modems, embedded Linux). Python 3.10+, MIT licensed.

Build & Run Commands

# Install (editable, with dev dependencies)
uv pip install -e ".[dev]"

# Run the MCP server
python3 -m serial_mcp.server

# Test with MCP Inspector
DANGEROUSLY_OMIT_AUTH=true npx @modelcontextprotocol/inspector -- python3 -m serial_mcp.server

# Install dependencies only
uv pip install -r requirements.txt

# Run tests
pytest -v

# Lint
ruff check serial_mcp/ tests/
ruff format --check serial_mcp/ tests/

# Build MCPB bundle
./scripts/build-mcpb.sh

Architecture

Three-file architecture in serial_mcp/:

  • server.py — FastMCP server exposing 24 async tools (all prefixed serial_* except discovery) and 4 prompts. Maintains a global _sessions dict keyed by port name with atexit cleanup. _resolve_session() auto-selects when only one session is open and surfaces auto-close notifications. All tools include MCP annotations (readOnlyHint, destructiveHint, etc.). Blocking serial I/O is wrapped in asyncio.to_thread(). Tools are grouped: port discovery, port control (serial_force_release), connection management, text read/write, binary/hex read/write, hardware signal control, session utilities, XMODEM file transfer, and logging. Supports elicitation for interactive port and baud selection. Server-level instructions tell the AI to always close explicit sessions. A background _session_reaper task auto-closes idle sessions. Text output is normalized (\r\n\n, trailing whitespace stripped) at the tool layer via _normalize_output().

  • session.pySerialSession class managing individual serial connections. Runs a daemon background reader thread that stores data in a timestamped ring buffer (10MB default cap). Supports both destructive reads (read_buffer) and non-destructive historical reads (read_since). Thread safety via threading.Lock for history and threading.Event for data availability and shutdown signaling.

Read the full file on GitHub · 79 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 79 lines · 1,396 tokens per session scan A 802a26a0af41

Subscribe to this mod's changes

serial-mcp AGENTS.md is an instructions file published in the GitHub repository alxgmpr/serial-mcp (5 stars, last pushed 7d ago), licensed MIT. It adds 1,396 tokens to every session, about $0.0070 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.