Quickstart
Build your first Anvil app with file-based routes and an agent endpoint in under 5 minutes.
File-Based Routing
Learn how Anvil maps your folder structure to HTTP routes — dynamic params, catch-alls, and middleware scoping.
MCP & Tools
Expose any route as an MCP tool with a single annotation — no separate MCP server required.
Agent Routes
Define streaming agent endpoints with built-in LLM clients, tool calling, and abort propagation.
Observability
Trace every agent run, track token usage and cost, and replay past runs without live model calls.
CLI Reference
Reference for all Anvil CLI commands: dev, build, start, mcp, lint, eval, and replay.
Why Anvil?
Today, building an AI product on Node requires stitching together Express for HTTP, a hand-written MCP server, OpenAI/Anthropic SDK calls scattered across routes, and no standard way to trace a multi-step agent run. Anvil solves this once at the framework layer:- One route, three protocols. Any Anvil route automatically speaks REST, MCP, and A2A — same handler, no duplicated schemas.
- Compile-time safety. The
anvil buildstep validates param names, schema compatibility, and MCP serializability before you ship. - Agent-native primitives.
defineAgent,LlmClient, guardrails, durable checkpointing, and human-in-the-loop are framework features, not application code you write per project. - Built-in observability. Every agent run is traced to a local SQLite store and viewable at
/_anvil. OTel export ships out of the box.
Create your first route
Add
server/routes/get.ts — the file name and location define the HTTP method and path.server/routes/get.ts
Start the dev server
Run
anvil dev to start a live-reload server. TypeScript routes load on the fly.Anvil is currently pre-alpha. The core framework (routing, MCP, agents, observability, durability, RAG, A2A) is fully implemented. The public release (docs, examples, marketing) is the final milestone.