Auditing Shared & Cached MCP Agent Work: Provenance & Traces

An MCP server returning identical text to two callers may have executed two fresh reads, coalesced a pending read, or served a stale cache entry. arXiv:2612.04590 formalizes four testable audit identities—initiator, executor, recipient, and fill—across FastMCP, Logfire, Academic Tools, Tracee, Flowcept, and Cromwell.
Auditing Shared & Cached MCP Agent Work: Provenance & Traces: An MCP server returning identical text to two callers may have executed two fresh reads, coalesced a pending read, or served a stale cache entry. arXiv:2612.04590 formalizes four testable audit identities—initiator, executor, recipient, and fill—across FastMCP, Logfire, Academic Tools, Tracee, Flowcept, and Cromwell. Designed as a zero-dependency, open-source TypeScript architecture under the MIT License with native Model Context Protocol (MCP) support and deterministic phase state machines.
- Four-Role Audit Model: Distinguishes the initiator (request starting work), executor (downstream call), recipient (verified delivery, pending joiner vs later reader), and fill (stored artifact).
- Pending Coalescing vs Cache Hits: Standard cache flags distinguish later hits but conflate a caller that joined pending in-flight work with the initiator.
- FastMCP Producer Reference Preservation: Across 10 FastMCP benchmark runs, application-provided producer references survived the native cache middleware path.
- Cross-Boundary Evidence Joins: Combines MCP host logs, middleware cache write history, and OS-level file opens (Tracee) without conflating missing data with unauthorized reads.
import { createAgent } from '@smoke-monkey/harness';// Enforce provenance headers and fill-ID tracking on cached MCP tool serversconst agent = createAgent({agentId: 'mcp-provenance-auditor',provider: 'anthropic',model: 'claude-sonnet-4-5',workspacePath: process.cwd(),mcpServers: {auditedDocs: {command: 'npx',args: ['-y', '@smoke-monkey/mcp-provenance-proxy', '--upstream', 'fastmcp-stdio'],env: {MCP_EMIT_FILL_ID: 'true',MCP_DISTINGUISH_PENDING_JOIN: 'true',OTEL_EXPORTER_OTLP_ENDPOINT: 'http://127.0.0.1:4318',},},},permissions: {read_file: 'allow',write_file: 'ask',run_command: 'ask',},});async function main() {const result = await agent.run('Compare two concurrent MCP report reads and verify whether fill_id links both recipients to one executor span.');console.log('Audit Result:', result.summary);}main().catch(console.error);
Watch: Related Video Guides
Model Context Protocol Clearly Explained | MCP Beyond the Hype
MCP Complete Explanation
Why Reply Equality Cannot Prove Which MCP Execution Supplied Data
Auditing shared and cached MCP work (arXiv:2612.04590) establishes which downstream tool call or stored cache fill actually produced each Model Context Protocol response. By separating the initiator, executor, recipient (pending joiner versus later reader), and fill, teams eliminate blind spots where identical replies mask whether files were re-read, coalesced, or served from cache.
When two agents request the same report concurrently and a third asks later, all three receive identical text. Neither equal text nor a shared cache key proves which execution performed the physical read—and an OS-level observer such as Tracee sees a file open without knowing which MCP caller initiated it.
| Released Stack / Control | Verified Audit Scope | Key Finding from arXiv:2612.04590 |
|---|---|---|
| FastMCP & Logfire | Stdio delegation, native cache hits, result metadata | Application producer refs survived native caching across 10/10 runs; stock cache flags group pending joiners with initiators |
| Academic Tools MCP | Native pending coalescing & persisted deliveries | Distinguishes in-flight shared fetches from later disk hits via explicit code seams |
| Tracee (OS Observer) | Selected file opens in isolated guest | Captures physical open/version, but cannot infer cache state or MCP recipient alone |
| Flowcept & Cromwell | Producer-recipient lineage & local cache-fill refs | Positive provenance controls providing explicit earlier-fill references |
Instrumenting Producer References and Write History in MCP Gateways
To make shared and cached MCP servers auditable without custom kernel instrumentation, emit an immutable fill_id, initiator_request_id, delivery_role (initiator, pending_joiner, or cache_hit), and source_version alongside OpenTelemetry span links.
# Verify FastMCP OTel span links and cache fill lineage from local JSONL audit logs
python3 - << 'EOF'
import json
events = [
{"req": "r1", "role": "initiator", "fill_id": "fill_901", "physical_open": True},
{"req": "r2", "role": "pending_joiner", "fill_id": "fill_901", "physical_open": False},
{"req": "r3", "role": "cache_hit", "fill_id": "fill_901", "physical_open": False},
]
by_fill = {}
for ev in events:
by_fill.setdefault(ev["fill_id"], []).append((ev["req"], ev["role"]))
print("Lineage map:", json.dumps(by_fill, indent=2))
EOFDo Not Conflate Pending Joiners with Cache Hits or Initiators
A single boolean cached=true flag hides whether a caller started a fresh physical read or coalesced onto an in-flight request. Always log delivery_role separately from physical execution spans.
Frequently Asked Questions
Q:What are the four audit identities defined for MCP tool provenance?
The paper defines initiator (the request that started the work), executor (the downstream call that performed it), recipient (a caller verified to receive the reply, split into pending joiner and later reader), and fill (the stored result instance).
Q:Can OS-level eBPF tools like Tracee alone audit MCP caching?
No. Tracee verifies that a process opened a specific file or snapshot, but kernel events alone cannot identify which MCP caller received a coalesced reply or a later middleware cache hit.
Q:Does FastMCP preserve custom provenance metadata across its cache middleware?
Yes. In ten controlled FastMCP runs, application-provided producer references survived the native cache path, and complete write-history logs identified all tested cache fills.
Q:How should auditors handle missing provenance records?
Auditors should distinguish unrecorded lineage from failed or unauthorized operations by separating host boundary logs, middleware cache records, and OS-level file-open boundaries.
Related Alternatives & Comparisons
Related Architecture Guides
View all guidesBest Open Source Coding Agents in 2026: Free, Local & Fully Hackable Harnesses
MCP Server Security Best Practices: Hardening Model Context Protocol Agents in 2026
Open Source Coding Agent Harness: Build a Forkable, Local AI Engineering Runtime
Build with Smoke Monkey Harness
Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.