Borrowing it
Nothing to install: this file belongs to qarnet/serial-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/qarnet/serial-mcp/main/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/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<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="Reviewed on agentmods" width="80" 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.15020 | $0.15020 |
| Opus 5.5 | $0.06008 | $0.06008 |
| Sonnet 5.5 | $0.03004 | $0.03004 |
| Haiku 4.5 | $0.01502 | $0.01502 |
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 28d 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 — 537 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. - HTTP mounting uses
src/http_transport.rs::routerin production and the test harness. With rmcp 3.5, an exact discovery/stateless policy-row header disables legacy session mode on a per-request service clone, preserving modern initialize HTTP 404 / -32601 with no session allocation. Other headers keep SDK routing; SDK validation remains intact.ServerConfig/ClientConfigreplace deprecated aliases; initialized test clients explicitly advertise2025-11-25, never SDKLATEST(now modern). - 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.
- 28d ago Changed · +3 lines · +140 tokens per session 6428569c366c
- 2mo ago Changed · +1 lines · +60 tokens per session c54ea3c16b5b
- 2mo ago Changed · +41 lines · +620 tokens per session 525409dbf0ee
- 2mo 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 (19 stars, last pushed 7d ago), licensed MIT. It adds 15,020 tokens to every session, about $0.0601 per session on Opus 5.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.
serial-mcp AGENTS.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| serial-mcp AGENTS.mdqarnet/serial-mcp | Instructions file | 19 | 7d ago | MIT | A | 15,020 | Codex, OpenCode |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 9,719 | GitHub Copilot |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 5,516 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | today | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | today | MIT | A | 4,680 | Codex, OpenCode |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 3,093 | GitHub Copilot |
| vscode ai-customization.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 1,907 | GitHub Copilot |