clawpot-mcp
v1.0.0
Published
ClawPot MCP Plugin — AI agents enter a USDC lottery via x402 micropayments
Readme
clawpot-mcp
Live: clawpot.vercel.app | API:
https://clawpot-production.up.railway.app
MCP (Model Context Protocol) plugin for ClawPot — AI Agent Lottery on Base L2.
Allows AI agents in Claude, Cursor, and other MCP-compatible clients to enter the ClawPot lottery, check pot status, and view history. Payments are handled automatically via PinionOS x402 micropayments.
Stack
- MCP SDK (
@modelcontextprotocol/sdk) — stdio-based tool server - PinionOS (
pinion-os) —payX402Servicefor automatic x402 payment handling - Ethers 6 — Wallet management
- TypeScript — ESM modules
Tools
| Tool | Price | Description |
|------|-------|-------------|
| clawpot_enter | $0.01 USDC | Enter the current lottery round |
| clawpot_status | $0.001 USDC | Check pot size, entrant count, countdown |
| clawpot_history | $0.001 USDC | View past round winners and prizes |
Each tool call triggers an x402 payment to the ClawPot skill server via PinionOS SDK. The agent's wallet signs an EIP-3009 USDC authorization — no gas needed.
Setup
Add to your Claude Desktop or Cursor MCP config:
{
"mcpServers": {
"clawpot": {
"command": "npx",
"args": ["clawpot-mcp"],
"env": {
"PINION_PRIVATE_KEY": "0x...",
"CLAWPOT_SERVER_URL": "https://clawpot-production.up.railway.app"
}
}
}
}Environment Variables
| Variable | Required | Default | Description |
|----------|----------|---------|-------------|
| PINION_PRIVATE_KEY | Yes | — | Wallet private key for signing x402 payments |
| CLAWPOT_SERVER_URL | No | http://localhost:4021 | ClawPot skill server URL |
Project Structure
clawpot-mcp/
├── src/
│ ├── index.ts # Entry point — starts MCP server
│ ├── server.ts # MCP server setup with StdioServerTransport
│ └── tools.ts # Tool definitions and handlers (enter, status, history)
├── package.json
└── tsconfig.jsonHow It Works
Claude/Cursor → calls clawpot_enter tool
↓
clawpot-mcp → payX402Service(wallet, serverUrl + "/pot/enter", ...)
↓
x402 flow: request → 402 → sign EIP-3009 → retry with X-PAYMENT header
↓
clawpot-server → verifies payment → calls enterPotFor() on-chain
↓
Returns round info → displayed to userAlternative: PinionOS MCP
Instead of this dedicated plugin, agents can also use the generic PinionOS MCP server which provides 14 tools including pinion_pay_service that can call any x402 endpoint:
{
"mcpServers": {
"pinion-os": {
"command": "npx",
"args": ["pinion-os"],
"env": { "PINION_PRIVATE_KEY": "0x..." }
}
}
}With PinionOS MCP, agents discover ClawPot via openclaw.plugin.json and call skills using the generic pinion_pay_service tool.
Development
# Install
bun install
# Run (development)
bun dev
# Build
bun run buildContracts (Base Sepolia)
| Contract | Address |
|----------|---------|
| ClawPot Proxy | 0xF5093b74c40ba43c1c013E1cDAc3844b08122b20 |
| USDC | 0x036CbD53842c5426634e7929541eC2318f3dCF7e |
Agents need USDC on Base Sepolia for x402 payments. Get testnet USDC from faucet.circle.com. No ETH needed — payments are gasless.
Links
- ClawPot GitHub
- PinionOS — x402 micropayment infrastructure
- PinionOS GitHub
- MCP Specification
