Mastra
Open-source TypeScript framework for building AI agents and apps
Linked from mastra.ai · checked 29 Oct
- Tool type
- Open-source TypeScript AI agent framework
- Made for
- TypeScript developers and engineering teams
- Runs on
- Node.js project run via local dev server
- Studio runs at localhost:4111 after npm run dev; can deploy as a standalone server.
What it does
Mastra is an open-source TypeScript framework for building AI agents and AI-powered applications. Developers define agents with models, tools, and instructions, and build workflows in TypeScript code. Running a project locally opens Mastra Studio at localhost:4111, where agents, workflows, and tools can be built and tested. Outputs include agent responses, workflow results, traces, and evaluation scores.
Developers use Mastra to define agents with models and tools, build multi-step workflows with branch and parallel control flow, add memory, and expose agents or tools as MCP servers. Observability traces agent calls and token usage, and built-in scorers evaluate outputs. Models are reached through a router that connects to many providers via one interface.
Mastra suits TypeScript developers building customer-facing assistants, internal copilots, or automation workflows. The core framework is Apache 2.0 licensed and free to use. Running it requires a Node.js environment and a model provider API key, such as OPENAI_API_KEY. Hosted Platform features are priced separately, and enterprise features are under a source-available license.
What it can do
- Define agents with models, tools, memory and instructions
- Build workflows with .then(), .branch() and .parallel() control flow
- Human-in-the-loop suspension and resumption of workflows
- Author MCP servers exposing agents and tools
- Built-in scorers, custom evals and observability tracing
- Input/output guardrails against prompt injection
Works with
- React
- Next.js
- Node
- Express
- SvelteKit
- Hono
- Astro
- Vite
Example workflows
- Customer support agent with tools
- Inputs: an agent definition with instructions and a tool created via createTool. Steps: register the agent in src/mastra/index.ts, then call agent.generate() after retrieving it by id. Output: a generated response from the agent using the chosen model.
- Order fulfillment workflow with approval
- Inputs: an order schema. Steps: chain validateInventory then createShipment with .then(), commit the workflow, and suspend for human approval if needed before resuming. Output: a completed multi-step process with stored execution state.
Before you choose
- Model ID examples differ across source pages; confirm current model names in the models directory before use.
- Model API usage is billed by the provider or gateway and is separate from any Mastra Platform subscription.
- Enterprise features require a separate source-available license and custom pricing.
Listed under
Get started
Requires a model provider API key set as an environment variable.
- Run npm create mastra@latest <project-name> -- --llm <provider> to scaffold a project.
- Set the provider API key environment variable, e.g. OPENAI_API_KEY.
- Start the dev server with npm run dev and open Studio at http://localhost:4111.
Plans and prices
Prices in USDCore framework is free and open source. Platform Starter is $0 with observability events, CPU time and retention limits, with overages. Teams is $250/month. Custom pricing for enterprise. Model API tokens are billed separately.
- Unlimited users, deployments and projects
- 15 days data retention
- Multiple teams, SSO and SOC 2 docs
- 6 months data retention
- RBAC, audit logs and uptime SLAs
- Dedicated support engineer
Source: mastra.ai/pricing, checked 29 Oct 2026. Prices can change; check before you buy.
Sources for this overview
Product pages, documentation, and pricing checked 29 Oct 2026. Each source supports part of the overview; availability and prices can change.
Ratings and reviews
No ratings for Mastra yet.
What’s changed
Free accountSignals
Free accountData and security
Free accountCompare with similar tools
Free accountWhere this comes from
How we research- Company website
- mastra.ai: product, pricing and policy pages
- YC directory mirror
- Batch and company name
- Social accounts
- Accounts the company links, and its posts on X
- Human review
- Checked by a person
Last checked 29 Oct 2026. Every field keeps its source and date; unknown means we couldn’t confirm it.