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/qarnet/serial-mcp/agents-mdgit clone --depth 1 https://github.com/qarnet/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/qarnet/serial-mcp/agents-md)<a href="https://agentmods.dev/instructions/qarnet/serial-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/qarnet/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.1 | $0.14200 | $0.14200 |
| Opus 5 | $0.07100 | $0.07100 |
| Sonnet 5 | $0.02840 | $0.02840 |
| Haiku 4.5 | $0.01420 | $0.01420 |
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 5d 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 — 492 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md — serial-mcp
Fast truth
- Root server:
src/main.rsselects stdio vs HTTP transport, parses CLI limits (--profiles-path,--capture-dir+ capture quotas included), and mounts HTTP at/mcp. - MCP surface lives in
src/server.rs; tool handlers are split undersrc/tools/, prompts undersrc/prompts/, resources undersrc/resources/. - MCP version policy (
src/mcp_protocol.rs): the product-ownedSUPPORTED_PROTOCOLStable is the SINGLE source for advertised versions, lifecycle admission, capability views, and cache shaping. Exactly two rows —2026-07-28(preferred,DiscoverStateless,ImmediatePrivatecache, subscriptions on) and permanent2025-11-25(InitializeSession,Omitcache, subscriptions off). Lookup is exact-match only (policy_for);cache_fields_for(Option<ProtocolVersion>)grants fields ONLY to rows withCachePolicy::ImmediatePrivate— never by date/range, and unknown/future versions inherit no policy.supported_protocol_versions()/ preferred policy derive from the table, never fromProtocolVersion::KNOWN_VERSIONS. - Dual MCP lifecycle (
src/server.rs): preferred modern2026-07-28discovery/stateless requests (server/discover+ self-contained per-request_meta) and compatible legacy2025-11-25initialize/session requests.get_info()serves the MODERN view (rmcp intersectssubscriptions/listenfilters againstget_info().capabilities),initialize()returns the legacy view with subscription disabled,discover()the modern view withresources.subscribe: true. Common surface: tools/resources/prompts/completions (no logging, list-change, or tasks).accepted_subscription_filter/listenare backed by one process-wideResourceEventHub(src/resource_events.rs, capacity 256) shared by every stdio/HTTP handler and the port hotplug watcher; legacysubscriptions/listenstays-32601. SerialHandleris built viaSerialHandler::builder()...build()(src/server.rs); the oldwith_manager*telescoping constructors are gone andwith_profiles()is gone. The builder defaultsprofile_storeto an ephemeral store andcapture_storeto disabled.SerialHandler::new()tries the OS default profile store and falls back to an ephemeral store with a warning. Productionmain.rsinjects the resolvedprofile_store, aCaptureStorebuilt from--capture-dir+ quota flags (disabled by default), andSystemPortProviderthrough the builder.- Profiles live in a process-wide
Arc<ProfileStore>(src/profile_store.rs), shared by every stdio/HTTP session handler.main.rsresolves the path (--profiles-pathor the OS user-config default, failing startup on an unavailable config dir or invalid file) and injects one store. Persistent mutations take a process-local async mutex, thenspawn_blocking+ an advisory lock on<file>.lock, reload-under-lock,NamedTempFile+sync_all+ rename; the cache (sharedArc<RwLock>) is published from inside the blocking transaction right after the durable write, before the lock is released — so a cancelled awaiting tool still converges (cache never changes on failed write).update_defaults_preserving_selectorreturns the effective profile atomically (no racy second lookup). File format is schema-versioned TOML (v1 legacy auto-migrates in memory;schema_version == 0or> 2rejects startup).Profilecarriesmetadata(revision/timestamps/generated/use_count) and a boundedrevisionshistory (max 5 prior snapshots) for the profile-session feature. - Shared RX framing lives in
src/tools/rx_consume.rs(consume_frames+RxFrameSinktrait +disconnect_state);readroutes framing through it, but its raw (no-framing) path stays per-tool by design (see "Invariants easy to break"). - Connection lifecycle is in
src/serial/; shared RX/TX coordination is insrc/rx_session.rs(always-on pump + ring buffer),src/tx_session.rs, andsrc/stop_controller.rs. The pump appends all received bytes tosrc/rx_ring.rs;readreads from the ring via cursors.ConnectionManager's connection-opening boundary is an injectableConnectionOpener(with_opener): production usesSystemConnectionOpener(SerialConnection::open); tests inject in-memory backends (tests/common/controlled.rs::ControlledConnectionOpener) so the public MCP surface runs cross-platform without an OS serial port. Linux production-path PTY tests use real PTYs; macOS and Windows use normal Rust and controlled-backend coverage. - Low-level shared primitives:
src/util.rs(find_subsequence, the byte-substring search imported directly byframingand the matcher) andsrc/precedence.rs(resolve_field, the four-layer framing/parser/protocol precedence helper shared byio_ops). Bothpub(crate). build.rsinjectsGIT_HASH/GIT_HASH_AVAILABLE/BUILD_TARGET.
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.
- 5d ago First seen · 492 lines · 14,200 tokens per session scan A 5e720496209c
serial-mcp AGENTS.md is an instructions file published in the GitHub repository qarnet/serial-mcp (7 stars, last pushed today), licensed MIT. It adds 14,200 tokens to every session, about $0.0710 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
cortex CLAUDE.md
Claude Code instructions for dinglebear-ai/cortex, covering claude.md — cortex, repo facts, commands, architecture and ports.
axon AGENTS.md
AGENTS.md instructions for dinglebear-ai/axon, a project described as: Self-hosted RAG stack for crawl, scrape, search, ingest, query, and ask workflows with Qdrant, TEI embeddings, Chrome rendering, MCP/CLI/REST, and Gemini synthesis.
axon GEMINI.md
Gemini CLI instructions for dinglebear-ai/axon, a project described as: Self-hosted RAG stack for crawl, scrape, search, ingest, query, and ask workflows with Qdrant, TEI embeddings, Chrome rendering, MCP/CLI/REST, and Gemini synthesis.
axon CLAUDE.md
Claude Code instructions for dinglebear-ai/axon, covering axon cli, repository facts, verification scope guard, generated contract gate and quick start.
cortex AGENTS.md
AGENTS.md instructions for dinglebear-ai/cortex, a project described as: Rust MCP/HTTP log aggregation platform for homelab syslog, Docker logs, OTLP ingest, SQLite/FTS search, and AI transcript correlation.
cortex GEMINI.md
Gemini CLI instructions for dinglebear-ai/cortex, a project described as: Rust MCP/HTTP log aggregation platform for homelab syslog, Docker logs, OTLP ingest, SQLite/FTS search, and AI transcript correlation.