Overview
Theaixyz package is the core framework for building AI agent services. It provides the server, protocol adapters (A2A, MCP), x402 payment integration, and the agent execution runtime.
ai@^6
Exports
| Import Path | Description |
|---|---|
aixyz/server | AixyzServer class |
aixyz/server/adapters/a2a | useA2A, getAgentCard, ToolLoopAgentExecutor |
aixyz/server/adapters/mcp | AixyzMCP class |
aixyz/config | Re-exports from @aixyz/config |
aixyz/accepts | Accepts type, HTTPFacilitatorClient |
aixyz/test | Test utilities (loadEnv) |
AixyzServer
Express 5 server with x402 payment verification. Extends x402ResourceServer from @x402/core/server.
Key Properties
server.express— the raw Express 5 appserver.config— parsedAixyzConfig
Key Methods
server.unstable_withIndexPage(path?)— add human-readable agent info pageserver.withX402Exact(route, accepts)— register x402 payment-gated routeserver.withPaymentRequirements(accepts)— build payment requirements for a route
A2A Adapter
agentExports parameter is import * as agent from "./agent" — it reads both default (the ToolLoopAgent) and accepts (payment config).
MCP Adapter
Agent Executor
ToolLoopAgentExecutor wraps Vercel AI SDK ToolLoopAgent instances into the A2A AgentExecutor interface, handling multi-step tool execution loops automatically.