Mastra
TypeScript framework for AI agents and workflows: typed tools, graph orchestration, memory, RAG and 90+ model providers.
🔗 Visit MastraDescription
An 'AI agent' is a program that uses AI models to carry out multi-step tasks on its own — answering customers, searching documents, filling forms. Mastra is a toolbox for developers who work in the JavaScript/TypeScript world, giving them the ready-made building blocks to create such agents without reinventing the basics every time. Mastra is an open-source TypeScript framework for building AI agents, workflows and AI-powered applications. Agents are defined with typed instructions, models and tools; workflows are graph-based with explicit control-flow primitives (branching, loops, human-in-the-loop pauses); and a model router abstracts 90+ providers including OpenAI, Anthropic and Gemini behind one interface. The framework ships the production plumbing most agent projects end up rebuilding: a memory system for conversation history and retrieval, RAG integration, built-in observability with traces, metrics and evals, and support for authoring MCP servers. It integrates with React, Next.js and Node.js or deploys as a standalone server, and scaffolds new projects via npm create mastra. The core is Apache 2.0 with no seat or usage limits; some enterprise features use a separate Mastra Enterprise License that is free for development but paid in production, and a hosted cloud offers Starter and Teams tiers. With 26k+ GitHub stars it has become the reference agent framework for the TypeScript ecosystem.
💬 Our review
The short version: for developers who code in TypeScript and want to build AI agents, this is currently the most complete starter kit — just mind the licence fine print and the fast-moving APIs.
Mastra's bet is simple: most agent frameworks are Python-first, but a huge share of product engineers shipping AI features live in TypeScript — and for them Mastra is currently the most complete option. Built by the team behind Gatsby, it shows in the DX: typed agents and tools, sane project scaffolding, and batteries included (memory, evals, tracing, MCP) that LangChain-style stacks make you assemble yourself. The honest caveats: the project moves fast and APIs still churn between releases, so pin versions; and the licensing split deserves attention — the Apache 2.0 core is genuinely free, but some enterprise features are free in dev and licensed in production, so check which side of the line your dependencies sit on before you ship. Cloud pricing is also vague until you sign up. Python teams should compare LangGraph or CrewAI first; TypeScript teams wanting something lighter can use the Vercel AI SDK. But for full-featured, typed agent infrastructure in TS, Mastra is the current default.
💰 Pricing
📊 Global score
🤖 AI-enriched data
Pros
Most complete TypeScript agent framework
Memory, RAG, evals and MCP built in
90+ model providers behind one interface
Cons
API churn between releases
Dual licence to check before production
❓ Frequently asked questions
- Is Mastra free to use in production?
- The Apache 2.0 core is, with no seat or usage limits. Some enterprise features use the Mastra Enterprise License: free for development and testing, paid for production use — check which features your app relies on.
- How does Mastra compare to LangGraph or CrewAI?
- LangGraph and CrewAI are Python-first; Mastra is the TypeScript equivalent with typed agents, graph workflows and built-in memory/evals. If your stack is Node/Next.js, Mastra fits natively.
- Which model providers does it support?
- 90+ providers through its model router, including OpenAI, Anthropic and Gemini, switchable behind a single interface.
- Does it support MCP?
- Yes — Mastra supports authoring and deploying MCP servers, so your agents' tools can be exposed to any MCP-compatible client.
- Is it worth the money compared to alternatives?
- The Apache 2.0 core is free without seat limits, like LangGraph and CrewAI's frameworks — so compare on architecture, not price. The only budget questions are Mastra Cloud versus self-hosting your agents, and which enterprise-licensed features you'd rely on in production.
- Which agent framework should you pick for your case?
- TypeScript/Next.js product team: Mastra. Python team needing explicit, debuggable state graphs: LangGraph. Fast multi-agent prototyping: CrewAI. Just streaming AI UI in a React app: Vercel AI SDK. RAG-heavy document work: LlamaIndex.
