memplane: A Transparent MCP Proxy for Tamper-Evident Tool-Call Recording and Surgical Undo in AI-Assisted Development
Varun Meda
Independent Researcher
September 2026
Abstract
Large language model (LLM) agents operating within AI-assisted development environments invoke tool calls (file writes, shell commands, database mutations) whose cumulative effects are difficult to observe, audit, or reverse. The Model Context Protocol (MCP) has emerged as a de-facto standard for connecting LLM hosts to tool servers, yet it provides no built-in mechanism for recording, replaying, or undoing sequences of tool invocations. This paper describes memplane, a transparent MCP proxy implemented in Rust that sits between any compliant LLM host and one or more MCP servers. memplane intercepted every JSON-RPC tool-call message, persisted full inputs and outputs to a tamper-evident append-only ledger, and triggered a copy-on-write (CoW) snapshot engine before any destructive operation was forwarded. When a developer wished to reverse a sequence of changes, memplane constructed a dependency graph over the recorded call history and computed the minimal undo set required to restore a desired prior state without disturbing unrelated work, a property we term surgical undo. Evaluation on a corpus of realistic agent sessions involving file-system manipulation, code generation, and database interactions measured proxy overhead, undo latency, and storage amplification. Results show a median per-call proxy overhead of 38 microseconds, undo operations completing in under 12 milliseconds for sessions of up to 2,000 recorded calls, and a storage overhead of 1.4x relative to raw MCP traffic. memplane is open source, written entirely in safe Rust with an async Tokio runtime, and requires zero modifications to either the LLM host or the MCP server.
Keywords: MCP proxy, model context protocol, developer tools, undo, rollback, audit trail, AI-assisted development, Rust, observability

1. Introduction

LLM-powered coding assistants such as GitHub Copilot, Cursor, and Claude Code have fundamentally altered how software engineers interact with their development environments. These systems no longer merely suggest code; they autonomously execute sequences of tool calls: creating files, running terminal commands, querying databases, and invoking external APIs. A developer may delegate a multi-step refactoring task to an agent and return to discover that hundreds of files have been modified, shell commands have been executed, and environment state has been mutated in ways that are difficult to characterize, much less reverse.

This opacity is not merely inconvenient. It is a fundamental safety and reliability concern. Unlike a human developer whose individual keystrokes produce a recoverable edit history, an LLM agent collapses an entire strategy into a rapid burst of opaque tool invocations. The standard version-control workflow (commit, diff, revert) captures only file-system state and does not account for side effects such as outbound HTTP requests, database writes, or process spawning. When an agent makes a mistake midway through a compound operation, the developer is left without a principled mechanism to identify exactly which tool calls need to be reversed and in what order.

The Model Context Protocol (MCP), introduced by Anthropic in 2024 and rapidly adopted by the broader ecosystem (Anthropic, 2024), provides a standardized JSON-RPC interface through which LLM hosts discover and invoke tools exposed by MCP servers. While MCP successfully decouples tool providers from LLM runtimes, it is explicitly a transport and discovery protocol: it carries tool invocations faithfully but records nothing, enforces no audit trail, and provides no rollback primitive.

The correct architectural locus for recording and undo capability is the protocol layer itself, specifically a transparent proxy that intercepts MCP traffic without requiring changes to either endpoint. This design principle, analogous to how network monitoring tools operate at the packet layer, ensures that any MCP-compliant host and server combination immediately gains observability and undo capability simply by routing through the proxy.

This paper makes the following contributions:

  1. We identify and characterize the observability and recoverability gap in current MCP-based agent workflows, and articulate the requirements for a principled solution.
  2. We present the design of memplane, a transparent MCP proxy with a tamper-evident append-only ledger, a copy-on-write snapshot engine, and a surgical undo algorithm based on dependency-graph analysis of recorded tool calls.
  3. We describe the Rust implementation of memplane, highlighting the async Tokio architecture, the intercept trait abstraction, and the storage backend design.
  4. We evaluate memplane empirically across proxy overhead, undo latency, and storage cost, demonstrating that the system is practical for continuous use in developer workflows.

The remainder of the paper is organized as follows. Section 2 provides background on MCP, existing observability tools, and copy-on-write snapshot concepts. Section 3 presents the system design. Section 4 describes the Rust implementation. Section 5 reports the evaluation. Section 6 discusses trade-offs and future directions. Section 7 concludes.

2. Background

2.1 The Model Context Protocol

MCP defines a client-server protocol in which an MCP host (the LLM runtime or IDE integration) connects to one or more MCP servers (tool providers). The protocol is transported over standard I/O or WebSocket connections using JSON-RPC 2.0 message framing. Servers expose a capability manifest that lists available tools, each described by a name, a JSON Schema for its input parameters, and an optional annotation indicating whether the tool has side effects. The host discovers tools via a tools/list request and invokes them via tools/call messages, receiving structured results that the LLM can incorporate into its context window (Anthropic, 2024).

The protocol is deliberately minimal. It defines the shape of tool invocations but imposes no requirements on logging, access control, replay, or undo. This minimalism is appropriate for the protocol layer, as these concerns are rightly the responsibility of higher-level infrastructure, but it also means that current deployments universally lack these capabilities.

MCP has seen rapid adoption since its introduction. As of mid-2026, major LLM-powered development tools including Claude Code, Cursor, and a growing ecosystem of third-party integrations support the protocol natively. This breadth of adoption makes a protocol-level proxy approach particularly attractive: a single proxy implementation benefits all compliant hosts and servers without coordination.

2.2 Observability Gaps in Agent Workflows

The observability tooling available to developers today was designed for deterministic, human-authored code. Version control systems such as Git (Torvalds, 2005) record file-system snapshots at developer-chosen commit boundaries, but they do not capture the sequence of intermediate tool invocations that produced those snapshots. Distributed tracing frameworks such as OpenTelemetry (OpenTelemetry Authors, 2023) record structured spans for service calls, but require instrumentation at the application level and provide no undo primitive. Shell history provides a partial record of commands executed in a terminal, but this record is easily lost, does not capture outputs, and covers only a single tool category.

Several LLM observability platforms, including LangSmith, Weights & Biases Traces, and Arize Phoenix, provide tracing for LLM API calls and chain-of-thought reasoning steps (LangChain Inc., 2024; Weights & Biases, 2024). These systems are valuable for understanding model behavior but operate at the application framework layer and do not intercept MCP-level tool calls. They also lack undo semantics entirely.

The gap is therefore specific: there exists no tool that transparently records MCP tool calls with full fidelity and provides a principled mechanism for selective reversal.

2.3 Copy-on-Write Snapshots

Copy-on-write (CoW) is a resource-management strategy in which a copy of a data structure is deferred until a modification is actually made. CoW semantics underpin many file systems, including ZFS (Bonwick et al., 2003), Btrfs (Mason, 2007), and APFS (Apple, 2017), as well as virtual machine snapshot mechanisms and database multi-version concurrency control (MVCC). In the context of memplane, CoW is applied at the level of file-system objects and in-memory state representations: before forwarding a destructive MCP tool call to the server, the proxy snapshots the affected resources. If the call is later selected for undo, the snapshot provides the data needed for restoration without requiring a full replay of the session from the beginning.

MCP tools typically operate on bounded, identifiable resources: a file path, a database row identified by a key, a named environment variable. The input schema of each tool call therefore serves as a declaration of the resources it will affect, enabling the proxy to snapshot precisely those resources rather than the entire system state. This property makes CoW tractable at the proxy layer.

2.4 Dependency Graphs and Minimal Undo

Undo in interactive systems has been studied extensively in the context of text editors and collaborative editing (Berlage, 1994; Ressel et al., 1996). The classical linear undo stack (reversing operations in strict LIFO order) is unsuitable for agent workflows where recent operations may be logically independent of an earlier mistake. Selective undo, which allows reversing an arbitrary past operation while preserving subsequent unrelated work, requires reasoning about dependencies between operations (Myers, 1987). We adapt this framework to the MCP setting, where dependencies arise from shared resource access: two tool calls are dependent if one reads or writes a resource that the other writes.

3. System Design

3.1 Architecture Overview

memplane is positioned as a transparent proxy in the MCP communication path. From the perspective of the LLM host, memplane appears to be a standard MCP server: it presents a capabilities manifest and responds to tools/list and tools/call messages. From the perspective of the upstream MCP server, memplane appears to be a standard MCP client. This double-impersonation requires no configuration changes at either endpoint; the host is simply directed to connect to the proxy's endpoint instead of the server's endpoint directly.

Figure 1 illustrates the high-level architecture. The proxy process hosts three principal subsystems: the intercept pipeline, which handles message routing and recording; the snapshot engine, which manages CoW state capture; and the undo planner, which computes minimal undo sets on demand.

┌─────────────────────────────────────────────────────────┐ │ LLM Host │ │ (Claude Code / Cursor / etc.) │ └───────────────────────┬─────────────────────────────────┘ │ JSON-RPC over stdio / WebSocket ▼ ┌─────────────────────────────────────────────────────────┐ │ memplane proxy │ │ ┌──────────────┐ ┌───────────────┐ ┌─────────────┐ │ │ │ Intercept │ │ Snapshot │ │ Undo │ │ │ │ Pipeline │→ │ Engine │ │ Planner │ │ │ └──────┬───────┘ └───────────────┘ └─────────────┘ │ │ │ │ │ │ │ │ ┌─────────▼────────────────▼──────┐ │ │ │ │ Append-Only Ledger (RocksDB) │ │ │ │ └──────────────────────────────────┘ │ └─────────┼───────────────────────────────────────────────┘ │ JSON-RPC (forwarded) ▼ ┌─────────────────────────────────────────────────────────┐ │ MCP Server(s) │ │ (filesystem, shell, database, etc.) │ └─────────────────────────────────────────────────────────┘
Figure 1. memplane proxy architecture. The proxy intercepts all MCP JSON-RPC traffic, records it to an append-only ledger, and manages CoW snapshots before forwarding destructive calls.

3.2 Transparent Proxy and Message Interception

Upon receiving a tools/call message from the LLM host, the intercept pipeline performs the following steps in sequence:

  1. Parse and validate. The JSON-RPC payload is deserialized and validated against the known tool schema. Malformed messages are short-circuited with an error response before reaching the upstream server.
  2. Classify destructiveness. Using a configurable tool-annotation registry, the pipeline classifies the call as read-only or potentially destructive. Tools annotated with readOnly: true in the MCP capabilities manifest are treated as non-destructive. Unknown tools default to destructive (fail-safe).
  3. Snapshot trigger. For destructive calls, the pipeline invokes the snapshot engine synchronously before forwarding. The snapshot engine inspects the call's input parameters to identify affected resources and creates CoW snapshots of those resources.
  4. Record pre-call entry. A ledger entry is written containing: a monotonically increasing sequence number, a wall-clock timestamp and high-resolution monotonic timestamp, the tool name, the full serialized input parameters, and a reference to any snapshot created in step 3.
  5. Forward and await. The original JSON-RPC message is forwarded to the upstream MCP server. The pipeline awaits the response asynchronously without blocking other in-flight requests.
  6. Record post-call entry. Upon receiving the response, the ledger entry is updated with the full serialized output, the response latency, and a success/error flag. The entry is then finalized and fsynced to ensure durability.
  7. Return response. The original response is returned to the LLM host, completing the transparent pass-through.

The entire intercept path adds latency only in the critical section between steps 2 and 4 for destructive calls, and between steps 5 and 6 for all calls. Steps 1 and 7 overlap with network I/O. We demonstrate in Section 5 that this latency is negligible relative to typical tool execution times.

3.3 Append-Only Ledger

The ledger is the durable record of all tool calls processed by the proxy. It must be append-only, tamper-evident, and efficiently queryable by sequence number, time range, and resource identifier. memplane uses RocksDB (Facebook Engineering, 2013) as the storage engine, configured with a column-family layout that separates call records, snapshot metadata, and the dependency graph index. RocksDB's log-structured merge tree (LSM) design naturally supports high-throughput sequential writes while providing O(log n) point lookups.

Tamper-evidence is achieved through a hash-chaining scheme. Each ledger entry includes a prev_hash field containing the SHA-256 hash of the immediately preceding entry. Any modification to a historical entry, or any insertion into the middle of the sequence, would invalidate all subsequent hashes and be immediately detectable. This property is particularly important for security-sensitive use cases where an audit trail must be provably unaltered.

The ledger stores both the pre-call and post-call halves of each entry as separate records, linked by sequence number. This two-phase structure allows the proxy to record the intent of a tool call (useful for crash recovery and partial-failure analysis) even before the call completes or returns a result.

3.4 Copy-on-Write Snapshot Engine

The snapshot engine is responsible for preserving the state of resources that a destructive tool call is about to modify. Its operation is resource-type-specific: different resource types require different snapshot strategies.

For file-system resources, the engine records the full path, current modification time, file size, and file contents (for files below a configurable size threshold, currently 10 MB). For larger files, it records a content-addressable hash and deduplicates storage by checking whether an identical hash has been seen in a previous snapshot. For directories, it records the directory listing recursively, but defers content snapshots to individual files at write time, reducing the cost of operations that affect only a subset of a directory tree.

For database resources (when using an MCP server that exposes database operations), the engine can optionally integrate with the database's own MVCC mechanism. When the database supports it, the engine records the transaction ID at the time of the snapshot and uses the database's historical query capability for restoration. When it does not, the engine falls back to reading and storing the affected rows directly.

Snapshots are stored in a dedicated column family of the RocksDB ledger, keyed by snapshot ID. Snapshot metadata, including the list of resource identifiers covered, is stored alongside the call record for efficient lookup during undo planning.

3.5 Surgical Undo Algorithm

The surgical undo algorithm answers the question: given a set of tool calls to be undone, what is the minimal set of additional undos required to restore a consistent state, and in what order should they be applied?

We model the call history as a directed acyclic graph (DAG) G = (V, E) where each vertex v ∈ V represents a recorded tool call and each directed edge (u, v) ∈ E represents a dependency: call v depends on the state produced by call u, meaning that v read or wrote a resource that u wrote. This dependency structure is inferred from the resource annotations stored with each call record.

Given a target set T ʬ V of calls the developer wishes to undo, the undo planner computes the dependency closure D(T) as follows:

function dependency_closure(T, G): worklist = T.copy() closed = empty_set while worklist is not empty: v = worklist.pop() closed.add(v) for each call u that depends on v (i.e., edge v → u in G): if u not in closed and u has not been superseded: worklist.add(u) return closed

The resulting set D(T) is the minimal set of calls that must be undone to safely restore the target state. Calls in D(T) are sorted in reverse topological order of their original execution, ensuring that each call is undone before any call that depended on it.

Each call is undone by invoking its snapshot's restore operation. For file-system resources, this means overwriting the current file with the snapshot content. For database resources, this means applying the reverse of the recorded mutations. For calls with no snapshot (read-only calls that should never appear in T) or for calls whose effects are externally visible and irreversible (outbound HTTP requests, emails), the planner emits a warning and skips the restore, flagging the undo operation as partial.

The planner exposes both a dry-run mode (reporting what would be undone and highlighting any partial-undo warnings) and an execute mode. Developers are expected to review the dry-run output before committing an undo operation.

3.6 Rust Async Architecture

memplane is implemented entirely in Rust using the Tokio async runtime. The choice of Rust is motivated by three requirements: memory safety without garbage collection (critical for a proxy that processes and stores potentially large and untrusted payloads), high throughput with low and predictable latency, and a rich ecosystem of async I/O libraries. The proxy handles multiple simultaneous MCP connections, common in IDE integrations that connect multiple tool servers, via Tokio's multi-threaded work-stealing executor.

Each MCP connection is managed by an independent ConnectionSession task that owns the intercept pipeline state for that connection. The snapshot engine and ledger writer are shared across sessions through Arc-wrapped, lock-minimized handles: the ledger writer uses a dedicated Tokio task with a bounded mpsc channel to serialize writes without blocking the intercept pipeline, and the snapshot engine uses a DashMap-based concurrent hash map to manage in-flight snapshot state. This design ensures that the critical path from message receipt to forward is never blocked by ledger I/O.

4. Implementation

4.1 Core Abstractions

The central abstraction in memplane is the Interceptor trait, which defines the interface that all intercept-pipeline stages must implement. This trait enables a composable middleware architecture: interceptors can be stacked, and new behaviors (rate limiting, redaction of sensitive parameters, metrics emission) can be added without modifying existing code.

/// Core interception trait for MCP tool calls. /// Each stage in the intercept pipeline implements this trait. /// Stages are composed via the `ChainedInterceptor` combinator. #[async_trait] pub trait Interceptor: Send + Sync + 'static { /// Called before the tool call is forwarded upstream. /// Returning `Err` short-circuits forwarding and returns the /// error to the LLM host. async fn before_call( &self, ctx: &mut CallContext, call: &ToolCall, ) -> Result<InterceptDecision, ProxyError>; /// Called after a response is received from the MCP server. /// May transform the response before returning it to the host. async fn after_call( &self, ctx: &mut CallContext, call: &ToolCall, response: &mut ToolResponse, ) -> Result<(), ProxyError>; /// Called if the upstream call fails or times out. async fn on_error( &self, ctx: &mut CallContext, call: &ToolCall, error: &ProxyError, ) -> Result<(), ProxyError> { // Default: pass through the error unchanged let _ = (ctx, call, error); Ok(()) } } /// Decision returned by `before_call` to control forwarding. pub enum InterceptDecision { /// Forward the call to the upstream MCP server. Forward, /// Short-circuit: return this synthetic response without forwarding. ShortCircuit(ToolResponse), /// Abort the call and return an error to the LLM host. Abort(String), }

The CallContext structure carries per-call mutable state through the pipeline, including the assigned sequence number, any snapshot IDs created, and a resource-access log that is populated by the snapshot engine and later used for dependency-graph construction. The ChainedInterceptor combinator composes two Interceptor implementations such that before_call is invoked in order and after_call in reverse order, following the middleware convention familiar from web frameworks such as Tower (Pedersen & Contributors, 2019).

4.2 Key Rust Structs

The primary data structures in the implementation are organized around the ledger entry lifecycle. A LedgerEntry is a flat, serializable struct containing all fields required for replay and undo. Serialization uses the bincode crate for compact binary encoding in the RocksDB store and serde_json for human-readable export. The SnapshotRecord struct holds the content of a single resource snapshot and is stored separately from the call record to allow deduplication across calls that snapshot the same resource in the same state.

/// Persisted record for a single MCP tool call. #[derive(Debug, Clone, Serialize, Deserialize)] pub struct LedgerEntry { /// Monotonically increasing sequence number. pub seq: u64, /// Wall-clock time of the pre-call record (Unix micros). pub timestamp_us: i64, /// Name of the MCP tool invoked. pub tool_name: String, /// Full JSON-serialized input parameters. pub input: serde_json::Value, /// Full JSON-serialized output (None until call completes). pub output: Option<serde_json::Value>, /// Whether the call succeeded, failed, or is in-flight. pub status: CallStatus, /// Round-trip latency to the MCP server (None until complete). pub latency_us: Option<u64>, /// IDs of CoW snapshots taken before this call. pub snapshot_ids: Vec<SnapshotId>, /// Resources read or written, for dependency graph construction. pub resource_accesses: Vec<ResourceAccess>, /// SHA-256 hash of the previous ledger entry (hash chain). pub prev_hash: [u8; 32], /// SHA-256 hash of this entry's canonical serialization. pub self_hash: [u8; 32], } /// Identifies a resource and the type of access. #[derive(Debug, Clone, Serialize, Deserialize)] pub struct ResourceAccess { pub resource_id: ResourceId, pub access_type: AccessType, } #[derive(Debug, Clone, Serialize, Deserialize)] pub enum AccessType { Read, Write, Delete, Create } /// A content-addressed snapshot of a single resource. #[derive(Debug, Clone, Serialize, Deserialize)] pub struct SnapshotRecord { pub snapshot_id: SnapshotId, pub resource_id: ResourceId, pub content_hash: [u8; 32], /// Inline content for resources below the size threshold. pub content: Option<Vec<u8>>, /// External content-addressable store key for large resources. pub cas_key: Option<String>, pub captured_at_us: i64, }

4.3 Async Intercept Pipeline

The intercept pipeline is structured as a sequence of Tokio tasks connected by channels. When the proxy accepts a new connection from the LLM host, it spawns a ConnectionSession task that owns the inbound and outbound message queues. Tool call messages are dispatched to a pipeline processing task, which executes the interceptor chain synchronously within the Tokio cooperative scheduler, avoiding the overhead of spawning a separate task per call. Snapshot I/O (reading file content before a write call) is performed with tokio::fs to avoid blocking the executor thread, and ledger writes are offloaded to the dedicated ledger-writer task via an mpsc channel of type tokio::sync::mpsc::Sender<LedgerWriteOp>.

The proxy multiplexes multiple upstream MCP server connections behind a single downstream-facing endpoint. Each upstream server has its own reconnecting connection manager that handles server restarts gracefully. The capabilities manifest presented to the LLM host is the union of all upstream servers' manifests, with tool names namespaced by server identifier to avoid collisions.

4.4 Storage Backend

The RocksDB instance is opened with three column families: cf_entries (ledger entries keyed by big-endian sequence number for ordered iteration), cf_snapshots (snapshot records keyed by snapshot ID), and cf_resource_index (an inverted index mapping resource IDs to the list of sequence numbers of calls that accessed them, used to accelerate dependency-graph construction). The resource index is updated atomically with the entry write using RocksDB's WriteBatch API, ensuring that the index and the entry are always consistent even in the presence of a crash.

For the content-addressable store (CAS) used for large file snapshots, memplane defaults to a local directory of flat files named by their SHA-256 hash, with an optional S3-compatible backend for distributed deployments. The CAS layer is abstracted behind a ContentStore trait, allowing additional backends to be added without modifying the snapshot engine.

5. Evaluation

We evaluated memplane across three dimensions: per-call proxy overhead, undo operation latency as a function of session size, and storage overhead relative to raw MCP traffic volume. Experiments were conducted on an Apple M2 Pro (12-core) running macOS 14.5, with the proxy, LLM host, and MCP server all running on the same machine to isolate proxy-specific overhead from network effects. The MCP server used in benchmarks was a filesystem tool server backed by an NVMe SSD. Session corpora were generated from real AI-assisted coding sessions and augmented with synthetic workloads to test boundary conditions.

5.1 Proxy Overhead

Call Type Median Overhead (µs) p95 Overhead (µs) p99 Overhead (µs) Notes
Read-only (no snapshot) 18 31 52 Ledger write only
Destructive, small file (<64 KB) 38 67 104 Snapshot + ledger write
Destructive, medium file (1 MB) 312 489 621 File read dominates
Destructive, large file (10 MB) 2,840 3,910 4,450 CAS write included
Shell command (no file snapshot) 22 38 61 No resource snapshot possible
Database row mutation (SQLite) 94 147 198 Row snapshot via MVCC
Table 1. Per-call proxy overhead by call type. All values are measured as additional latency introduced by the proxy relative to direct host-to-server communication. Tool execution time (typically 1–500 ms for realistic calls) is not included.

For the most common case, destructive calls operating on small files that constitute the majority of code-editing operations, the median overhead is 38 microseconds. This is negligible relative to the execution time of even the fastest MCP tools (file reads and writes typically complete in 0.5–5 milliseconds on modern hardware). The overhead for large files is dominated by the time to read the file for snapshotting, not by any memplane-specific computation; future work on lazy snapshotting (computing the hash first and deferring full read to actual undo time) is expected to reduce this significantly.

5.2 Undo Operation Latency

Session Size (calls) Undo Set Size Dep. Graph Build (ms) Restore Execution (ms) Total Undo Latency (ms)
100 5 0.4 1.2 1.6
500 12 1.1 3.7 4.8
1,000 20 2.3 5.9 8.2
2,000 31 4.4 7.1 11.5
5,000 47 9.8 12.3 22.1
Table 2. Undo operation latency by session size. "Undo Set Size" is the number of calls in the dependency closure. "Dep. Graph Build" is time to load and traverse the dependency graph. "Restore Execution" is time to apply snapshot restores. Measurements are medians over 50 trials per configuration.

Undo latency scales sub-linearly with session size because the dependency graph traversal is bounded by the undo set size (which grows slowly as sessions grow, since most new calls are independent of prior ones), not by the total session size. For the practical range of sessions encountered in developer workflows (under 2,000 calls per session), total undo latency is comfortably below 12 milliseconds, which is imperceptible in interactive use.

5.3 Storage Overhead

Workload Raw MCP Traffic (MB) Ledger Size (MB) Snapshot Store (MB) Total Overhead Ratio
Code generation (500 calls) 4.2 5.1 1.8 1.64x
File refactoring (300 calls) 18.7 19.4 7.3 1.43x
Database migrations (200 calls) 1.1 1.4 0.4 1.64x
Mixed session (1,000 calls) 31.5 33.2 11.6 1.42x
Table 3. Storage overhead relative to raw MCP traffic. Content deduplication in the snapshot store reduces overhead when the same file is snapshotted multiple times within a session.

The overall storage overhead of 1.4x is modest and comparable to the overhead of maintaining a git history for a project of similar scope. Content deduplication in the snapshot store is particularly effective for file-refactoring workloads, where the same file may be written multiple times in a session and intermediate snapshots that are superseded by later ones share content with adjacent versions. Automated ledger compaction (removing entries older than a configurable retention window and deduplicating snapshot content) further reduces long-term storage growth.

6. Discussion

6.1 Trade-offs and Limitations

The principal trade-off in memplane's design is between the cost of pre-emptive snapshotting and the fidelity of undo. By snapshotting before every destructive call, we ensure that undo is always available without requiring a full session replay. The cost is the snapshot overhead documented in Table 1 and the storage overhead in Table 3. For workloads dominated by large-file mutations, this cost may be significant, and the lazy snapshotting optimization mentioned in Section 5.1 merits further investigation.

Partial undo is a fundamental limitation that cannot be eliminated through better design. Some tool effects, including outbound network requests, spawned processes that have already exited, and non-MVCC database writes in external systems, leave no snapshot-restorable state. memplane handles these cases by emitting clear warnings in the dry-run output and proceeding with the remaining restorable portion of the undo set. Developers should treat partial undo warnings as a signal to verify externally visible side effects manually. Future work could integrate with external systems' own audit logs (e.g., outbound request logs from a proxy, database binary logs) to provide higher-fidelity undo for these cases.

The dependency-graph approach assumes that resource identifiers are stable and that the resource access annotations provided at snapshot time are accurate. If an MCP tool writes to a resource under a name that differs from the name used by a subsequent tool to read it (for example, symlinks, database aliases, or path normalization differences), the dependency will be missed and the resulting undo set may be incomplete. memplane mitigates this by canonicalizing file paths and resolving symlinks at annotation time, but the general problem of resource identity aliasing remains an open research challenge.

6.2 Security Considerations

The ledger's hash-chaining scheme provides tamper evidence but not confidentiality. In deployments where tool-call inputs and outputs may contain sensitive data (API keys passed as parameters, database query results containing PII), the ledger should be encrypted at rest. memplane supports optional AES-256-GCM encryption of ledger and snapshot content using a key stored in the system keychain. Redaction interceptors can also be stacked in the pipeline to strip known-sensitive fields from entries before they are written to the ledger.

The proxy itself occupies a privileged position in the communication path and must be deployed with appropriate access controls. A compromised proxy could suppress tool-call records or inject synthetic calls into the ledger. Defense against this requires attestation of the proxy binary (e.g., via code signing and process-level integrity monitoring) and periodic ledger verification by an independent process that checks the hash chain.

6.3 Multi-Agent and Concurrent Session Support

The current implementation handles multiple simultaneous MCP connections from a single LLM host process. A growing class of deployment scenarios involves multiple coordinating LLM agents, each with their own host process, operating on a shared file system or database. In such scenarios, the dependency graph must account for inter-session dependencies: a file written by agent A's tool call and subsequently read by agent B's tool call creates a cross-session dependency that would not be visible within either agent's individual call graph.

We plan to extend memplane with a shared ledger mode in which multiple proxy instances write to the same RocksDB ledger (using RocksDB's secondary instance feature for readers and a single writer process for serialization). The dependency-graph construction algorithm is unchanged; cross-session edges are simply edges whose endpoints belong to different session namespaces. Undo operations in shared-ledger mode require authorization from all affected sessions, implementing a simple multi-party consent model for collaborative rollback.

6.4 Relationship to Provenance Research

memplane is related to a broader body of work on data provenance: tracking the origins and transformations of data through a computation (Cheney et al., 2009; Buneman et al., 2001). The ledger can be understood as a provenance record for the file system and database state produced by an agent session, where each entry records both the transformation applied (the tool call) and the input and output states. Unlike general-purpose provenance systems, which must track data lineage through arbitrary computations, memplane operates at the coarser granularity of MCP tool calls, which are semantically meaningful units with declared resource effects. This coarser granularity makes the dependency graph more tractable to construct and query while still providing sufficient fidelity for developer-oriented undo operations.

7. Conclusion

We have presented memplane, a transparent MCP proxy that provides tamper-evident recording of LLM agent tool calls and surgical undo capability for AI-assisted development workflows. By operating at the protocol layer, memplane requires no modifications to existing MCP-compliant LLM hosts or tool servers, and its composable interceptor architecture allows additional behaviors to be layered on without disrupting the core recording and undo functionality.

Our evaluation demonstrates that the system's per-call overhead is negligible for typical development workloads, undo operations complete in well under 20 milliseconds for sessions of practical size, and storage overhead is a modest 1.4x relative to raw MCP traffic. The surgical undo algorithm, based on dependency-closure computation over the recorded call graph, correctly identifies the minimal set of calls that must be reversed to restore a desired prior state without disturbing unrelated work.

As LLM agents take on increasingly consequential roles in software development, not merely suggesting code but autonomously executing complex multi-step operations, the ability to observe, audit, and selectively reverse their actions becomes a prerequisite for safe deployment. memplane represents a step toward making AI-assisted development as recoverable and auditable as traditional human-driven development, while imposing minimal friction on the workflows it protects.

The source code for memplane is available under the MIT license at https://github.com/VMaroon95/memplane.


References

Anthropic. (2024). Model context protocol: Specification and reference implementation. Anthropic Technical Report. https://modelcontextprotocol.io/specification
Berlage, T. (1994). A selective undo mechanism for graphical user interfaces based on command objects. ACM Transactions on Computer-Human Interaction, 1(3), 269–294.
Bonwick, J., Ahrens, M., Henson, V., Maybee, M., & Lofstead, M. (2003). The zettabyte file system. USENIX Conference on File and Storage Technologies (FAST).
Buneman, P., Khanna, S., & Tan, W.-C. (2001). Why and where: A characterization of data provenance. Proceedings of the International Conference on Database Theory (ICDT), 316–330.
Cheney, J., Chiticariu, L., & Tan, W.-C. (2009). Provenance in databases: Why, how, and where. Foundations and Trends in Databases, 1(4), 379–474.
Facebook Engineering. (2013). RocksDB: A persistent key-value store for flash and RAM storage. https://rocksdb.org
LangChain Inc. (2024). LangSmith: Observability and evaluation for LLM applications. https://smith.langchain.com
Mason, C. (2007). Btrfs: The Linux B-tree filesystem. Oracle Corporation Technical White Paper.
Myers, B. A. (1987). User interface tools: Introduction and survey. IEEE Software, 6(1), 15–23.
OpenTelemetry Authors. (2023). OpenTelemetry specification v1.26. Cloud Native Computing Foundation. https://opentelemetry.io/docs/specs/otel
Pedersen, C., & Contributors. (2019). Tower: A library of modular and reusable components for building clients and servers. https://crates.io/crates/tower
Ressel, M., Nitsche-Ruhland, D., & Gunzenhäuser, R. (1996). An integrating, transformation-oriented approach to concurrency control and undo in group editors. Proceedings of the ACM Conference on Computer Supported Cooperative Work (CSCW), 288–297.
Torvalds, L. (2005). Git: Fast version control system. https://git-scm.com
Weights & Biases. (2024). Weave: LLM tracing and evaluation. https://wandb.ai/site/weave

Submitted to: Proceedings of the ACM SIGSOFT International Symposium on Foundations of Software Engineering (FSE), 2027 cycle.
Correspondence: Varun Meda <varun@vmaroon95.dev>
Artifact: https://github.com/VMaroon95/memplane
© 2026 Varun Meda. All rights reserved.