ZAP Protocol
Zero-Copy App Proto — High-performance Cap'n Proto RPC for AI agent communication. 10-100x faster than MCP with post-quantum security.
ZAP (Zero-Copy App Proto) is a high-performance communication protocol for AI agents built on Cap'n Proto. It provides full MCP compatibility with 10-100x performance improvements, post-quantum security, and native support for 11 programming languages.
curl -fsSL https://hanzo.sh | sh && hanzo mcp launch zapWhy ZAP?
- Zero-Copy Performance — Cap'n Proto's zero-copy serialization eliminates parsing overhead
- MCP Compatible — Full backward compatibility with Model Context Protocol servers
- Post-Quantum Security — ML-KEM and ML-DSA cryptography for future-proof security
- Multi-Language — Native bindings for Rust, Go, Python, JavaScript, C++, and 6 more
- Agent Consensus — Built-in voting mechanism for multi-agent response aggregation
- W3C DID — Native decentralized identity support
OverviewArchitecture and core conceptsGetting StartedInstall ZAP and build your first agentSchema LanguageCap'n Proto schema referenceProtocol SpecWire format and RPC detailsLanguage BindingsSDK docs for 11 languagesAdvanced TopicsPost-quantum crypto, consensus, blockchain
Quick Example
interface Zap {
init @0 (client :ClientInfo) -> (server :ServerInfo);
listTools @1 () -> (tools :ToolList);
callTool @2 (call :ToolCall) -> (result :ToolResult);
listResources @3 () -> (resources :ResourceList);
readResource @4 (uri :Text) -> (content :ResourceContent);
}use zap_protocol::{Zap, ClientInfo};
#[tokio::main]
async fn main() -> Result<()> {
let client = Zap::connect("zap://localhost:9000").await?;
let info = client.init(ClientInfo::new("my-agent", "1.0.0")).await?;
let tools = client.list_tools().await?;
for tool in tools {
println!("Tool: {} - {}", tool.name, tool.description);
}
Ok(())
}ZAP vs MCP
| Feature | MCP | ZAP |
|---|---|---|
| Serialization | JSON-RPC | Cap'n Proto |
| Performance | Baseline | 10-100x faster |
| Memory | High (parsing) | Zero-copy |
| Post-Quantum | No | ML-KEM, ML-DSA |
| Threshold Signing | No | Corona |
| DID Support | No | W3C DIDs |
| Agent Consensus | No | Built-in voting |
ZAP includes MCP Gateway Mode for seamless migration from existing MCP servers.
Overview
Understanding ZAP architecture and core concepts
Getting StartedInstall ZAP and build your first AI agent
Schema LanguageCap'n Proto schema reference for ZAP
Protocol SpecificationZAP wire format, encoding, and RPC semantics
The Local RouterOne ZAP router per user, embedded in every process that speaks ZAP — no daemon
Language BindingsZAP SDK documentation for all supported languages
Advanced TopicsPost-quantum cryptography, consensus, identity, and blockchain integration
Was this page useful?