Mastra is an open-source TypeScript framework for AI agents and workflows with memory, evals, MCP and tracing. Free to start, hosted plans from $25/month.
Researched and fact-checked by Bartu Cavusoglu · Updated November 29, 2026
Mastra is a TypeScript framework for building AI agents and AI-powered applications, paired with a hosted Mastra Platform for running them in production. The core framework is open source under the Apache 2.0 license, while enterprise features are source-available under the Mastra Enterprise License. It bundles the pieces teams usually assemble by hand: agents, typed workflows, memory, retrieval, evals, guardrails, Model Context Protocol (MCP) support and observability, all in one TypeScript codebase. Its tagline is to ship agents that "reason, remember, and act."
Mastra is aimed at software developers and engineering teams, especially those already working in the JavaScript and TypeScript ecosystem with React, Next.js or Node. It suits both startups prototyping their first agent and larger organizations that need production-grade tracing, security reviews and access controls. The website publishes customer stories from Salesforce, Marsh and SoftBank describing how they built agent products on Mastra.
You define an agent by choosing a model, writing instructions and connecting tools that let it act on your systems. Model routing gives access to more than 90 providers, including OpenAI, Anthropic and Gemini, through one standard interface. Multi-step logic lives in workflows built from typed steps with branching, parallel execution, retries and the ability to pause for human input and resume later. Memory combines message history, semantic recall, observational memory and retrieval from external data sources. Agents and workflows are exposed through API endpoints and can run in any Node.js-compatible environment, as a standalone Hono-powered server, inside a Next.js, Express, Fastify or Hono app, or through built-in deployers for Vercel, Netlify and Cloudflare, as well as on the Mastra Platform.
Beyond agents and workflows, Mastra provides a harness with persistent sessions, plan-and-build modes, tool approvals, subagents and Signals for sending updates while an agent works. Evals cover code-based checks and model-based judges, with datasets and experiments for comparing models, prompts and configurations. Guardrails process inputs and outputs to help prevent prompt injection and sanitize responses. You can author MCP servers that expose agents and tools, and observability traces model calls, tool calls and workflow steps with metrics for latency, token usage and cost, including export to external observability platforms.
The open-source framework is free to use. Mastra Platform pricing is per workspace: the Free plan at $0 includes unlimited agents, users and deployments with 100,000 observability events and set compute allowances. Starter is $25 per month with one small dedicated project and usage alerts, and Team is $250 per month with additional dedicated projects, a SOC 2 report and 10 million observability events. Enterprise is custom priced and adds RBAC, SSO, audit logs, static IP, OIDC and dedicated support. Usage beyond allowances is billed, for example $0.25 per vCPU-hour and $10 per 100,000 observability events.
Mastra is a code-first developer framework, so it is not a no-code tool for business users. It is centered on TypeScript, which makes it less natural for Python-first AI teams. Platform costs can grow with usage-based overages for compute, memory, egress and observability, and enterprise controls such as SSO and RBAC are reserved for the custom Enterprise plan.
Mastra was founded in 2024 and is headquartered in San Francisco with a distributed team. Its co-founders, Sam Bhagwat, Abhi Aiyer and Shane Thomas, previously built the Gatsby web framework. The company reports roughly $35M raised from investors including Spark Capital, Gradient, basecase and Y Combinator.