Mastra

A TypeScript framework for building, orchestrating, evaluating, and deploying AI applications and agents.

Source repo
mastra-ai/mastra
Stars
★ 29k
Last updated
today
License
NOASSERTION
Primary language
TypeScript

At a glance

How it runs
CLIFrameworkSelf-hosted service
Works with
Universal · cross-platformOpenAI API · Claude API
Cost
Free software; you pay for model usage
Setup effort
Low · running in minutes
You'll need
Shell / CLINetwork accessLocal filesystemMCP Server
Typical use
A TypeScript team adding a tool-using customer or internal assistant with conversation history to a Next.js product.
Not a fit if
  • Teams that want to avoid any enterprise-licensed code paths
  • Teams building on non-TypeScript stacks

What does this agent do, and when should you use it?

Mastra is a modern TypeScript framework for AI-powered applications and agents. It combines model routing, agents, graph-based workflows, context and memory features, plus evaluation and observability capabilities. Its agents use LLMs and tools for open-ended work, iterating internally until a final answer or optional stopping condition; workflows provide explicit execution control when that is preferable. Teams can integrate it into React, Next.js, or Node applications, deploy it as a standalone server, and author MCP servers that expose agents, tools, and structured resources. It fits teams that want to move from prototype to production on a TypeScript stack while retaining provider choice and orchestration control.

Developers create a project with npm create mastra@latest and select openai, anthropic, google, or xai as the LLM provider during creation. Mastra's model router connects to more than 40 providers through one interface; agents can use conversation history, retrieve data from APIs, databases, and files, and use tools while working toward a final answer. For deterministic multi-step control, workflows define execution with .then(), .branch(), and .parallel(); executions can suspend for user input or approval and resume using state remembered through storage. The framework can also expose agents, tools, and structured resources through an MCP server, or package them into web applications and standalone endpoints.

  1. A TypeScript team adding a tool-using customer or internal assistant with conversation history to a Next.js product.
  2. A developer connecting API, database, and file retrieval to an LLM-driven process that may iterate before returning an answer.
  3. An engineering team that needs explicit branching, parallel work, and step sequencing instead of leaving process control entirely to an agent.
  4. A business application that must pause an execution for a human approval or missing user input, then resume it later.
  5. A developer exposing custom agents, tools, or structured resources to systems that support MCP.

How do you install or deploy this agent?

The documented recommended project-creation command is npm create mastra@latest. The creator asks for a provider; the documented non-interactive form is npm create mastra@latest <project-name> -- --llm <provider>, where <provider> must be openai, anthropic, google, or xai. The supplied material does not document provider credential configuration.

How do you use this agent?

After creation, enter the project directory and run npx bgproc start -n <project-name> -w -- npm run dev. Open Mastra Studio at http://localhost:4111 to build, test, and manage agents, workflows, and tools. Integrate the resulting application with React, Next.js, or Node, or deploy it as a standalone server.

What are this agent's strengths and limitations?

Pros
  • Model routing offers one interface to more than 40 providers and explicitly names OpenAI, Anthropic, and Gemini.
  • It supports both autonomous agents and graph-based workflows with .then(), .branch(), and .parallel() control flow.
  • Suspension and resumption are documented with execution state retained through storage, supporting human approval points.
  • It includes evals and observability and can author MCP servers for agents, tools, and structured resources.
Limitations
  • Project creation requires choosing from a constrained provider list, while the supplied material does not explain credentials, secret handling, or local environment variables.
  • Features in directories named ee/ use the Mastra Enterprise License and require a valid enterprise license for production use.
  • The supplied material does not state minimum Node.js, npm, database, or deployment-environment versions, so teams need to validate their runtime separately.
  • Vercel AI SDK UI and CopilotKit integrations are mentioned, but no integration code or compatibility limits are included in the supplied material.

How does this agent compare with similar options?

Key facts side by side with the most closely related agents.

Agent Source review Form / cost Stars Updated Language Full support on
Mastra This agent 52 · Major gaps CLIFree + model costs ★ 29k today TypeScript OpenAI API · Claude API
AgentScope 2.0 70 · Some gaps Library / SDKFree + model costs ★ 35k 2d ago Python OpenAI API · Claude API
Pocket Flow 41 · Major gaps Library / SDKFree + model costs ★ 11k 3mo ago Python —
elizaOS 88 · Good CLIFree + model costs ★ 20k 1d ago TypeScript —

How does FollowAgents rate this agent?

FollowAgents source review · FARS-2.1
Major gaps
52/ 100 5-point scale 2.6 / 5
This review covers the source as of Aug 09, 2026. The project has shipped 24 stable release(s) since, which have not been re-reviewed. The score and verdict describe the reviewed version only. Recent releases ↓
Trust 10/29
Reliability 8/14
Adaptability 10/18
Convention 11/18
Effectiveness 9/13
Verifiability 4/8
Why each dimension lost points
Trust10 / 29 · 1.7/5

Evidence: README mentions human-in-the-loop, implying user confirmation exists, but no implementation details; data flow transparency is hinted via observability and evals, but not detailed; sensitive data handling not specified; dependency security has CodeQL workflow and lock files, but no vulnerability scan results; external effects may involve external API calls, but permission controls unclear; rollback not mentioned; source attribution clear with copyright and license, but publisher unverified. Deductions: most trust criteria only surface-level mentions without concrete implementation evidence.

Reliability8 / 14 · 2.9/5

Evidence: clear project structure, extensive test scripts and CI configs indicate good self-consistency; dependency management uses pnpm and catalogs, but no availability guarantees; failure messages not clearly documented. Deductions: failure messages criterion lacks concrete evidence.

Adaptability10 / 18 · 2.8/5

Evidence: README clearly targets TypeScript developers, offers multiple use cases (agents, workflows, integrations); capability boundaries documented but not exhaustive; trigger precision mentioned via stopping conditions, but not detailed; environment fit supports multiple frameworks and deployment options. Deductions: trigger precision and some capability boundaries not specific enough.

Convention11 / 18 · 3.1/5

Evidence: clear information architecture with docs, reference, guides; detailed installation instructions via CLI and manual; stable naming with version numbers; rich examples and FAQ; known limitations not explicitly listed; license clear with dual-license; versioning changelog exists (changesets); maintenance responsibility clear with contribution guide. Deductions: known limitations not explicitly listed.

Effectiveness9 / 13 · 3.5/5

Evidence: output usability via standard interfaces and tools, but no concrete output examples; marginal value via multiple features, but no comparison with other frameworks; cost-benefit open-source free, but no performance data. Deductions: lack of concrete data.

Verifiability4 / 8 · 2.5/5

Evidence: README claims supported by documentation links, but no implementation code; cross-source corroboration via multiple doc pages, but no independent verification; fact-inference separation distinguishes features and recommendations, but not explicitly labeled. Deductions: cross-source corroboration and fact-inference separation insufficient.

Risks and how to mitigate them
  • Publisher identity unverified; be cautious about supply chain risks.
  • Dependency security only has CodeQL workflow, no vulnerability scan results; check dependencies for vulnerabilities.
  • Sensitive data handling and permission control details insufficient; evaluate before use.
Evidence confidence: Low Reviewed Aug 09, 2026 Reviewed revision 82e3365ef7c9 New commits since this review; the score may not cover them
See the full review method →

Recent releases

Latest entries from the project's GitHub Releases. Notes are quoted from upstream as written, not rewritten or tested by FollowAgents.

  1. @mastra/[email protected] November 4, 2026
    Release notes excerpt
    Highlights Knowledge v2: page-tree model, richer tools, and server-side sync APIs Knowledge is now a first-class page tree (pages/notes/pins) with major tool upgrades: knowledge_list, line/section/grep-style reads in knowledge_read, list pinning (kind: 'list'), and a link index for counting/listing [[links]]. Apps can also sync external content via server APIs like knowledge.upsertPage()/removePage() and note upserts, with optional vector/hybrid search and chunked embeddings for very long pages. …
    View on GitHub ↗
  2. @mastra/[email protected] November 2, 2026
    Release notes excerpt
    Highlights MCP Tasks (Storage-backed, restart-safe long-running execution) @mastra/mcp adds experimental Mastra-storage-backed MCP tasks so long-running tools/agents/workflows can return immediately with a task, be polled/answered/cancelled across instances, and survive restarts with shared storage and unified tracing. Background Tasks for Non-Agent Owners (Retention, Concurrency, Queued Resume) …
    View on GitHub ↗
  3. @mastra/[email protected] October 28, 2026
    Release notes excerpt
    Highlights End-user (per-resource) connections in @mastra/connect tools({ resourceId }) and new userConnectRoutes() enable user-scoped OAuth connections so agents can safely use each end user’s accounts (in addition to global connections), with built-in caching and hard enforcement that one user’s connection can’t serve another user. In-chat “request connection” prompts for missing integrations …
    View on GitHub ↗

FAQ

Is Mastra tied to one model vendor?
No. The material says its model router connects to more than 40 providers through a standard interface and explicitly mentions OpenAI, Anthropic, and Gemini. The project creator lists OpenAI, Anthropic, Google, and xAI as provider choices.
When should I use an agent instead of a workflow?
Use an agent for open-ended work where an LLM can choose tools and iterate. Use the graph-based workflow engine when you need explicit multi-step execution control through .then(), .branch(), and .parallel().
Can a workflow wait for a human decision?
Yes. Agents and workflows can suspend for user input or approval and later resume with execution state remembered through storage.
What licensing issue should adopters check?
The README describes Apache-2.0 for the core framework and most code, but code in any ee/ directory is under the Mastra Enterprise License and requires a valid enterprise license for production use.
View on GitHub ↗ Install ↓

Compare agents like this one

The same FARS review applied across the shortlist this agent qualifies for.

Related agents