@t402/mcp
Model Context Protocol (MCP) server for AI agent payments with Claude Desktop.
Installation
# Install globally
npm install -g @t402/mcp
# Or run directly
npx @t402/mcpFeatures
- 11 tools for AI agents (6 base + 5 WDK wallet tools)
- Multi-chain support (EVM, TON, TRON, Solana, and more)
- Demo mode for testing without real transactions
- Claude Desktop integration
- WDK wallet management for autonomous agents
MCP Tools
Base Tools (6)
| Tool | Description |
|---|---|
t402/verify | Verify a payment authorization |
t402/settle | Settle a verified payment on-chain |
t402/supported | List supported networks and schemes |
t402/getRequirements | Get payment requirements for a resource |
t402/getAllBalances | Check balances across all supported networks |
t402/pay | Execute stablecoin payment |
WDK Tools (5, requires seed phrase)
| Tool | Description |
|---|---|
wdk/getWallet | Get WDK wallet address and info |
wdk/getBalances | Check WDK wallet balances |
wdk/transfer | Transfer tokens from WDK wallet |
wdk/swap | Swap tokens via WDK |
t402/autoPay | Autonomously pay for a 402-protected resource |
Claude Desktop Setup
Add to your Claude Desktop configuration (claude_desktop_config.json):
{
"mcpServers": {
"t402": {
"command": "npx",
"args": ["@t402/mcp"],
"env": {
"T402_PRIVATE_KEY": "0x...",
"T402_DEMO_MODE": "true"
}
}
}
}Configuration Options
| Environment Variable | Description | Default |
|---|---|---|
T402_PRIVATE_KEY | EVM private key for signing | Required (or WDK seed) |
T402_WDK_SEED_PHRASE | WDK seed phrase (enables 5 WDK tools) | Optional |
T402_DEMO_MODE | Enable demo mode (no real transactions) | false |
T402_RPC_ETHEREUM | Custom Ethereum RPC URL | Public RPC |
T402_RPC_BASE | Custom Base RPC URL | Public RPC |
T402_RPC_ARBITRUM | Custom Arbitrum RPC URL | Public RPC |
Usage Examples
Once configured, you can ask Claude to:
“Check my USDT balance on Arbitrum”
“Send 10 USDT0 to 0x1234… on Base”
“What’s the fee to bridge 100 USDT0 from Arbitrum to Ethereum?”
“Bridge 50 USDT0 from Arbitrum to Ethereum”
Demo Mode
Demo mode simulates transactions without executing them:
T402_DEMO_MODE=true npx @t402/mcpIn demo mode:
- Balances return mock values
- Payments return simulated transaction hashes
- No real blockchain transactions occur
Tool Details
t402/getBalance
Check balance on a specific network.
Input:
{
"network": "eip155:8453",
"token": "USDT0"
}Output:
{
"balance": "1000000000",
"formatted": "1000.00 USDT0",
"network": "eip155:8453"
}t402/pay
Execute a stablecoin payment.
Input:
{
"to": "0x...",
"amount": "1000000",
"network": "eip155:8453",
"token": "USDT0"
}Output:
{
"txHash": "0x...",
"amount": "1000000",
"network": "eip155:8453",
"status": "confirmed"
}t402/bridge
Bridge USDT0 between chains.
Input:
{
"fromChain": "arbitrum",
"toChain": "ethereum",
"amount": "100000000",
"recipient": "0x..."
}Output:
{
"txHash": "0x...",
"messageGuid": "0x...",
"fromChain": "arbitrum",
"toChain": "ethereum",
"estimatedTime": 900
}Supported Networks
| Network | ID | Tokens |
|---|---|---|
| Ethereum | eip155:1 | USDT0, USDC, USDT |
| Base | eip155:8453 | USDT0, USDC |
| Arbitrum | eip155:42161 | USDT0, USDC |
| Optimism | eip155:10 | USDT0, USDC |
| Polygon | eip155:137 | USDC, USDT |
| Ink | eip155:57073 | USDT0 |
| Berachain | eip155:80094 | USDT0 |
| Unichain | eip155:130 | USDT0 |
Security Considerations
- Store private keys securely (use environment variables)
- Enable demo mode for testing
- Set spending limits in your application
- Monitor agent actions and transactions
Programmatic Usage
import { createMcpServer } from '@t402/mcp'
const server = createMcpServer({
privateKey: process.env.PRIVATE_KEY,
demoMode: process.env.NODE_ENV !== 'production'
})
// Use with MCP client
await server.start()