afr-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@afr-mcp verify session.afr.jsonl for tampering and hash-chain integrity"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Agent Flight Recorder
Tamper-evident flight recorder, Lamport causal replay engine, MCP tool-poisoning scanner, and zero-leak operational security (OPSEC) scrubber for Python 3.12 and Model Context Protocol (MCP 2025-11-25) workflows.
Live interactive avionics workbench: nahianakhtar.github.io/demos/flight-recorder/
Why Production Agent Teams Need a Flight Recorder
Long-running AI agents fail compliance reviews when nobody can reproduce Tuesday afternoon's tool calls offline. Models sample stochastically. Upstream APIs mutate state between retries, while raw debug logs routinely leak developer home directories, internal CGNAT addresses, or API tokens into bug trackers.
agent-flight-recorder wraps every tool call in a zero-dependency signed cassette (.afr.jsonl) built on four mathematical guarantees:
Monotonic Lamport Logical Clocks: Every invocation advances
L_k = max(L_{k-1}, L_in) + 1and seals(seq, lamport_clock, tool_name, schema_sha256, args_sha256, output_sha256, duration_us, prev_hash)into a SHA-256 hash chain.Domain-Separated Binary Merkle Root: Leaf digests (
0x00 || leaf) and interior nodes (0x01 || left || right) produce compactO(log2 N)inclusion proofs. Flipping one bit in any historical argument invalidates the cassette root immediately.Wagner-Fischer Trace Alignment: Offline replay computes exact dynamic-programming edit distance
D(m, n)between recorded production cassettes and candidate builds. It isolatesARG_DRIFT,SCHEMA_DRIFT,MISSING_CALL, orUNEXPECTED_CALLin under two milliseconds with zero network calls.Shannon Entropy and Zero-Leak OPSEC Gate: Scrubs OS user paths, private LAN and RFC 6598 CGNAT carrier-grade ranges,
0.0.0.0wildcard port binds, tracking query parameters, hidden Unicode bidirectional overrides (U+202E), and unlabelled high-entropy secrets (H(X) >= 4.35 bits/char).
Related MCP server: MCP Security scanner
Architecture Overview
Tool Call -> [OPSEC & Entropy Scrubber] -> [Lamport Clock + Canonical RFC 8785 JSON]
|
v
Candidate Run -> [Wagner-Fischer DP Aligner] <-- [.afr.jsonl + SHA-256 Merkle Root]Quick Start
pip install -e .
# Run self-contained recording, scrubbing, and Merkle verification demo
afr demo
# Verify an existing flight cassette
afr verify session.afr.jsonl
# Align a candidate test run against a recorded production cassette
afr replay session.afr.jsonl candidate_calls.json
# Start the zero-dependency MCP 2025-11-25 stdio server
afr-mcpMCP 2025-11-25 Server Tools
Tool Name | Read-Only | Purpose |
|
| Verify Lamport clock order, SHA-256 frame hashes, and Merkle root integrity |
|
| Align recorded cassette frames against candidate calls via Wagner-Fischer DP |
|
| Redact host paths, private/CGNAT IPs, wildcard binds, and high-entropy secrets |
|
| Detect Trojan-Source Bidi overrides and indirect prompt injection in |
Verification Gate
ruff check src tests
ruff format --check src tests
mypy --strict src
pytest -qLicense
MIT License. Copyright (c) 2026 Nahian Akhtar.
Available Tools
4 toolsafr_audit_mcp_toolsBRead-onlyIdempotent
Detect hidden Unicode smuggling and indirect prompt-injection inside MCP tool metadata.
Inputs: tools (required).
afr_replay_diffCRead-onlyIdempotent
Deterministically align a recorded cassette against candidate tool invocations via Wagner-Fischer DP.
Inputs: cassette_jsonl (required), candidate_calls (required).
afr_scrub_opsecBRead-onlyIdempotent
Scan and redact OS user paths, LAN/CGNAT IPs, wildcard binds, and high-entropy secrets.
Inputs: payload (required).
afr_verify_cassetteBRead-onlyIdempotent
Verify Lamport logical clocks, SHA-256 hash chain, and Merkle root of a JSONL flight cassette.
Inputs: cassette_jsonl (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool targets a clearly distinct operation: cassette integrity verification, deterministic replay comparison, OPSEC redaction, and MCP metadata injection auditing. The boundaries are easy to distinguish from names and descriptions, with no apparent overlap.
All tools use the same predictable afr_verb_noun pattern: afr_verify_cassette, afr_replay_diff, afr_scrub_opsec, afr_audit_mcp_tools. The shared prefix and consistent verb-based structure make the set highly readable.
Four tools is well-scoped for a focused cassette security and audit server. Each tool covers a distinct audit operation, and there are no redundant or trivial entries.
The surface covers verification, replay diffing, scrubbing, and MCP metadata auditing, which are core for this forensic/audit domain. Minor gaps could include cassette listing/summarization or report export, but agents can likely work around them.
Maintenance
Related MCP Connectors
Security & DLP proxy for MCP: tool-poisoning scans, PII redaction on tool args/results. Beta.
Tamper-evident proof creation and verification for AI agents via MCP, A2A, and REST.
Security tools for AI agents: scan MCP servers, validate HDP delegation chains, audit releases.
Hash-chained HMAC-signed audit log MCP for A2A (agent-to-agent) calls. Every tool-call, agent-ha...
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables enterprise MCP security auditing through 12 deterministic no-LLM tools for evidence-gated claims, skill/prompt supply-chain audits, token profiling, and server auth-mode checks.MIT

MCP Security scannerofficial
AlicenseAqualityBmaintenanceEnables users to deterministically audit MCP servers for security issues across manifests, source, runtime responses, multi-call state, identity, and install scripts, and to run an inline gateway that gates tool calls and scans responses before returning them.321 PyPI1Apache 2.0- AlicenseNot gradedqualityBmaintenanceEnables agents and operators to audit MCP tool permissions for least privilege, score blast radius, detect privilege-escalation chains, verify capability matrices, and produce cryptographic audit proofs with injection fuzzing and exfiltration canaries.7MIT
- AlicenseNot gradedqualityBmaintenanceEnables coding agents to run scope-checked probes of MCP endpoints, analyze tool definitions for poisoning and dangerous capabilities, detect definition drift, and generate reproducible evidence bundles and bounty-ready reports.1MIT