Mastra

Mastra

What is

Mastra

?

Mastra is an open-source TypeScript framework for building AI agents and AI-powered applications. It provides agents, workflows, memory, evals and observability, and runs embedded in web apps, as a standalone server or on managed hosting.

At a glance

Attribute

Value

Primary use case

Building, observing and deploying AI agents and workflows in TypeScript

Deployment type

Self-hosted (embedded in apps or standalone server), managed Mastra Platform, Enterprise on-prem or in your cloud

Pricing model

Free: open-source framework and Starter ($0/month); Teams $250/month; Enterprise custom pricing; usage-based overages

API compatibility

Model Context Protocol (MCP) server authoring; model router across 40+ LLM providers

Supported integrations

Including OpenAI, Anthropic, Gemini, React, Next.js, Node.js, Astro, Express, SvelteKit, Hono, Vercel AI SDK UI, CopilotKit, LibSQL, Postgres

Source type

Dual

Key metrics

Vendor-reported: millions of downloads each month

AEP branch

Agent Infrastructure

AEP category

Harness

AEP subcategory

Execution

AEP detail

Orchestration

Profile

Developers define agents, tools and workflows as typed TypeScript code and register them on a single Mastra server. During development the server runs locally. Studio provides an interactive UI for building, testing and managing agents, workflows and tools. The same app can be bundled into existing React, Next.js or Node.js apps, deployed anywhere as a standalone server, or pushed to Mastra Platform managed hosting.

Focus

Developer and product teams building customer-facing agents, Slack or Teams agents, company knowledge assistants, AI SREs and business process automation.

Background

Mastra was started in 2024 by Sam Bhagwat (CEO), Abhi Aiyer (CTO) and Shane Thomas (CPO), the team behind Gatsby. It has raised $35m, including a $22m Series A, from investors including Spark Capital, Gradient, basecase and Y Combinator. Core Apache 2.0; ee/ code under the Mastra Enterprise License.

Features

Agents

Typed agents combine instructions, a model, tools and runtime behavior. They reason about goals, choose tools and iterate until the model returns a final answer or a stopping condition is met.

Graph-based workflows

A workflow engine composes typed steps, retries, branches and parallel steps into multi-step processes. Use it when a process needs explicit control over execution.

Memory and context

Agents get durable context through conversation history, semantic recall, thread-aware storage and Observational Memory. They can also retrieve data from APIs, databases and files, so they behave coherently across sessions.

Human-in-the-loop

An agent or workflow can be suspended to await user input or approval. Storage keeps the execution state, so a run can pause indefinitely and resume where it left off.

Model routing

One standard interface connects to 40+ providers, including OpenAI, Anthropic and Gemini. Models are referenced as provider/model strings without importing a provider package.

Observability and evals

Traces show every model call, tool call and handoff on a searchable timeline. Metrics cover latency, cost and tool usage. Evals score agent runs against repeatable checks using versioned datasets before changes reach production.

Pros and cons

Pros

  • One TypeScript framework covers agents, workflows, memory, evals and tracing for the full agent lifecycle.

  • The Apache 2.0 core is free to use, modify and self-host on your own infrastructure.

  • Agents, tools and other resources can be published as MCP servers that any MCP-compatible system or agent can call.

  • According to the vendor, the Enterprise self-hosted edition keeps traces, prompts and outputs inside your own VPC.

Cons

  • Features in ee/ directories, such as auth and agent builder code, need a paid Mastra Enterprise License for production use.

  • Managed hosting meters usage: observability events, CPU hours, data egress and memory tokens are billed beyond plan quotas, and a persistent server costs $100/project.

  • Model calls through the Mastra gateway are billed at market rate plus 5.5%.

  • On the managed platform, SSO comes with the Teams plan, while RBAC, audit logs and uptime SLAs come with Enterprise.

  • Self-hosting means the team runs and maintains the server, storage and databases itself.

FAQs

What is Mastra?

Mastra is a framework for writing AI agents and AI-powered applications in TypeScript. Its building blocks cover agent logic, multi-step workflows, persistent memory, human approvals, evaluation and tracing.

How is Mastra licensed and what does it cost?

Most of the codebase is open source under Apache 2.0 and can be self-hosted for free. Code in ee/ directories is source-available under the Mastra Enterprise License, which is free for development and testing but needs a license for production. Managed hosting offers a free Starter plan, a Teams plan at $250 per month and custom Enterprise pricing, with usage charged above included quotas.

Can Mastra be self-hosted?

Yes. Mastra apps can run inside existing web or Node.js applications or as a standalone server anywhere. For larger organizations, an Enterprise license adds self-hosted features such as RBAC, SSO, IAM and network policy integration, and the Mastra Platform can be deployed on-prem or in your own cloud.

Which languages, frameworks and models does Mastra support?

Mastra is built for TypeScript. It has integration paths for Next.js, React with Vite, Astro, Express, SvelteKit and Hono. Its model router reaches more than 40 providers, including OpenAI, Anthropic and Google Gemini.

Can Mastra agents pause for human approval?

Yes. Agents and workflows can be suspended while waiting for user input or approval. Because execution state is stored, a run can resume later from the point where it stopped.

Table of contents

Every piece of research we publish. Nothing else.

One weekly digest of new reports, market guides, interviews, and benchmarks. No drip sequences, no product pitches, and we don't hand your address to a sponsor. Unsubscribe in one click.

Weave Intelligence may collect information about your activity on our website.

To learn more, please read our Privacy Policy.

© 2026 Weave Intelligence. All rights reserved.

Every piece of research we publish. Nothing else.

One weekly digest of new reports, market guides, interviews, and benchmarks. No drip sequences, no product pitches, and we don't hand your address to a sponsor. Unsubscribe in one click.

Weave Intelligence may collect information about your activity on our website.

To learn more, please read our Privacy Policy.

© 2026 Weave Intelligence. All rights reserved.