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.
npx agentmods add instructions/alxgmpr/serial-mcp/agents-mdgit clone --depth 1 https://github.com/alxgmpr/serial-mcpWrote 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.
[](https://agentmods.dev/instructions/alxgmpr/serial-mcp/agents-md)<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>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.
| Model | Per session | Once 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 |
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.
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_sessionsdict 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 inasyncio.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_reapertask auto-closes idle sessions. Text output is normalized (\r\n→\n, trailing whitespace stripped) at the tool layer via_normalize_output(). -
session.py —
SerialSessionclass 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 viathreading.Lockfor history andthreading.Eventfor data availability and shutdown signaling.
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.
- 4d ago First seen · 79 lines · 1,396 tokens per session scan A 802a26a0af41
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.
Other instructions, from other repositories
cml-mcp AGENTS.md
AGENTS.md instructions for xorrkaz/cml-mcp, covering agents.md — cml mcp server, project overview, compatibility goal, repository layout and tool modules (src/cmlmcp/tools/).
brilliant_sdk AGENTS.md
Instructions for brilliantlabsAR/brilliant_sdk, covering brilliant sdk — agent guide, how an app works (the pattern behind everything), minimal reading paths, verify without hardware and testing.
NeoMind CLAUDE.md
Claude Code instructions for camthink-ai/NeoMind, covering neomind — edge ai platform for iot, development commands, ecosystem repositories, extension package contract (.nep) and device type template contract (json).
cad-cae-copilot copilot-instructions.md
Copilot instructions for armpro24-blip/cad-cae-copilot, covering github copilot — aieng workspace and essentials.
phone-mcp CLAUDE.md
Claude Code instructions for premex-ab/phone-mcp, covering claude.md, project overview, build commands, architecture and module layout.
zmk-config AGENTS.md
AGENTS.md instructions for urob/zmk-config, covering customization guide, ground rules, how the multi-board layout works, adding a new board and where to change what.