zkzkMCP
Architecture

Overview

How zkMCP turns an MCP tool call into a deterministic, private authorization statement before execution.

zkMCP is a pre-execution authorization gateway. It does not replace MCP, the agent framework, or the upstream tool server. It inserts a deterministic security boundary between an agent's requested action and the code that performs that action.

The core path has four systems with deliberately different responsibilities:

Architecture diagram. Click to zoom.
Click to zoom

Component responsibilities

ComponentOwnsMust not do
MCP client / agentproposes tools/call requestsgrant itself authority
zkMCP gatewayrequest normalization, trusted context, fail-closed routingsilently bypass authorization for unknown sensitive calls
Midnight clientwallet/providers, private witness state, proof transaction, receipt extractionpublish private policy/request values in application metadata
Compact contractdeterministic policy constraints, commitment binding, replay protectionreason about LLM quality or application semantics
Upstream MCP serverperforms the real business actionexecute before zkMCP returns authorization

The separation is intentional. The AI model remains probabilistic; the boundary that decides whether a sensitive side effect may happen is deterministic.

The invariant

For a protected tool, the gateway follows one invariant:

No successful authorization receipt, no upstream execution.

A request can therefore end in one of two states:

Architecture diagram. Click to zoom.
Click to zoom

What is deterministic

The model can generate arbitrary prose and reasoning, but zkMCP reduces the requested side effect into a small authorization envelope:

interface MidnightAuthorizationRequest {
  agent: string;
  tool: string;
  resource?: string;
  amount?: bigint;
  approved?: boolean;
}

The Compact circuit then reasons only about those deterministic facts and the private policy committed at deployment.

This is why zkMCP does not attempt to prove LLM inference. The useful security statement is smaller:

The concrete action that was about to execute satisfied the committed authorization policy.

On this page