Skip to main content
An aixyz agent is defined by a small set of files in a standard layout. Run aixyz dev and the framework auto-generates a server from them.

Directory Layout

requiredMust be providedoptional overrideProvide to override auto-generated behavior

Key Files

FileRequiredDescription
aixyz.config.tsYesAgent metadata, payment config, and skills
app/agent.tsNo*Agent definition using Vercel AI SDK
app/agents/*.tsNoSub-agent definitions, each gets its own endpoint
app/tools/*.tsNoTool implementations, auto-discovered by the build
app/server.tsNoCustom server — overrides auto-generation entirely
app/accepts.tsNoCustom x402 facilitator for payment verification
app/session.tsNoCustom session store override for SessionPlugin
app/erc-8004.tsNoERC-8004 identity registration and trust config
app/agent.test.tsNoAgent tests using bun:test
app/icon.svgNoAgent icon served as a static asset
vercel.jsonNoVercel deployment configuration
* If omitted, the build skips A2A endpoints and only serves tools via MCP.

How It Works

The build pipeline scans the app/ directory to auto-generate a server:
  1. Reads aixyz.config.ts for agent metadata and skills
  2. Imports app/agent.ts for the main agent definition (if present)
  3. Discovers all .ts files in app/agents/ for sub-agents (each gets its own A2A endpoint)
  4. Discovers all .ts files in app/tools/ (excluding _ prefixed files)
  5. Registers SessionPlugin (with custom store from app/session.ts if present)
  6. Wires up A2A (when agents exist), MCP (when tools exist), and x402 endpoints automatically
The result is a server exposing:
  • A2A at /agent and /.well-known/agent-card.json (main agent)
  • A2A at /{name}/agent and /{name}/.well-known/agent-card.json (per sub-agent in app/agents/)
  • MCP at /mcp
  • x402 payment verification on gated endpoints
For full control, provide app/server.ts to override auto-generation. See the Custom Server template for an example.