zerok-mcp
v0.2.3
Published
MCP server for the ZeroK privacy protocol — gives any AI agent private, gasless SOL payments on Solana via simple tools.
Readme
zerok-mcp
An MCP server that gives any MCP-capable AI agent — Claude Desktop, Claude Code, Cursor, or your own — private, gasless SOL payments on Solana. The agent just decides amounts and recipients; all the zero-knowledge proving, note management, and relay communication is hidden, exactly like a person using the web app.
This is a primitive other agents plug into, not an agent itself. Connect it to whatever AI agent or tool you already use.
Tools exposed
| Tool | Input | What it does |
|---|---|---|
| zerok_address | — | Your wallet's public key (where deposits are funded from) |
| zerok_balance | asset? | Shielded balance + note breakdown. Reconciles with the chain first, so notes already spent from another device are not reported as yours. Returns three different numbers — send maxSendableSol, never balanceSol |
| zerok_deposit | amount_sol, asset?, idempotency_key? | Shield funds into the vault (multiple of the 0.01 grid; auto-split into notes) |
| zerok_preview | amount_sol, asset?, recipient? | Price a send without moving anything. The fee is charged PER TRANSACTION, so cost tracks how fragmented your notes are, not the amount |
| zerok_send | amount_sol or send_max, recipient, asset?, idempotency_key? | Send privately and gasless — recipient needs no SOL and never sees you |
| zerok_consolidate | asset?, recipient? | Reclaim dust notes too small to cover their own fee |
| zerok_recover | asset?, force? | Rebuild note state from on-chain memos — same wallet, same funds, new machine |
Assets: SOL on every network; USDC/TEST6 on devnet (zerok_spl is not deployed on mainnet).
Set a default with ZEROK_ASSET, or pass asset per call.
Networks: ZEROK_NETWORK=devnet (the default, deliberately) or mainnet-beta. Reaching
mainnet should be an explicit act.
⚠️ Before you point this at mainnet
zerok_sendmoves real money, and a private gasless send is irreversible and untraceable — there is no chargeback and no counterparty to appeal to. The model on the other end of this server can be steered by anything it reads: a web page, a file, an email in its context. Treat it as holding a hot wallet, not as a trusted operator.
- Start on devnet. The examples below use it on purpose.
- A per-session spend cap is enforced (default
1, override withZEROK_SESSION_CAP_SOL). It bounds a runaway loop or a prompt injection; it is a safety rail, not a security boundary.- Fund the keypair with only what you are willing to lose to a confused turn. This server reads your keypair from disk — it has full spending authority for as long as it runs.
- Tools are annotated (
readOnlyHint/destructiveHint) so a client can prompt before the ones that move money. Whether it does prompt is up to that client — do not rely on it.
Setup
Nothing to clone — it's on npm. You only need a Solana keypair JSON with some SOL (the deposit source). The recipient needs nothing — the relay pays gas.
Connect it to your agent
The keypair stays on your machine; the server reads it locally and never transmits it.
Claude Desktop — claude_desktop_config.json
{
"mcpServers": {
"zerok": {
"command": "npx",
"args": ["-y", "zerok-mcp"],
"env": {
"SOLANA_KEYPAIR": "/home/you/.config/solana/id.json",
"ZEROK_NETWORK": "devnet"
}
}
}
}Claude Code — .mcp.json (project) or claude mcp add
claude mcp add zerok -e SOLANA_KEYPAIR=~/.config/solana/id.json -e ZEROK_NETWORK=devnet -- npx -y zerok-mcpAny MCP client
Run npx -y zerok-mcp over stdio with the env vars below. The server speaks standard MCP.
Configuration (env)
| Var | Required | Default |
|---|---|---|
| SOLANA_KEYPAIR | ✅ | — (path to keypair JSON, ~ allowed) |
| ZEROK_NETWORK | | mainnet-beta (or devnet) |
| ZEROK_RPC | | network default (public mainnet RPC) |
| ZEROK_RELAY | | network default (ZeroK mainnet relay) |
| ZEROK_NOTES_DIR | | ./.zerok/<pubkey8> — where notes persist |
Once connected, just ask your agent
"Shield 1 SOL with ZeroK, then send 0.3 privately to
<address>."
The agent calls zerok_deposit(1) then zerok_send(0.3, <address>). Notes persist to disk automatically, so the agent never loses access across restarts.
Live protocol
- Program:
HVcTokFF4rwvcU7sC7GjS317CSf7QDgfCvW7edijKS2v(Solana mainnet) - Pools: 0.1 / 1 / 10 / 100 / 1000 SOL · 0.3% fee (min 0.002 SOL) · gasless via relay
- Docs: https://docs.zerok.app/agents
GPL-3.0.
