Mastra
A strong pick. 4th of 9 AI SDKs and agent frameworks.
Mastra is a full TypeScript agent framework built on the Vercel AI SDK. It bundles agents, workflows, memory, RAG, evals and a local studio. It is growing fast and is a strong pick when you want a batteries-included framework rather than a thin model-calling layer. Its June 2026 npm supply-chain compromise is a reason to pin versions and use lockfiles.
Best for: TypeScript teams that want agents, workflows, memory and observability in one integrated framework rather than assembling them on top of the AI SDK.
Scores
Overall7.7
How strongly do we recommend it for a new project today?
Claude Opus 5.5: 7.5, likely 6.5 to 8.5
Mastra is the strongest batteries-included agent framework for TypeScript. It is very actively maintained and its adoption is growing fast. The AI SDK stays the safer default for teams that only need model calls, streaming and tools, and LangGraph.js suits complex stateful graphs. The June 2026 supply-chain compromise and the fast-moving API lower the score. Pin versions and commit lockfiles if you adopt it.
- npm downloadsLast4Weeks: Fast growth well above the median.
- blog.logrocket.com/ai-agent-frameworks-2026: Recommended when you want built-in memory and a registry.
- socket.dev/blog/mastra-npm-packages-compromised: Scope-wide npm compromise in June 2026.
- peers AI SDK: AI SDK is the base layer with far greater reach.
GPT-6.2 Sol: 7.9, likely 6.7 to 8.8
Mastra is a strong choice for a new TypeScript agent service that needs memory, approvals, and tracing together. Vercel AI SDK is a better default for simple model calls and streamed chat, and LangGraph.js is worth choosing when explicit graph checkpoints and replay are central. Funded maintenance and confirmed production use support the score, while the recent npm incident and short stable track record keep the range wide.
- agentopsguide.com/mastra-vs-vercel-ai-sdk-vs-langgraph: Comparison shows the trade-offs between install size, integrated features, and graph persistence.
- mastra.ai/blog/series-a: Funded team continues to develop the framework and deployment tools.
- sanity.io/engineering/how-we-built-our-company-agent-harness: Sanity confirms current use for its Content Agent.
- github.com/mastra-ai/mastra/issues/18061: Recent registry compromise with a documented response within hours.
Needed by many5.4
How many developers need a tool for this job?
Claude Opus 5.5: 6.0, likely 5.0 to 7.0
Calling models and building agents is now common work in web apps. Mastra's take, a full framework with workflows and memory, serves a subset of that: teams building agents, not those that only need a model call. It runs on Node, serverless and edge-like runtimes, and it is not tied to one UI framework.
- category.job: Broad category: call models and build agents in JS/TS.
- blog.logrocket.com/ai-agent-frameworks-2026: Positions Mastra as a step above the AI SDK, adding memory and a registry.
GPT-6.2 Sol: 4.8, likely 3.5 to 6.1
Mastra works across model providers and several JavaScript server frameworks. Its integrated stack is most useful when an application needs agent state, orchestration, and debugging. A small production survey found that most teams still call model APIs directly or build their own abstractions, leaving the size of Mastra's audience uncertain.
- mastra.ai/docs: TypeScript quickstart with model routing and typed tools.
- mastra.ai/blog/announcing-mastra-1: Adapters for Express, Hono, Fastify, and Koa.
- inngest.com/assets/reports/2026-benchmark/2026-durable-execution-benchmark-report.pdf: 69% in this production sample used direct APIs or their own abstractions.
Helps a lot7.9
How well does it do the job for those who need it?
Claude Opus 5.5: 7.5, likely 6.5 to 8.5
Mastra is the most complete TypeScript-native agent framework. It has agents, graph-like workflows, thread-based memory, RAG, evals, tracing and a studio, with good types. Users praise the developer experience and quickstart. Some find its abstractions rigid, and an independent test found that the step limit fails silently. The constant API churn and extra setup compared with the plain AI SDK keep it from the top of the range.
- blog.logrocket.com/ai-agent-frameworks-2026: Built-in memory and per-call limits; more boilerplate; silent failure at step limit.
- hn.svelte.dev/item/46693959: Users praise TS DX; others find workflows clunky and abstractions opinionated.
- dev.to/alexcloudstar/ai-agent-frameworks-in-2026-langgraph-vs-mastra-vs-vercel-ai-sdk-vs-openai-agents-sdk-vs-pydantic-539b: Comparison frames Mastra as the full-stack TS option, with weaker multi-agent support than LangGraph.
- npm hasTypes: Ships TypeScript types.
GPT-6.2 Sol: 8.2, likely 7.1 to 9.2
Stable 1.85.0 combines typed tools, memory, resumable workflows, tracing, and evaluations. A hands-on comparison verified that approvals survive a restart with persistent storage, and it measured a larger install and slower imports than both peers tested. A user reported friction with rules-heavy branching. Embedded docs give coding agents a version-matched reference, though their effect on generated-code accuracy remains unmeasured here.
- npm.latestVersion and npm.hasTypes: Stable 1.85.0 ships TypeScript declarations.
- raw.githubusercontent.com/mastra-ai/mastra/main/packages/core/CHANGELOG.md: The 1.85.0 entry documents streaming, workflow, and tracing fixes.
- agentopsguide.com/mastra-vs-vercel-ai-sdk-vs-langgraph: Approval resumed with LibSQL. Mastra had the largest install and slowest import in the test.
- mastra.ai/reference/build-with-ai: Installed packages include reference docs and a map of public exports.
- news.ycombinator.com/item?id=46693959: A user reported replacing Mastra workflows for rules-heavy branching.
Holds up over time8.0
Will it still be a good choice in two years?
Claude Opus 5.5: 8.0, likely 7.0 to 9.0
Activity is very high: 12,453 commits, 98 releases and 702 contributors in a year, with about 7,000 closed issues against 503 open. A venture-funded company (YC) backs it, with a hosted cloud business. The team handled the June 2026 compromise the same day. The main risks are an API that changes very often and dependence on one startup's business model.
- github commitsLastYear / releasesLastYear / contributors: 12,453 commits, 98 releases, 702 contributors.
- npm versionsLastYear: 101 versions in a year; fast cadence.
- ycombinator.com/companies/mastra: Company-backed project (YC).
- snyk.io/blog/a-forgotten-contributor-account-compromised-the-entire-mastra-npm-package-scope: Same-day remediation of the npm scope compromise.
GPT-6.2 Sol: 8.0, likely 6.8 to 9.0
Mastra has a funded team and published 101 core versions over the past year. Maintainers closed a reported durable-agent resume bug within six days. The two-year outlook still depends on a young stable API, and the 1.0 migration and recent changes to experimental features show where upgrades can require work.
- npm.versionsLastYear and github.contributors: 101 core versions in a year and 702 contributors across the repository.
- mastra.ai/blog/series-a: Mastra announced a $22 million Series A led by Spark Capital.
- github.com/mastra-ai/mastra/issues/30206: A November resume bug went from report to merged fix in six days.
- mastra.ai/blog/announcing-mastra-1: January stable launch included breaking changes, a migration guide, and codemods.
- github.com/mastra-ai/mastra/releases/tag/@mastra%2Fcore@1.84.0: November release added workflow crash recovery and changed experimental knowledge scope behavior.
Used widely6.6
How many use it, and is that growing?
Claude Opus 5.5: 7.0, likely 6.0 to 8.0
@mastra/core had 13.4M downloads in 4 weeks, up from 0.92M a year before. That ratio of about 14.6x is far above the 4.1x median. Some downloads come from Mastra's own sub-packages and scaffolding, so real direct choices are lower than the raw count. Its 29.7k stars are the most in the category. It is still well behind the AI SDK and provider SDKs in raw installs, and close to LangChain.js and LangGraph.js.
- npm downloadsLast4Weeks / downloadsSame4WeeksYearAgo: 13.4M vs 0.92M a year earlier, about 14.6x growth.
- medianDownloadsRatio: Median is 4.1x; Mastra is well above it.
- github stars: 29,714 stars, the most among peers.
- peers AI SDK downloadsLast4Weeks: AI SDK has about 180M per 4 weeks, an order of magnitude more.
GPT-6.2 Sol: 6.2, likely 4.7 to 7.6
Four-week downloads rose 14.6× year over year, above the catalog's 4.1× median and faster than AI SDK, LangChain.js, and LangGraph.js. AI SDK still has a much larger install base, and Stack Overflow's orchestration survey puts Mastra at 3% versus 9% for Vercel AI SDK. Other Mastra packages and automated installs can drive core downloads, the stars and Bluesky posts cover the whole repository, and the missing dependent count leaves direct adoption hard to size.
- npm.downloadsLast4Weeks, npm.downloadsSame4WeeksYearAgo, medianDownloadsRatio, and peers: 13.4 million downloads versus 921,257 a year earlier. AI SDK had 180.3 million.
- dependents, github.stars, and bluesky.posts: No dependent count. About 29,700 stars and 60 Bluesky posts cover the repository.
- survey.stackoverflow.co/2026/ai/data: 132 of 4,400 orchestration respondents reported using Mastra, versus 395 for Vercel AI SDK.
Vouched for7.1
Who stands behind it being good?
Claude Opus 5.5: 6.5, likely 5.0 to 8.0
Independent write-ups (LogRocket, dev.to comparisons) and well-received Show HN launches treat it as the main TypeScript agent framework. Users report production use, including Brex consolidating on it. Most production logos (PayPal, Adobe, Replit) come from Mastra's own marketing, and no developer survey reports satisfaction data for it yet.
- hackerNews top: Show HN launches with 442, 213 and 154 points.
- blog.logrocket.com/ai-agent-frameworks-2026: Independent hands-on comparison including Mastra.
- producthunt.com/p/mastra/mastra-1-0: User reports of company use; Brex consolidated on Mastra.
- infoq.com/news/2026/03/state-of-js-survey-2025: State of JS 2025 coverage gives no library-level data for Mastra.
GPT-6.2 Sol: 7.6, likely 6.4 to 8.6
Sanity confirms that its Content Agent uses Mastra, and Brex's CTO described its use in Brex's agent stack. An independent comparison verified that human approvals can resume after a restart with persistent storage. These reports cover specific deployments and tests, so long-term retention and reliability across workloads remain uncertain.
- sanity.io/engineering/how-we-built-our-company-agent-harness: Sanity engineering identifies Mastra as the framework for its Content Agent.
- latent.space/p/brex: Brex CTO interview describes Mastra use and why its API fit the team.
- agentopsguide.com/mastra-vs-vercel-ai-sdk-vs-langgraph: Independent comparison exercised approval and restart behavior.
- thoughtworks.com/content/dam/thoughtworks/documents/radar/2026/04/tr_technology_radar_vol_34_en.pdf: Thoughtworks placed Mastra in Assess in its April radar.
Safe5.3
How safe is it to depend on?
Claude Opus 5.5: 5.0, likely 3.5 to 6.5
On June 17, 2026, an attacker used a former contributor's unrevoked npm access to republish about 142 @mastra packages. The injected dependency's postinstall step dropped a credential stealer and a remote access trojan. Microsoft attributed the attack to a state actor. Mastra rolled clean releases forward within hours, but the incident shows that publish access was weakly controlled, and sources do not confirm that provenance is now required. The package pulls 30 dependencies, there is no Scorecard, and the licence is Apache-2.0, with some enterprise features planned under a separate licence.
- advisories MAL-2026-6011: Malicious code advisory for @mastra/core, June 2026.
- snyk.io/blog/a-forgotten-contributor-account-compromised-the-entire-mastra-npm-package-scope: Root cause: stale contributor publish access; same-day forward-fix; provenance not required.
- microsoft.com/en-us/security/blog/2026/06/17/postinstall-payload-inside-mastra-npm-supply-chain-compromise: Postinstall payload analysis; state-actor attribution.
- npm dependencies / license: 30 dependencies; Apache-2.0.
- scorecard: No OpenSSF Scorecard available.
GPT-6.2 Sol: 5.5, likely 4.1 to 7.0
A June npm account compromise put malicious code in core 1.42.1. Mastra published clean replacements within hours of detection and removed the ability for publishing tokens to bypass MFA. Core has 30 direct dependencies and uses Apache-2.0, while designated enterprise code requires the Mastra Enterprise License for production use. The missing OpenSSF Scorecard and unverified current count of accounts with publish access widen the range.
- osv.dev/vulnerability/MAL-2026-6011: Advisory identifies 1.42.1 as the affected core version.
- github.com/mastra-ai/mastra/issues/18061: Incident timeline records containment, clean releases, and removal of MFA token bypass.
- snyk.io/blog/a-forgotten-contributor-account-compromised-the-entire-mastra-npm-package-scope: Independent registry analysis corroborates the compromise and clean replacements.
- github.com/mastra-ai/mastra#licensing: Apache-2.0 applies to the core framework. Code in enterprise directories has separate production terms.
- npm.dependencies and scorecard: 30 direct dependencies and no OpenSSF Scorecard in the bundle.
Good
- Agents, workflows, memory, RAG, evals and a local dev studio come in one TypeScript-native package.
- It is built on the AI SDK, so it works with any model provider and its streams plug into AI SDK UI hooks.
- Development is very active: about 12,000 commits, 98 releases and 700+ contributors in the last year.
- Adoption is growing fast: downloads rose about 14.6x year on year, against a 4.1x median.
Bad
- In June 2026 an attacker republished the whole @mastra npm scope with a malicious dependency, using a stale contributor credential.
- It is opinionated, so stepping outside its patterns can be clunky. Users mention workflows for non-LLM logic and custom server routes.
- A very fast release cadence (100+ versions a year, now at 1.85) means frequent upgrades and API drift.
- An independent comparison found that hitting the step limit fails silently unless you check finishReason yourself.
The numbers
- npm downloads, 4 weeks
- 13M ×15 in a year
- GitHub stars
- 30k
- Commits, 12 months
- 12k
- npm version
- 1.85.0 Nov 2026
- Versions, 12 months
- 101
- Advisories, 24 months
- 1 of 1 ever
- OpenSSF Scorecard
- None
- Licence
- Apache-2.0
Read on 21 November 2026 from GitHub (mastra-ai/mastra), npm (@mastra/core), OSV and the OpenSSF Scorecard.
AI SDKs and agent frameworks
- 9.0AI SDK
- 7.9OpenAI SDK
- 7.8Anthropic SDK
- 7.7Mastra
- 7.5LangGraph.js
- 7.4OpenAI Agents SDK
- 6.8LangChain.js
- 6.7Genkit
- 1.5LlamaIndex.TS