MCP Agentic Wallet — open-source session management for x402

io.github.MCPVOT由 GitHub 账号 MCPVOT 发布v1.0.1更新于 Oct 24, 2026

Open-source EIP-2612 Permit-based wallet sessions for AI agents using MCP.

发布方自己的服务:agentic.no

已验证STDIO仅桌面金融开发者工具

概览

AI 生成的概览

开源参考实现,基于 EIP-2612 Permit 的钱包会话,让 AI 代理用 Base 上的 USDC 为 MCP 工具调用付费。

可以做什么
在链上验证 EIP-712 Permit 签名,为已连接的钱包创建会话令牌,并带有额度上限、截止期限、速率限制和会话撤销。按工具调用扣减会话预算,并通过 transferFrom 将每次调用在链上结算到金库地址。向 USDC 合约提交 permit 交易,并查询某所有者与花费者之间的链上 USDC 授权额度。提供与框架无关的核心库,以及带钱包授权页面的 Next.js 参考服务器。
适用场景
适合在构建或运行付费 MCP 服务器时使用,让代理按调用以 Base 上的 USDC 付费,无需 API 密钥或订阅;也适合作为 x402 类会话令牌支付流程的参考。
运行要求
以本地进程(stdio)运行,仅支持桌面端。参考服务器需从源码克隆,需要 Node.js 与 npm,以及 Base 主网 RPC 端点。必需环境变量:TREASURY_ADDRESS、HOT_WALLET_PRIVATE_KEY、NEXT_PUBLIC_TREASURY_ADDRESS;BASE_RPC_URL 可选。需要真人连接加密钱包并签署 Permit。
安装前请注意
需要热钱包私钥(HOT_WALLET_PRIVATE_KEY),该私钥掌控真实资金并支付 gas,切勿提交到代码库。会话会授权从用户钱包扣划链上 USDC,默认每会话上限 100 美元,每次工具调用都会向金库结算真实资金。结算失败后会话会被暂停。生产使用前请阅读威胁模型。

安装

在 SourceWeft 中

  1. 打开 控制台中的 MCP Agentic Wallet — open-source session management for x402,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

MCP Agentic Wallet

Open-source EIP-2612 Permit-based wallet sessions for AI agents. The reference implementation for paid MCP servers — verify signatures, manage sessions, settle on-chain. No API keys. No recurring charges.

[License: MIT] [TypeScript] [viem] [Base] [MCP]

What This Is

A human connects their crypto wallet, signs a one-time EIP-2612 Permit (gasless — no transaction fee), and receives a session token. AI agents use this token in MCP requests to pay for tool calls with USDC on Base. The server settles each call on-chain via transferFrom.

No API keys. No recurring charges. No per-call wallet signatures. The permit is the policy.

This is the reference implementation used by mcpvot.xyz — an x402 payment facilitator for MCP servers. The open-source core (@mcp-agentic-wallet/core) is framework-agnostic and works with any MCP server or Next.js app.

Quick Start

1. Install the core library

bash
npm install @mcp-agentic-wallet/core viem

2. Use in your MCP server

typescript
import { InMemoryStore, settleCall } from '@mcp-agentic-wallet/core';
const store = new InMemoryStore();
// In your MCP tool handler:const token = req.headers.get('Session-Token');const session = store.getSession(token);if (!session) return new Response('Payment required', { status: 402 });
// Consume budget ($0.005 = 5000 atomic USDC units)const result = store.consumeBudget(token, 5000n);if (!result.ok) return new Response('Insufficient budget', { status: 402 });
// Settle on-chainawait settleCall(session.humanAddress, 5000n, {  treasuryAddress: process.env.TREASURY_ADDRESS!,  hotWalletKey: process.env.HOT_WALLET_PRIVATE_KEY,});
return Response.json({ result: 'your data' });

3. Run the reference server

bash
git clone https://github.com/MCPVOT/mcp-agentic-wallet.gitcd mcp-agentic-walletnpm installcp .env.example .env.local  # Configure your treasury + hot wallet keynpm run dev

Visit http://localhost:3000/wallet to connect a wallet and authorize a session.

How It Works

Human                          Server                        Agent  │                              │                              │  │── connect wallet ──────────►│                              │  │── sign EIP-2612 Permit ───►│                              │  │   (gasless, 1-time)           │── verify signature ──────►│ (on-chain)  │                              │── submit permit() ────────►│ (on-chain, gas)  │                              │── create session ──────────┐│  │◄─ return session token ─────│◄───────────────────────────┘│  │                              │                              │  │                              │◄── Session-Token header ────│  │                              │── consume budget ───────────┐│  │                              │── transferFrom() ──────────►││ (on-chain, gas)  │                              │── return tool data ─────────┘│  │                              │◄──────────────────────────────│

Core Library (@mcp-agentic-wallet/core)

Class/FunctionDescription
InMemoryStoreSession store (in-memory, pluggable for KV/Redis)
verifyPermit()Verifies EIP-712 Permit signature on-chain via viem
settleCall()Executes transferFrom(human, treasury, amount) on Base
submitPermit()Submits the permit() transaction to USDC contract
checkAllowance()Reads on-chain USDC allowance for an owner→spender pair
checkRateLimit()Simple rate limiter (per-wallet)
toSessionInfo()Converts session to safe client-facing info (no permit signature)

Security

See SECURITY.md for the full threat model.

Key features:

  • EIP-712 signature verification — server verifies every permit signature on-chain before creating a session
  • Allowance cap — max $100 USDC per session (configurable)
  • Deadline cap — max 30 days
  • Rate limiting — 5 authorizations per wallet per hour
  • Session revocation — humans can revoke anytime
  • Settlement debt tracking — sessions suspended after 3 failed settlements
  • Spender verification — EIP-712 verification inherently checks spender === treasury

Documentation

Tech Stack

  • EIP-2612 (Permit) — gasless approval via typed data signature
  • EIP-712 — typed data signing and verification
  • USDC (FiatTokenV2) on Base Mainnet (chainId 8453)
  • viem — TypeScript Ethereum library
  • Next.js — reference server implementation
  • Model Context Protocol — MCP 2025-11-25 spec

Use Case: iRacing + Blockchain

MCPVOT uses this wallet to power on-chain sim-racing events:

  1. Host creates event — deploys an escrow smart contract on Base with entry fee + prize pool
  2. Drivers connect wallet — sign EIP-2612 Permit via this library, get a session token
  3. Drivers pay entry fee — transferFrom settles the entry to the escrow contract
  4. Race happens in iRacing — server polls iRacing Data API for finish order
  5. Smart contract auto-disburses — verified winners receive USDC/SOL from the prize pool

The iRacing MCP tools (get_race_results, lookup_driver, search_hosted_races) are available at mcpvot.xyz and use the same session-token flow for payment.

Configuration

Env VarRequiredDefaultDescription
TREASURY_ADDRESSYes—Address that receives USDC payments
HOT_WALLET_PRIVATE_KEYYes—EOA private key for gas (never commit to git!)
BASE_RPC_URLNohttps://mainnet.base.orgBase Mainnet RPC
NEXT_PUBLIC_TREASURY_ADDRESSYes—Treasury shown in wallet UI

License

MIT — see LICENSE

来源:README.md,提交 2c61473

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.0.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Agentic 集成