Mastra

The TypeScript-native agent framework — agents, durable workflows, memory and observability in one Apache-2.0 package, with an optional managed cloud platform.

Best forFull-stack JavaScript/TypeScript teams (especially Next.js/Node shops) who want agents, durable workflows and memory unified in one framework without adopting a Python-first stack.

Visit Mastra Compare

Our verdict

Mastra is the one genuinely TypeScript-native entrant in a category otherwise built Python-first with JS bindings layered on — a real, defensible niche for full-stack JS and Next.js teams who don’t want to stand up a separate Python service just to add an agent.

The TypeScript-native pick in a Python-first category — real funding and production usage behind it, but no Python path and a much younger ecosystem than LangChain’s.

The Agents Index digest

New agents, fresh verdicts, and who's earning the top spots. One short email.

Screenshot of Mastra
Mastra, captured at verification, . Click to enlarge.

What's great

  • The only framework in this category built TypeScript-first rather than as a Python port with JS bindings — a genuine fit for teams already building in Next.js/Node who don’t want a separate Python service.
  • Real commercial backing and production usage: a $22M Series A led by Spark Capital ($35M total raised) and named customers including Replit, Sanity, MongoDB, Brex and Marsh.
  • Agents, durable typed workflows, memory, evals/observability and a server layer are unified in one framework rather than composed from several separate packages.

Watch-outs

  • TypeScript-only — teams standardized on Python get no first-party support at all, unlike LangChain, LlamaIndex or the OpenAI Agents SDK, which all ship a Python variant.
  • Enterprise-grade controls (RBAC, SSO, IAM, audit logs) are gated behind a source-available Enterprise license, not the Apache-2.0 core — teams needing those controls are not fully open-source the way the rest of the framework is.
  • Founded in 2024 — a much younger ecosystem and community than LangChain’s multi-year head start (26.5K GitHub stars vs. LangChain’s 142K+), so fewer tutorials, integrations and battle-tested production patterns exist today.
  • Mastra Cloud pricing has several separately-metered dimensions (observability events, CPU-hours, egress, per-project persistent-server fees) rather than one flat number, making cost harder to predict up front than a simple per-seat SaaS price.

Also note: No Python variant — TypeScript/JavaScript only, unlike several rivals in this category that ship both languages. · Enterprise controls (RBAC/SSO/IAM) require the separately-licensed Enterprise tier, not the free Apache-2.0 core.

What is Mastra?

Mastra is an open-source, TypeScript-first framework for building AI agents — founded in San Francisco in 2024 by Sam Bhagwat (co-founder of Gatsby) as a Y Combinator company. Unlike the other frameworks in this category, which are Python-first with JavaScript bindings layered on, Mastra is written for the JS/TypeScript full-stack ecosystem from the ground up — designed to drop into a Next.js or Node app rather than a Python service. The core framework (agents, workflows, memory) is Apache 2.0-licensed and free to self-host; a separate, optional Mastra Cloud platform adds hosting, a visual Studio playground and observability on a metered/subscription basis. It raised a $22M Series A led by Spark Capital in mid-2026, bringing total funding to $35M (seed backers included Y Combinator and Gradient Ventures), and is used in production by named customers including Replit, Sanity, MongoDB, Brex and Marsh.

What does Mastra do?

Mastra unifies five things developers otherwise wire together from separate packages: typed agents (an LLM configured with instructions, tools and runtime behavior), durable workflows (typed steps with retries and branching), memory (observational/durable context plus semantic recall), observability (evals, metrics, datasets and traces) and a server layer to register agents and workflows behind one API. Model routing connects to 90+ providers (OpenAI, Anthropic, Gemini and more) through one standard interface, so switching models is a config change, not a rewrite. An app can deploy to any Node.js-compatible environment, with built-in deployers for Vercel, Netlify and Cloudflare, or integrate directly into an existing Next.js app. The optional Mastra Cloud platform adds a hosted Studio UI for building/debugging agents, managed observability, and a metered compute/events model (CPU-hours and observability events) once a team outgrows the free self-hosted path; a separate source-available Enterprise tier adds RBAC, SSO and IAM for teams that need those controls without per-trace metering.

Key features

  • TypeScript-native, not a Python port: Built for the JS/TS full-stack ecosystem from the ground up — the one framework in this category with no Python variant at all, versus the Python-first-with-JS-bindings design of every other listed framework.
  • Unified agents + workflows + memory: Agents, durable typed workflows (retries, branching) and long-term/semantic memory ship as one integrated framework rather than separate libraries you compose yourself.
  • Mastra Cloud (optional managed platform): A hosted Studio playground, observability (evals, metrics, traces) and deployment layer, priced separately from the free, self-hostable core framework.
  • 90+ model providers, one interface: Model routing abstracts OpenAI, Anthropic, Gemini and 90+ other providers behind one standard interface, so swapping models is a config change.

What are Mastra's use cases?

  • Full-stack JS/Next.js agent app: A team already building in Next.js or Node adds an agent directly into the same codebase and deploys it with Mastra’s built-in Vercel/Netlify/Cloudflare deployers, instead of standing up a separate Python service.
  • Production workflow with durable state: A team builds a multi-step agentic workflow (retries, branching, long-running steps) and uses Mastra’s typed workflow engine plus observational memory to keep it debuggable and resumable in production.
  • Self-hosted, no vendor metering: A team runs the Apache-2.0 core entirely on its own infrastructure for free, opting into Mastra Cloud’s metered observability/hosting only once it needs a managed dashboard.

What does Mastra integrate with?

  • 90+ LLM providers via one model-routing interface (OpenAI, Anthropic, Gemini and more)
  • Built-in deployers for Vercel, Netlify and Cloudflare, or any Node.js-compatible environment
  • Direct integration into existing Next.js apps
  • Mastra Cloud (optional hosted Studio, observability, deployment)

Why use Mastra?

  • The only framework in this category built TypeScript-first rather than as a Python port — a real fit for full-stack JS/Next.js teams.
  • Agents, durable workflows, memory, evals and a server layer ship unified, rather than assembled from several separate packages.
  • Apache 2.0 core is free and self-hostable; real commercial backing ($35M raised, Spark Capital-led Series A) and named production customers (Replit, Sanity, MongoDB, Brex, Marsh) back its maintenance.
  • Model-agnostic across 90+ providers through one interface, with built-in deploy targets (Vercel, Netlify, Cloudflare) instead of a bring-your-own-infra requirement.

Pros & cons

Pros

  • The only framework in this category built TypeScript-first rather than as a Python port with JS bindings — a genuine fit for teams already building in Next.js/Node who don’t want a separate Python service.
  • Real commercial backing and production usage: a $22M Series A led by Spark Capital ($35M total raised) and named customers including Replit, Sanity, MongoDB, Brex and Marsh.
  • Agents, durable typed workflows, memory, evals/observability and a server layer are unified in one framework rather than composed from several separate packages.

Cons

  • TypeScript-only — teams standardized on Python get no first-party support at all, unlike LangChain, LlamaIndex or the OpenAI Agents SDK, which all ship a Python variant.
  • Enterprise-grade controls (RBAC, SSO, IAM, audit logs) are gated behind a source-available Enterprise license, not the Apache-2.0 core — teams needing those controls are not fully open-source the way the rest of the framework is.
  • Founded in 2024 — a much younger ecosystem and community than LangChain’s multi-year head start (26.5K GitHub stars vs. LangChain’s 142K+), so fewer tutorials, integrations and battle-tested production patterns exist today.
  • Mastra Cloud pricing has several separately-metered dimensions (observability events, CPU-hours, egress, per-project persistent-server fees) rather than one flat number, making cost harder to predict up front than a simple per-seat SaaS price.

Limitations

  • No Python variant — TypeScript/JavaScript only, unlike several rivals in this category that ship both languages.
  • Enterprise controls (RBAC/SSO/IAM) require the separately-licensed Enterprise tier, not the free Apache-2.0 core.

Mastra pricing

  • Self-hosted (Apache 2.0)Free
  • Starter (Mastra Cloud)$0 / /month
  • Teams (Mastra Cloud)$250 / /month
  • Enterprise (Mastra Cloud)Custom
  • Enterprise Self-HostedCustom / flat annual fee

See current pricing on mastra.ai ↗Compare Mastra alternatives →

Mastra specs

Pricing

Pricing model
freemium
Free tier
✓ Yes

Capabilities

Model / LLM
Model-agnostic (90+ providers)
Interface
Library
Public API
✓ Yes
Open source
✓ Yes

Deployment

Deployment
Both

Mastra review

Mastra is the one genuinely TypeScript-native entrant in a category otherwise built Python-first with JS bindings layered on — a real, defensible niche for full-stack JS and Next.js teams who don’t want to stand up a separate Python service just to add an agent. It unifies agents, durable typed workflows, memory and observability in one Apache-2.0 package that is free to self-host, backed by real commercial traction ($35M raised, a Spark Capital-led Series A, and named production customers including Replit, Sanity, MongoDB, Brex and Marsh). The tradeoffs are real too: it is TypeScript-only with no Python path at all, its ecosystem is a fraction of LangChain’s size and age, its deepest enterprise controls sit behind a separate source-available license rather than the open core, and its optional Mastra Cloud platform bills across several metered dimensions rather than one flat number. Pick it if you are building in the JS/TS stack and want an integrated framework designed for that world from day one; pick something with a longer track record if Python is your default or you need the widest possible integration ecosystem today.

The TypeScript-native pick in a Python-first category — real funding and production usage behind it, but no Python path and a much younger ecosystem than LangChain’s.

Frequently asked questions

Is Mastra free to use?
The core framework (agents, workflows, memory) is Apache 2.0-licensed and free to self-host anywhere. Mastra Cloud, the optional managed platform (hosted Studio UI, observability, deployment), has a free Starter tier and paid Teams ($250/month) and Enterprise tiers once usage grows.
Does Mastra support Python?
No — Mastra is TypeScript/JavaScript-only. Teams standardized on Python should look at LangChain, LlamaIndex, Microsoft AutoGen, the OpenAI Agents SDK or Pydantic AI instead, all of which ship first-party Python support.
Who builds and funds Mastra?
Mastra was founded in 2024 by Sam Bhagwat (co-founder of Gatsby) as a Y Combinator company. It raised a $22M Series A led by Spark Capital in mid-2026, bringing total funding to $35M, with seed backers including Gradient Ventures.
How is Mastra different from LangChain or LlamaIndex?
LangChain and LlamaIndex are Python-first frameworks that also ship JavaScript/TypeScript SDKs as a secondary target. Mastra is built TypeScript-first from the ground up, with no Python variant at all — the tradeoff for full-stack JS/Next.js teams is a much younger ecosystem (26.5K GitHub stars vs. LangChain’s 142K+) in exchange for a framework designed natively for their stack.
Can I self-host Mastra instead of using Mastra Cloud?
Yes — the Apache 2.0-licensed core framework can be self-hosted on any Node.js-compatible environment for free. Mastra Cloud is an optional managed layer (Studio playground, observability, deployment) billed separately once a team wants a hosted dashboard instead of running its own.

Get a quote from Mastra

Tell us what you need. We make the introduction to Mastra.

Mastra

from Free

Visit ↗