Integrations & Tools
~8 min readUpdated: December 2026

Auditing Shared & Cached MCP Agent Work: Provenance & Traces

Auditing shared and cached MCP agent work provenance graph in Smoke Monkey

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.

Technical Review: Smoke Monkey Core Architecture Team
Tested on Node.js 18+ & BunTypeScript 5.x
Quick Answer & Executive Definition

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.

Key Architectural Takeaways
Quick Implementation Examplemcp-provenance-audit-agent.ts
mcp-provenance-audit-agent.tstypescript
import { createAgent } from '@smoke-monkey/harness';
// Enforce provenance headers and fill-ID tracking on cached MCP tool servers
const 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);
Video Guides

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 / ControlVerified Audit ScopeKey Finding from arXiv:2612.04590
FastMCP & LogfireStdio delegation, native cache hits, result metadataApplication producer refs survived native caching across 10/10 runs; stock cache flags group pending joiners with initiators
Academic Tools MCPNative pending coalescing & persisted deliveriesDistinguishes in-flight shared fetches from later disk hits via explicit code seams
Tracee (OS Observer)Selected file opens in isolated guestCaptures physical open/version, but cannot infer cache state or MCP recipient alone
Flowcept & CromwellProducer-recipient lineage & local cache-fill refsPositive 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.

bash
# 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))
EOF

Do 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.

Google Search Questions & Answers

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 guides

Build with Smoke Monkey Harness

Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.

npm install smoke-monkey-harness