Mastra helps teams build AI agents, workflows, and apps in TypeScript with model routing, tools, memory, MCP, and observability. It embeds in React, Next.js, and Node or runs as its own server.
Overview
Mastra is a TypeScript framework for AI-powered applications and autonomous agents. It connects to many model providers through one interface, defines agents that reason over tools, and orchestrates multi-step work with a graph-based workflow engine supporting branches, parallelism, and human-in-the-loop pauses.
Context features include conversation history, retrieval from external sources, and observational memory. Developers can expose agents via MCP servers, integrate UI libraries, and register agents and workflows on a Mastra server for local or deployed endpoints.
Production-oriented pieces include built-in evals, tracing, and metrics for refining agent behavior. Core code is open source under Apache 2.0, with separate enterprise-licensed modules in designated directories. Getting started is oriented around the Mastra CLI and documented install paths.
Key features
- Multi-provider model routing
- Autonomous agents with tools
- Graph workflows with branching
- Human-in-the-loop suspension
- Context and observational memory
- MCP server authoring
- Built-in evals and observability
- React and Next.js integration
Use cases
- Production AI agents
- Multi-step automated workflows
- Chat and assistant UIs
- MCP-exposed agent tools