Devnet Live x402 Compatible MCP Server Solana Frontier Hackathon

The on-chain treasury layer
that x402 doesn't solve

Programmable spending controls for AI agents on Solana. Per-tx limits, daily caps, allowlists, emergency overrides — all enforced on-chain.

View on GitHub Try Live Demo
0
Vaults Created
0
Transactions
$0
Volume (USDC)
$0
Fees Collected
The Problem

AI agents can pay. But who controls the budget?

Coinbase x402, Stripe MPP, Google AP2 — they answer "how does an AI agent pay." None answer "how do you stop an agent from over-paying."

Last month, an AI trading agent in production lost $50K in 3 hours from a single prompt injection. The fix wasn't a smarter LLM — it was on-chain spending controls.

Per-tx + per-day limits
Enforced by a Solana program, not by the agent itself
Recipient allowlist
Compromised agents cannot exfiltrate to attacker addresses
Emergency override
Owner can freeze when agent keypair is suspected compromised
On-chain audit trail
PDA accounts — no separate dashboard required
Comparison

How AgentVault compares

Feature Coinbase x402 Stripe MPP Google AP2 AgentVault

AgentVault is x402-compatible. Use Coinbase's @x402/fetch client unchanged — we speak the same wire format.

Architecture

From agent to on-chain policy

AI Agents

Claude / Cursor / LangChain / Custom

MCP Server x402 HTTP Client
|
stdio / HTTP 402
|

AgentVault SDK

TypeScript & Python — vault client + x402 paywall middleware

TypeScript Python
|
RPC
|

Solana On-Chain

Anchor Program — PDA Vault per agent, SpendingPolicy enforced on every withdrawal

max_per_tx max_per_day allowlist 0.3% fee
Interactive Demo

Try AgentVault — simulated devnet

Create a vault, configure policies, watch transactions flow, and try to break the spending limits.

Configure Vault Policy

Require allowlist
Allowlisted vendors
OpenAI
Helius RPC
Twitter API

Vault State live

Balance$12.45
Total earned+$47.82
Total spent-$35.37
Max per tx0.50 USDC
Max per day5.00 USDC
Spent today$1.23 / $5.00
Vendors allowlisted3 vendors

Spending Policy on-chain enforced

{ "max_per_tx": 500000, "max_per_day": 5000000, "allowlist": ["OpenAI", "Helius", "Twitter"], "require_allowlist": true, "expires_at": 0 }

Recent Transactions

Stress Test

Attempt a withdrawal that exceeds the on-chain policy. Watch the contract refuse.

AlphaScout Signals pay 0.01 USDC to unlock

Autonomous research agent earning USDC by selling market signals on Solana.

Wallet

Connect & Fund Your Vault

Simulate connecting a Solana wallet and depositing USDC into your vault.

Not connected

Deposit USDC

Fund your agent's vault with USDC. Deposits go to the vault's ATA on Solana.

Wallet Balances

SOL--
USDC--
Vault USDC--
Pending tx--
Vault Explorer

Browse On-Chain Vaults

Search and inspect any AgentVault PDA on devnet. Click a vault to see full details.

MCP Playground

Interactive MCP Terminal

Type commands or click shortcuts to simulate the AgentPay MCP server. This is what Claude sees.

agentpay-mcp ~ devnet CONNECTED
AgentPay MCP Server v1.0.0
Connected to Solana devnet
Type a command or click a shortcut below. Type 'help' for available commands.
---
$
Agent-to-Agent Commerce

AlphaScout ↔ DataSink

Watch two autonomous agents trade in real-time. AlphaScout sells signals, DataSink buys them — all with on-chain policy enforcement.

🔍

AlphaScout

Research agent — earns by selling market signals

Earning
+$0.00
Revenue
↑ signal data
↓ 0.01 USDC
📊

DataSink

Consumer agent — buys AlphaScout's signals via vault

Spending
-$0.00
Spent

Commerce Log

Security

Threat Model & Audit

Interactive security audit explorer. Click each threat to see the analysis, mitigation, and test results.

Security Test Suite

10 automated test cases covering edge cases and attack vectors

Emergency Override Simulator

Simulate what happens when an agent keypair is compromised. The owner can freeze and withdraw all funds.

Network Analytics

Protocol Dashboard

Real-time simulated metrics for the AgentVault protocol on Solana devnet.

0
Tx/sec
--
0
Active Vaults
--
$0
24h Volume
--
$0
24h Fees
--

Transaction Volume (24h)

Hourly transaction count

Fee Revenue (24h)

Hourly protocol fees collected (USDC)

Top Vaults by Volume

Last updated: just now
Integration

3-line integration

Drop-in x402-compatible middleware. Works with Coinbase's official client unchanged.

// Express — 3 lines to add a paywall import { x402Paywall } from "@agentpay/sdk-ts"; app.get("/api/data", x402Paywall({ connection, recipientAta: VAULT_ATA, asset: USDC_MINT, pricePerCall: 10_000n, // 0.01 USDC }), handler);
// Coinbase's official x402 client works unchanged import { fetchWithPayment } from "@x402/fetch"; const data = await fetchWithPayment( wallet, "https://your-host/api/data" );
import { AgentPayClient } from "@agentpay/sdk-ts"; const client = new AgentPayClient({ connection, owner, agentAuthority }); await client.initializeVault({ maxPerTx: 500_000n, // 0.5 USDC max per call maxPerDay: 5_000_000n, // 5 USDC max per day allowlist: [openaiAta, rpcAta, twitterAta], requireAllowlist: false, });
// Ask Claude in plain English via MCP Server: "Create a new agent vault for authority 9k... with $1 per-tx limit and $5 per-day limit." // Available MCP tools: // create_vault — initialize vault with policy // withdraw — spend from vault (policy-checked) // get_balance — query vault state // update_policy — modify spending limits

HTTP 402 Payment Flow

Business Model

0.3% protocol fee — sustainable on-chain SaaS

Every agent withdrawal contributes a transparent, on-chain protocol fee via the FeeCollector PDA.

Revenue Calculator

$1.50
Daily protocol revenue
$547.50
Yearly protocol revenue
$500/day volume
Repository

Repo layout

agentpay/ ├── programs/agent-vault/ # Anchor program (Rust, ~400 LoC) ├── packages/ │ ├── sdk-ts/ # TypeScript SDK (vault + x402 paywall) │ └── sdk-py/ # Python SDK ├── apps/ │ ├── agentpay-mcp/ # MCP Server — agent tools │ ├── alpha-scout/ # Demo agent A — earns by selling signals │ ├── data-sink/ # Demo agent B — buys signals │ ├── dashboard/ # Live dashboard (Next.js) │ ├── example-api/ # Reference TS integration │ └── example-py-api/ # Reference Python integration └── scripts/ # Deploy/init scripts (devnet + mainnet)