The Model Context Protocol for Stellar
Connect autonomous AI agents to decentralized financial rails. Monetize MCP tools with HTTP 402 micro-payment challenges settled via Native XLM, Soroban SAC tokens, DEX Path Payments, and State Channels.
Account state, DEX orderbooks, AMM liquidity pools, transaction simulation, and storage deserialization.
Native XLM, Soroban SAC USDC, Path Payments, Claimable Balances, Fee-Bumps, State Channels, and AMM Swaps.
Optimized WASM bytecode deployed on Testnet, achieving 99.8% fee savings and zero gas for off-chain micro-vouchers.
Machine-actionable error registry across 7 domains with deterministic remedies for autonomous agents.
Developer Integration & Execution Sandbox
Zero glue-code adapters for leading AI agent frameworks with automated HTTP 402 payment settlement.
Interactive MCP Tool Runner
Execute Horizon and Soroban RPC tools against live Stellar Testnet protocols.
Queries native XLM and SAC token balances for any Stellar address.
// Click "Run" to dispatch MCP tool to Stellar Testnet...
Interactive x402 Payment Simulator
Observe autonomous HTTP 402 challenge negotiation, Ed25519 signing, and on-chain receipt verification.
1. Agent Dispatches Tool Call
Autonomous agent attempts invoking paywalled tool without payment headers.
{
"method": "tools/call",
"params": {
"name": "stellar_get_orderbook",
"arguments": {
"selling": "native",
"buying": "USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN"
}
}
}2. HTTP 402 Challenge Emitted
Paywall interceptor traps request, generates SEP-0043 challenge, and returns HTTP 402 with code 1120.
{
"status": 402,
"error": "ERR_PAYWALL_PAYMENT_REQUIRED",
"code": 1120,
"headers": {
"X-Payment-Challenge": "0a9f8b...7c2d",
"X-Payment-Amount": "0.0050000",
"X-Payment-Asset": "native",
"X-Payment-Recipient": "GCQURZFYPPAN76FRARROTSTYVH2LQ5AP7OLDXMJPIQ7STDOM55FXWD4T"
}
}3. Wallet Signer Resolves Challenge
Client-side InMemoryWalletSigner checks budget policy and signs payment envelope on Stellar Testnet.
{
"payer": "GDKF5...92KA",
"method": "native_xlm",
"amount": "0.0050000",
"txHash": "55324f4c7277b8596452723f894fce3061a019e7cf98d080f2dfea65f5144935",
"signature": "1ee32c4573de233b83c7aca088345c3dba3c80fd0b1957e38a1ca0790032d8a4..."
}4. Verifier and Replay Protection Check
OnChainTransactionVerifier confirms ledger finality. ReplayProtector claims nonce in LRU cache with TTL.
{
"verified": true,
"network": "stellar:testnet",
"ledgerClosed": 1048291,
"replayCheck": "CLAIMED_NEW_NONCE",
"feePaid": "100 stroops"
}5. Tool Executes and Yields Data
Tool handler executes with authenticated payment context and returns requested Stellar market data.
{
"result": {
"bidsCount": 14,
"asksCount": 22,
"midPrice": "0.1245000",
"spreadBps": 18.2,
"settledVia": "x402-v1"
}
}Soroban State Channel Gas Optimization and Benchmarks
Micro-payment state channel smart contract deployed to Stellar Testnet, optimized for ultra-low gas consumption.
Locks SAC tokens in escrow and initializes monotonic sequence state
Merchant settles cumulative off-chain vouchers with monotonic delta payout
Cooperative close returning unspent balance to payer
Ed25519 signed state update exchange between agent and server
Universal 250 Error Codes Registry
Exhaustive machine-readable error classification across all 7 protocol domains with deterministic remedies.
Developer & Institutional Resources
Verified deployments, technical documentation, and open-source repositories.