# Mastra — Open-source TypeScript framework for building AI agents, with a hosted platform for running and observing them.

> Source: The Agents Index — https://theagentsindex.com/mastra (structured, researched, re-verified)
> Facts last verified: 2026-09-02

Mastra is an Apache 2.0 TypeScript framework for building AI agents with tools, memory, workflows and evals. A commercial cloud platform adds observability, a Studio UI, model routing and deployment for those agents.

| Fact | Value |
| --- | --- |
| Website | https://mastra.ai |
| Price | from $250/month |
| Free tier | Yes |

Starter plan, $0/month, not a trial: 100K observability events, 24 CPU hours, 15 days data retention, 1GB data storage, 10GB egress, unlimited users, deployments and projects, with metered overages beyond each allowance. Separately, the framework itself is free under Apache 2.0 and can be self-hosted with no plan.

## What it does

**Writes code** · Partly — Code mode has the model author a TypeScript function that orchestrates your tools, executed in a sandbox; it is a beta tool-use optimisation, not a code-authoring product.

> Instead of calling tools one turn at a time, the model writes a tailored function for the user query.
> — https://mastra.ai/docs/agents/code-mode · Code mode page, intro paragraph under the Beta callout

**Whole-codebase work** · Partly — Agents you build get file tools over a mounted tree (grep and structural edits), but Mastra claims no repository-wide migration capability of its own.

> ast_edit | Applies structural code edits. Available when @ast-grep/napi is installed.
> — https://mastra.ai/docs/sandbox/filesystem · Filesystem page, table of tools a configured filesystem gives the agent

**Done-for-you service** · Partly — You run the software, but Mastra sells professional services (Concierge, forward-deployed engineering) and enterprise support covering planning, prototyping and workshops.

> Mastra Concierge and other professional, deployment, implementation, support, or forward-deployed engineering services, which are governed by a separately executed master services agreement
> — https://mastra.ai/terms-of-service · Section 1.2 What This Agreement Does Not Cover, item (c)

## How much it does unattended

**Runs autonomously** · Yes — Agents iterate their own tool-use loop until a final answer or stopping condition; durable agents persist run state so a loop can outlive the request that started it.

> Mastra agents use LLMs and tools to solve open-ended tasks, reasoning about goals, deciding which tools to use and iterating internally until the model emits a final answer
> — https://mastra.ai/agent-builder · Frequently asked questions, 'Is Mastra an agent builder?' answer

**Multi-agent** · Yes — Supervisor/subagent delegation is a first-class primitive, with delegation hooks, message filtering and per-subagent memory isolation.

> Subagents are specialized agents that another agent can delegate tasks to.
> — https://mastra.ai/docs/subagents · Subagents page, opening paragraph

**Agent permissions** · Yes — Tool approval can gate any tool call, per server or by predicate on tool name/arguments; approvals propagate up a subagent delegation chain.

> Require a human or external system to approve or reject any tool call before it executes.
> — https://mastra.ai/ai-agent-framework · Agents section, 'Tool Approval' card

## Which models it runs on

**Claude** · Yes — Anthropic is a named first-class provider in the model router; models are selected as provider/model-name strings.

> Whether you're using OpenAI, Anthropic, Google, or a gateway like OpenRouter, specify the model as "provider/model-name" and Mastra handles the rest.
> — https://mastra.ai/models · Model Providers page, Basic usage section

**GPT** · Yes — OpenAI is a named first-class provider in the model router, with provider-specific options such as reasoningEffort.

> Whether you're using OpenAI, Anthropic, Google, or a gateway like OpenRouter, specify the model as "provider/model-name" and Mastra handles the rest.
> — https://mastra.ai/models · Model Providers page, Basic usage section

**Open models** · Yes — Open-weight models run against any OpenAI-compatible endpoint on your own hardware; the vendor names gpt-oss, Qwen3 and DeepSeek.

> Mastra also supports local models like gpt-oss, Qwen3, DeepSeek and many more that you run on your own hardware.
> — https://mastra.ai/models · Model Providers page, 'Use local models with Mastra' section

**Model choice** · Yes — You choose the model per agent, per request or as a fallback chain; the router is explicitly positioned as provider-agnostic.

> Mastra's unified model router supports more than 1,000 models across providers including OpenAI, Anthropic, Google and others.
> — https://mastra.ai/ai-agent-framework · Frequently asked questions, 'What model providers does Mastra support?' answer

## Where you use it

**In your editor** · Partly — No IDE extension of its own; Mastra ships an MCP docs server and a skill that coding agents inside editors consume.

> It works with Cursor, Windsurf, Cline, Claude Code, VS Code, Codex or any tool that supports MCP.
> — https://mastra.ai/reference/build-with-ai · Build with AI page, 'MCP docs server'

**On the command line** · Yes — A Mastra CLI builds, starts and dev-serves the project (mastra build, mastra start, mastra dev).

> Start the server using the Mastra CLI:
> — https://mastra.ai/docs/deployment/mastra-server · Mastra server page, 'Running the server' section, line above the mastra start command

**In your pipeline** · Partly — Scorers and eval suites run in CI through Vitest/Jest via runEvals; the vendor claims no agent that acts on a pull request.

> Running scorers in your CI pipeline provides quantifiable metrics for measuring agent quality over time.
> — https://mastra.ai/docs/evals/running-in-ci · Running scorers in CI page, opening paragraph

**In a browser** · Yes — Studio is a hosted web UI for running agents, editing prompts, annotating traces and building datasets; it runs locally at port 4111 or deployed for the team.

> Mastra Studio provides an interactive environment for testing agents, tracing execution and refining prompts before and after you ship.
> — https://mastra.ai/ai-agent-framework · Frequently asked questions, 'What does Mastra Studio do?' answer

## Whose machine it runs on

**Self-hosted** · Yes — mastra build emits a self-contained Node server that runs on any Node/Bun/Deno host; Enterprise Edition can be deployed on-prem or in your own cloud.

> Mastra deploys to any Node.js-compatible environment including Bun, Deno and Cloudflare. Server adapters let you run Mastra with Express, Hono or your own HTTP server.
> — https://mastra.ai/ai-agent-framework · Frequently asked questions, 'Can I deploy Mastra agents to my existing infrastructure?' answer

**Open source** · Yes — The framework (Community Edition) is Apache 2.0 on GitHub; enterprise features sit in a separately licensed Enterprise Edition.

> Mastra is fully open source under the Apache 2.0 license, so you control your source code and infrastructure.
> — https://mastra.ai/ai-agent-framework · Frequently asked questions, 'Can I deploy Mastra agents to my existing infrastructure?' answer

## What it costs to run

**How it meters** · Yes — Plan fee plus consumption metering: observability events, CPU hours, egress, memory tokens, retrieval storage and database rows all have per-unit overage rates. Not per seat.

> CPU Time 24 hours then $0.35/hr
> — https://mastra.ai/pricing · Plan comparison table, Server section, CPU Time row, Starter column

**Free tier** · Yes — Starter plan is $0/month with no call required, and the framework itself is free under Apache 2.0.

> Starter Free for everyone $0/ month
> — https://mastra.ai/pricing · Mastra Platform plan cards, Starter card header and price cell

**API access** · Yes — Every registered agent and workflow is exposed as an HTTP endpoint, with OpenAPI/Swagger, a typed client SDK and OpenAI-compatible Responses routes.

> Mastra runs as an HTTP server that exposes your agents, workflows, and other functionality as API endpoints.
> — https://mastra.ai/docs/server/overview · Server page, opening paragraph

**MCP server** · Yes — Both directions: MCPClient consumes external MCP servers, and MCPServer publishes your agents, tools and workflows to other MCP clients over stdio or HTTP.

> Use MCPServer to expose Mastra agents, tools, workflows, prompts, and resources to other MCP-compatible systems.
> — https://mastra.ai/docs/connections/mcp · MCP page, second paragraph

**Bring your own key** · Yes — BYOK is an explicit Gateway access mode on every plan; keys are stored encrypted and used only to route your requests. Self-hosting your own inference endpoint is also supported.

> Bring-Your-Own-Keys (BYOK), under which Customer provides its own API keys for one or more Model Providers (or for a third-party gateway provider)
> — https://mastra.ai/terms-of-service · Section 7.2 Gateway Inference, access mode (b)

## Buying it for a team

**A company can buy it** · Yes — Teams plan is self-serve at a published price with multi-team support; Enterprise is bought through an Order Form with sales.

> Teams For growing teams $250/ month
> — https://mastra.ai/pricing · Mastra Platform plan cards, Teams card header and price cell

**Seat model** · No — Not licensed per seat: Starter and Teams both state unlimited users, and the self-hosted Enterprise offer explicitly rejects per-seat metering.

> Predictable cost One flat annual fee — no per-trace or per-seat metering.
> — https://mastra.ai/pricing · Self-Hosted tab, Enterprise card, 'Predictable cost' bullet

**Pooled budget** · Yes — Allowances are account-level (events, CPU hours, tokens, storage) and users are unlimited, so there is one shared balance rather than a per-user budget.

> Unlimited users, deployments, and projects
> — https://mastra.ai/pricing · Mastra Platform plan cards, Starter card feature bullet

**Admin controls** · Partly — RBAC restricts read/write/execute/delete per resource in Studio and on the API, but SSO and RBAC in production are Enterprise Edition features requiring a licence.

> Studio Auth features (SSO login, RBAC, permission-based UI) are part of the Mastra Enterprise Edition.
> — https://mastra.ai/docs/studio/auth · Studio auth page, 'EE licensing' section

**Audit log** · Partly — Audit logs are named only in the Enterprise tier's bundle; Starter and Teams cards do not list them.

> Custom volume and retention, with RBAC, audit logs, support and uptime SLAs, and a dedicated support engineer.
> — https://mastra.ai/pricing · Mastra Platform plan cards, Enterprise card body

**Single sign-on** · Partly — SSO starts at Teams on the hosted platform; on self-hosted deployments SSO login is an Enterprise Edition licensed feature. Providers include WorkOS, Okta, Clerk, Auth0.

> Multiple teams, SSO, and SOC 2 docs
> — https://mastra.ai/pricing · Mastra Platform plan cards, Teams card feature bullet

## What happens to your code

**Opt out of training** · Yes — Contractual no-training default on customer inputs and outputs, for Mastra's and model providers' models, with training only on express opt-in.

> Mastra does not, and will not, use Customer Inputs or Customer Outputs to train, fine-tune, or otherwise improve any foundation model or other Model owned by Mastra or by any Model Provider
> — https://mastra.ai/terms-of-service · Section 4.3 No Training on Customer Data

**Data residency** · Partly — Self-hosted Enterprise keeps traces, prompts and outputs inside your own VPC; for the hosted platform the vendor publishes no region or jurisdiction.

> Data stays in your VPC No traces, prompts, or outputs leave your environment.
> — https://mastra.ai/pricing · Self-Hosted tab, Enterprise card, 'Data stays in your VPC' bullet

**Getting out** · Partly — You own your data and can cancel any time, but retention is capped by plan (15 days to 6 months), backups are your responsibility and downgrading may delete data over the new limit.

> Mastra has no obligation to store Customer Data indefinitely. ... You are responsible for maintaining your own back-up copies of Customer Data.
> — https://mastra.ai/terms-of-service · Section 4.6 Storage and Retention

**Certifications** · Partly — SOC 2 documentation is offered from the Teams plan; a DPA covering GDPR, UK GDPR and CCPA/CPRA is published, and a Vanta-hosted trust centre carries the security programme. No ISO 27001 claim found.

> Multiple teams, SSO, and SOC 2 docs
> — https://mastra.ai/pricing · Mastra Platform plan cards, Teams card feature bullet

## Platform record (as of 2026-08-30)

Reported by the code-hosting platform, not by the vendor.

| Fact | Value |
| --- | --- |
| Stars | 27570 |
| Forks | 2711 |
| Last push | 2026-08-30 |

## Provenance

1 of 17 sources behind the facts above are independent of the vendor.

## Coverage elsewhere

None recorded. Every fact above comes from the vendor and is not independently corroborated yet.

## What changed

- 2026-09-02 — Capabilities · Commercial terms · Free tier
- 2026-08-31 — Capabilities · Commercial terms · Free tier · Price
- 2026-08-23 — Alternatives · LinkedIn link · One-liner · Summary

## Correcting this record

Anything marked "Not established" is a question we have not answered — it is not a No. If you represent Mastra, or anything here is wrong or out of date, you can supply it with a source: the operations this site accepts from an agent are listed at https://theagentsindex.com/.well-known/agents.json — that catalogue needs no key to read, and each entry states its own auth.

Supplying evidence is free. Nothing that can be bought here changes what a field says, whether a gap is closed, or how this record is scored.
