Built by arcabot.ai · Open source on GitHub

Give your AI agent an identity,
a wallet, and an API

— in one SDK

A3Stack connects gasless smart accounts, ERC-8004 identity, x402 payments, and MCP data into a unified infrastructure layer for AI agents.

Get Started API Referencenpm install @a3stack/core
agent.ts
typescript
import { A3Stack } from "@a3stack/core";
import { base } from "viem/chains";
import { privateKeyToAccount } from "viem/accounts";
import { z } from "zod";

// One class. Three capabilities.
const agent = new A3Stack({
  account: privateKeyToAccount(process.env.PRIVATE_KEY),
  chain: base,
  server: {
    name: "MyAgent",
    payment: { amount: "1000" }, // 0.001 USDC per call
  },
});

agent.tool("analyze", { query: z.string() }, async ({ query }) => ({
  content: [{ type: "text", text: `Analysis: ${query}` }],
}));

await agent.start(); // → http://localhost:3000/mcp
client.ts
typescript
// Another agent connects and pays automatically
const client = await createAgentMcpClient({
  agentId: "eip155:8453:0x8004...#42", // ERC-8004 global ID
  payer: { account },                    // x402 auto-payment
});

const result = await client.callTool("analyze", { query: "ETH price trend" });
// Payment of 0.001 USDC happened automatically ✓
The Problem

Agent infra is
fragmented

Three critical layers are being built by different teams with no coordination. None of them talk to each other.

Without A3Stack, you're duct-taping together identity, payment, and MCP solutions separately. With A3Stack: new A3Stack({ privateKey, chainId }) and you're live.

Identity
ERC-8004 (on-chain agent registration)
17+ chains, no SDK
Payments
x402 protocol, Circle USDC
packages exist, no agent integration
Data
MCP servers, onchain oracles
SDK exists, no identity/payment layer
The Solution

Three layers. One SDK.

Each package works standalone. Together they give your agent everything it needs to participate in the agent economy.

@a3stack/accounts

Gasless smart accounts

Create ERC-4337 smart accounts with automatic gas sponsorship via CDP Paymaster. Register agents on-chain with zero ETH.

  • Zero gas registration (CDP Paymaster)
  • ERC-4337 smart accounts on Base
  • One-shot gaslessRegister()
  • Idempotent account creation
Read docs
@a3stack/identity

Verifiable on-chain identity

Register your agent as an ERC-8004 NFT on Base. Other agents can cryptographically verify who you are across 17 chains.

  • ERC-8004 registration (ERC-721)
  • Cross-chain discovery
  • Back-reference verification
  • 17 supported chains
Read docs
@a3stack/payments

Agent-to-agent payments

Charge other agents for your services using the x402 protocol. Auto-pay via EIP-3009 signatures — no gas, instant, USDC on Base.

  • x402 protocol (HTTP 402)
  • EIP-3009 gasless authorization
  • USDC on Base
  • Express.js middleware
Read docs
@a3stack/data

MCP with identity + payments

Build MCP servers that verify who connects and charge per call. Or connect to any MCP server with auto-payment and identity resolution.

  • MCP server with payment gating
  • Auto-payment client
  • Identity resource (agent://identity)
  • probeAgent discovery
Read docs
How it works

Agent A → Agent B in 6 steps

The full flow from discovery to paid tool call, handled automatically by A3Stack.

1

Agent A resolves Agent B's ERC-8004 global ID on-chain

2

Fetches registration file → parses MCP endpoint and x402Support

3

Connects to MCP endpoint — first request returns HTTP 402

4

Client auto-signs EIP-3009 authorization (gasless)

5

Retry with X-PAYMENT header → server verifies, returns result

6

Payment receipt in X-PAYMENT-RESPONSE, facilitator settles on-chain

Install what you need

All packages on npm. Use modular imports or grab everything via core.

@a3stack/accounts

Gasless smart accounts via CDP Paymaster (NEW)

npm i @a3stack/accounts
@a3stack/core

All-in-one: A3Stack class + all re-exports

npm i @a3stack/core
@a3stack/identity

ERC-8004 registration, verification, discovery

npm i @a3stack/identity
@a3stack/payments

x402 client (paying) + server (receiving)

npm i @a3stack/payments
@a3stack/data

MCP server/client with identity + payment

npm i @a3stack/data
a3stack

CLI: verify, lookup, probe, chains, count, init

npx a3stack

Ship a paid agent in 5 minutes

Follow the quick start guide to build an agent that accepts payments, proves its identity on-chain, and exposes tools via MCP.

Quick Start GuideView Examples