Quickstart
This runs MAA on your own machine with the mock model: no AWS, no model key, no cost. The same client code works against a deployed MAA by changing the base URL.
1. Start MAA locally
npm ci
npm run dev # http://localhost:8787
2. Get an API key
- Open http://localhost:8787/portal and enter an email address.
- In development the page shows the sign-in link directly ("open the sign-in link"). On a deployed MAA it arrives by email.
- In the portal, under API keys, create a key. It is shown once; MAA stores only a hash.
3. Run the example
MAA_BASE_URL=http://localhost:8787 MAA_API_KEY=<your key> npx tsx docs/guide/examples/quickstart.ts
The script is examples/quickstart.ts. In outline:
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({ apiKey: process.env.MAA_API_KEY, baseURL: "http://localhost:8787" });
const agent = await client.beta.agents.create({
name: "Helper",
model: "claude-opus-5-5",
system: "You are a careful assistant. Be brief.",
tools: [{ type: "agent_toolset_20260401" }],
});
const environment = await client.beta.environments.create({
name: "quickstart",
config: { type: "cloud", networking: { type: "limited", allowed_hosts: ["example.com"] } },
});
const session = await client.beta.sessions.create({ agent: agent.id, environment_id: environment.id });
await client.beta.sessions.events.send(session.id, {
events: [{ type: "user.message", content: [{ type: "text", text: "Write a hello file please." }] }],
});
Then it waits for the session to reach end_turn, lists the events, deletes the session and verifies the certificate.
What you should see
Checked on 23 Nov 2026 against a local server with the mock model:
session sesn_… { provider: 'Amazon Bedrock', endpoint: 'bedrock-runtime-in-region', aws_region: 'eu-west-2', model_id: 'anthropic.claude-opus-5-5' }
agent: I have enough to draft the full analysis. Writing the report now.
tool: write
agent: The full analysis is in /mnt/session/outputs/report.md. …
certificate cert_…
certificate valid: true
The mock model always behaves like the company-analysis agent, whatever you ask it. The residency block shows where inference would run on AWS; locally the model is mocked.
Streaming instead of polling
const stream = await client.beta.sessions.events.stream(session.id);
await client.beta.sessions.events.send(session.id, { events: [/* … */] });
for await (const event of stream) {
if (event.type === "agent.message") console.log(event.content);
if (event.type === "session.status_idle") break;
}
Open the stream before you send, so you do not miss the first events.
Next
- Sessions and events for steering, interrupting and budgets.
- Tools to decide which tool calls need your approval.
../RUNBOOK.mdto deploy to AWS. That step needs Mat's go-ahead.