Mastra: A TypeScript framework for agents, workflows, and MCP servers
Mastra is the modern TypeScript framework for AI-powered applications and agents.
At a glance
- What is it?
- Mastra is a TypeScript framework for building AI agents and workflows with model routing, human-in-the-loop, and built-in evals. This review covers its architecture, setup, limitations, and who should adopt it.
- Who is it for?
- Adopt Mastra if you are a TypeScript developer building AI agents or workflows that need explicit control flow, model flexibility across 40+ providers, and built-in evaluation and observability. Do not adopt it if you require a permissive single license for all code, because the ee/ directories are source-available under a separate enterprise license that restricts production use.
- Can I use it commercially?
- Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
- Is it still maintained?
- Yes. The repository last received commits 2 days ago.
- What is it written in?
- Mainly TypeScript, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 13, 2026, and from our analysis. They are not legal advice.
Star history
- mastra-ai/mastra29,508 ★ · +1,591
| Repository | 2026-09-10 | 2026-11-13 |
|---|---|---|
| mastra-ai/mastra | 27.9k | 29.5k |
1,591 Stars in the last 64 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
What Mastra solves and who it is for
Mastra aims to cover the full lifecycle from prototype to production in one TypeScript framework. The README positions it as a framework for building AI-powered applications and agents, integrating with React, Next.js, and Node, or running as a standalone server. The target user is a TypeScript developer who wants to avoid stitching together separate libraries for model access, agent loops, workflow orchestration, memory, and evaluation. Instead of assembling these pieces manually, Mastra bundles them into one package with a consistent interface. The framework is especially aimed at teams that need both autonomous agents and deterministic workflows, because it offers two distinct execution models rather than forcing one approach.
The two execution models: agents and workflows
Mastra gives you a choice between autonomous agents and graph-based workflows. Agents reason about goals, decide which tools to use, and iterate internally until the model emits a final answer or an optional stopping condition is met. This is the open-ended path. Workflows, by contrast, are for when you need explicit control over execution. The README describes a graph-based workflow engine with an intuitive syntax for control flow: .then(), .branch(), and .parallel(). That syntax suggests a declarative way to chain steps, branch conditionally, and run steps concurrently. The key difference is that agents hand control to the LLM, while workflows keep control in the code. This is a meaningful design decision: you can use agents for tasks where the path is unknown and workflows where every step must be auditable and predictable. The trade-off is that you must choose the right model for each task, and Mastra does not blur the line between them.
How Mastra works under the hood
The architecture visible from the README centers on a few core primitives: models, agents, workflows, memory, and evals. The model router connects to 40+ providers through one standard interface, which means you can swap OpenAI for Anthropic or Gemini without rewriting your agent logic. Agents use LLMs and tools, and they can suspend execution for human input or approval. This human-in-the-loop feature relies on storage to remember execution state, so a workflow can pause indefinitely and resume where it left off. That storage requirement is a concrete architectural point: Mastra is not stateless by default. If you want durable pauses, you need a storage backend configured. The README also mentions context management features like conversation history, retrieval from APIs or databases, and Observational Memory, which gives agents a form of long-term coherence. Finally, built-in evals and observability are part of the framework, not add-ons.
Getting started with the CLI
The recommended way to start is with the command npm create mastra@latest. The README even includes a pre-built prompt that an AI assistant can use to scaffold a project. That prompt asks for a project name and a provider, which must be one of openai, anthropic, google, or xai. The actual command is npm create mastra@latest <project-name> -- --llm <provider>. This CLI-driven setup is a clear departure from manual configuration, but it also means you need to accept the scaffolded structure. If you prefer to wire things by hand, the README points to an installation guide, but it does not show the manual steps.
Limitations and wrong-tool cases
Mastra is not the right choice if you need full control over every dependency or if you want a minimal library rather than a framework. The README makes clear that Mastra is opinionated: it has its own model router, workflow engine, memory system, and evals. If you already have a preferred tool for orchestration or a custom agent loop, Mastra may duplicate or conflict with that. Another limitation is the human-in-the-loop feature's reliance on storage. The README states that Mastra uses storage to remember execution state, so you can pause indefinitely. That implies you must configure and maintain a storage backend, which adds operational complexity. The README does not list which storage backends are supported, so check the linked storage docs before assuming it works with your existing database. Finally, the dual-license model is a real constraint: any code in ee/ directories is source-available under the Mastra Enterprise License and requires a valid enterprise license for production use. This means some features, such as those under packages/core/src/auth/ee/, are not fully open source.
Alternatives and how they differ
A direct alternative is Vercel's AI SDK, which the README mentions as an integration target for building UIs. The AI SDK is a lighter-weight library that focuses on streaming and UI components, not on full agent orchestration or workflow engines. Mastra, by contrast, is a framework that includes agents, workflows, evals, and observability out of the box. Another alternative is LangChain, which is language-agnostic and has a larger ecosystem, but it is not TypeScript-first in the same way. LangChain's approach is to compose chains and agents through abstractions, while Mastra offers a more explicit graph-based workflow syntax. The key difference is scope: Mastra aims to be a complete application framework, while the AI SDK is a toolkit that you assemble yourself. If you already use the AI SDK for UI, you can still use Mastra for the agent logic, as the README suggests bundling Mastra agents into existing apps.
Maintenance and licensing considerations
The repository is actively maintained, with recent releases for @mastra/core at version 1.81.0 on November 2, 2026, and prior releases on October 28 and October 21. This weekly cadence suggests a stable release pipeline; the README does not describe a migration guide, so check upgrade cost before moving versions. The license is marked as NOASSERTION in the repository metadata, but the README clarifies a dual-license model: Apache License 2.0 for the core framework and the vast majority of the codebase, and a Mastra Enterprise License for code in ee/ directories. The README states that those enterprise features can be freely used for development and testing, but require a valid enterprise license for production use. This is a significant licensing implication for any team that plans to deploy features from the ee/ directories. You must review the full license mapping in LICENSE.md and the ee/LICENSE file before production deployment. The README does not list any enterprise features, so you need to inspect the repository to see what is gated.
Editorial conclusion
Adopt Mastra if you are a TypeScript developer building AI agents or workflows that need explicit control flow, model flexibility across 40+ providers, and built-in evaluation and observability. Do not adopt it if you require a permissive single license for all code, because the ee/ directories are source-available under a separate enterprise license that restricts production use. Before committing, verify that your preferred model provider is supported by the model router, confirm that the human-in-the-loop storage backend fits your infrastructure, and check the current state of the Mastra Enterprise License terms for any feature you plan to use in production.
Frequently asked questions
how to install mastra
Run `npm create mastra@latest`, which the README calls the recommended way to get started, then follow the installation guide for the CLI or a manual install. The scaffolding command also accepts a project name and a provider, in the form `npm create mastra@latest <project-name> -- --llm <provider>`.
what is mastra
It is a framework for building AI-powered applications and agents on a modern TypeScript stack. It covers model routing across more than forty providers, autonomous agents, a graph-based workflow engine with then, branch and parallel steps, suspend-and-resume human approval, context management, MCP server authoring, and built-in evals and observability.
what is mastra npm
The published package is scoped, @mastra/core, and the release list shows it at 1.81.0. The repository root manifest is a different thing entirely: it is named mastra-turbo, sits at 0.1.11, and is marked private, so that number is workspace bookkeeping rather than the framework version.
is mastra open source
Mostly. The core framework and the vast majority of the codebase are under Apache License 2.0, and the README describes the project as using a dual-license model. Code in any directory named ee/ is source-available under the Mastra Enterprise License instead, with the full mapping in LICENSE.md and the terms in ee/LICENSE.
is mastra free
The Apache-2.0 majority is, and ee/ code is described as freely usable for development and testing. For production, code in an ee/ directory requires a valid enterprise license, so the cost depends on whether the feature you want sits behind that directory marker.
what is mastra studio
The README does not mention a Studio, and it does not describe one. The repository does contain a mastracode/ directory and a .mastracode/ configuration directory, neither of which the README explains, so what they are is not documented where the project describes its own features.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/mastra-ai-mastra)Star history chart for your README
[](https://hysenlabs.com/projects/mastra-ai-mastra)Was this useful?