r402-mcp
v0.1.0
Published
mcp server for the r402 execution-proof verifier on base mainnet
Readme
r402-mcp
mcp server for r402 · verify $R execution proofs anchored on base mainnet · local: recompute the payload hash, recover the signer, and read the ExecutionLog contract over public rpc
two tools: verify_execution (free, local verify) · query_signers (free, direct rpc).
install
claude code:
claude mcp add r402 -- npx -y r402-mcpclaude desktop (claude_desktop_config.json):
{
"mcpServers": {
"r402": {
"command": "npx",
"args": ["-y", "r402-mcp"]
}
}
}environment
| var | required | what |
|---|---|---|
| BASE_RPC_URL | no | base mainnet rpc for verify_execution and query_signers. default https://mainnet.base.org |
no private key, no payment. the server never reads .env by itself. env comes from the mcp client config, or node --env-file=.env for local runs.
tools
verify_execution
price: free. verifies an execution proof locally and never relays a remote verdict:
- recompute
keccak256(canonical_bytes(payload))(SCHEMA.md §2 canonicalization). - recover the eip-191 signer from
signatureover that hash. - read the
ExecutionLoganchor (0xd5A9DAF8F2134b61b73cEfaF5c9094EA162f1a1c) fortxHashover rpc and decodeExecutionRecorded(signer, payloadHash). verifiedis true only when the recomputed hash equals the anchored hash and the recovered signer equals the anchored signer.
params:
payload· the off-chain execution payload json (v0.1 schema) that was signed and anchoredsignature· 0x-prefixed 65-byte eip-191 signature over the payload hashtxHash· 0x-prefixed 32-byte tx hash of the anchor on base
a complete demo triple lives in examples/demo-anchor.json (verify it yourself: examples/verify-demo.md).
verify_execution {
"payload": {
"version": "0.1.0",
"agent_id": 20617,
"robot_id": "sim-lerobot-pusht-ep1",
"episode_id": "ep_2026-06-19T15-04-10Z_pusht1",
"task": "push T to goal (lerobot/pusht reference replay)",
"started_at": "2026-06-19T15:04:10Z",
"ended_at": "2026-06-19T15:04:28Z",
"duration_seconds": 18.4,
"frames": 521,
"metrics": {
"rmse": 3.214,
"jerk": 1581043,
"end_variance": 0
},
"score": 0.88,
"outcome": "SUCCESS"
},
"signature": "0x30b36f9ec1bbb18a40247e52568a41c9c424adec7c5209cc7a4da9b47ca35be645b1243a430bf63845d1eb12858b321f2924b5264371a543358ba29f9a8d5c911b",
"txHash": "0xee10ef6a112f05d9d3761aa055ab258f1afffd54f8c02212366e96a1da0915bb"
}verified (recomputed hash and recovered signer both match the anchor):
{
"verified": true,
"signer": "0x82960f3322a7B1d2a2e756Efcbd4d1D56B613314",
"payloadHash": "0x1d646db564305a51e5e617245a54bd6fc3bd457cb82488397ba38e1e1c559f26",
"signature": "0x30b36f9ec1bbb18a40247e52568a41c9c424adec7c5209cc7a4da9b47ca35be645b1243a430bf63845d1eb12858b321f2924b5264371a543358ba29f9a8d5c911b",
"block": 47568429,
"timestamp": 1781926205,
"txHash": "0xee10ef6a112f05d9d3761aa055ab258f1afffd54f8c02212366e96a1da0915bb"
}not verified (hash mismatch, signer mismatch, no anchor event in the tx, or reverted tx):
{ "verified": false, "reason": "recovered signer does not match the on-chain anchor" }query_signers
price: free. reads ExecutionRecorded events of the executionlog contract (0xd5A9DAF8F2134b61b73cEfaF5c9094EA162f1a1c) directly over rpc, from deploy block to tip.
params: limit · max signers to return, 1-100, default 50
query_signers { "limit": 10 }{
"signers": [
{ "address": "0x156d727f372d06132526612b7d34ce1693365bf3", "anchor_count": 8, "first_seen_block": 46166512 }
],
"total_anchors": 14
}dev
pnpm install
pnpm test
pnpm build
node --env-file=.env dist/server.jslicense
mit
