@b402ai/mcp
v0.1.4
Published
Private DeFi MCP server for AI agents. 12 tools. ZK proofs. Gasless. Base.
Downloads
550
Maintainers
Readme
@b402ai/mcp
Private DeFi MCP server for AI agents. Every DeFi primitive on Base — privately.
12 tools. ZK proofs. Gasless. No wallet trace on-chain.
Install
claude mcp add b402 --scope user -e WORKER_PRIVATE_KEY=0x... -- npx -y @b402ai/mcp@latestOr for Cursor / other MCP clients, add to your config:
{
"mcpServers": {
"b402": {
"command": "npx",
"args": ["-y", "@b402ai/mcp@latest"],
"env": {
"WORKER_PRIVATE_KEY": "0x..."
}
}
}
}Tools
Privacy Pool
| Tool | Description |
|------|-------------|
| shield_usdc | Move USDC into Railgun privacy pool (ZK encrypted) |
| check_pool_balance | Check shielded balances, wallet, and positions |
| private_swap | Swap tokens inside the pool (ZK proof, no trace) |
| lend_privately | Deposit to Morpho vault from pool (3-4% APY) |
| redeem_privately | Withdraw from vault back to pool |
| run_strategy | Autonomous: swap + lend + reserve, all private |
Credit Payments (optional, requires SEQUENCER_URL)
| Tool | Description |
|------|-------------|
| check_balance | Check agent credit balance |
| topup_credits | Add USDC credits |
| open_session | Open credit session with spending cap |
| pay_privately | BLS-signed API payments (batch N calls) |
| close_session | Close session, refund unspent |
| settle_batch | On-chain settlement + BLS proof verification |
Example
> check my private pool balance
Privacy Pool:
USDC: 60.32
WETH: 0.001
> run a private yield strategy with $10 USDC
Strategy deployed:
1. Private swap: 2 USDC → 0.001 WETH
2. Private lend: 4 USDC → Steakhouse vault (3% APY)
3. Reserve: 4 USDC stays shielded
3 operations. 0 wallet trace. All gasless.How it works
Every operation goes through Railgun's privacy pool using zero-knowledge proofs. On-chain, only a relay contract appears — no wallet is ever linked to the transactions.
- Gasless — no ETH needed, gas is sponsored
- Anonymous — fresh wallet derived from your key, no on-chain identity
- ZK-proven — client-side Groth16 proofs for every private operation
- Base mainnet — real DeFi (Morpho, Aerodrome, 0x), real yield
Environment
| Variable | Required | Description |
|----------|----------|-------------|
| WORKER_PRIVATE_KEY | Yes | Base wallet private key |
| BASE_RPC_URL | No | Base RPC (default: public) |
| SEQUENCER_URL | No | Credit sequencer URL (enables payment tools) |
Links
- SDK: @b402ai/sdk
- Docs: b402.ai
- GitHub: b402ai/b402-sdk
