
Mastra
mastra.ai- Category
- AI Agents
- Rank
- No. 35Tools index
- Pricing
- Freemium
- Platform
- web · cli
- Type
- TOOL
- Builder
- mastra-ai
- GitHub
- 27.3k stars
- Latest release
- @mastra/core@1.59.0
- Added
- Jul 4, 2026
About
Mastra is a TypeScript framework for building AI-powered agents and applications with built-in memory, tools, workflows, and observability. It provides everything needed to go from prototype to production, including MCP support, evals, tracing, and cloud deployment. Used by companies like Brex, MongoDB, and Marsh for real-world agentic workloads.
What it does
Mastra gives TypeScript teams two execution styles for AI systems. Agents can choose tools and iterate toward an answer, while graph-based workflows define branches, parallel steps, and ordered control. Projects can run inside React, Next.js, or Node applications, or expose standalone server endpoints.
Why it's ranked here
Mastra looks strongest when one framework should cover both open-ended agents and controlled business processes. Its case rests on a broad model interface, resumable human approvals, persistent context, MCP exposure, evaluation, and observability. The repository also shows serious operational tooling for building, linting, deploying, migrating, and running workers.
What's good
The workflow engine supports explicit sequencing, branching, and parallel work, while agents handle less predictable tasks. Suspended runs persist their state, so approvals can wait without losing progress. Context options span conversation history, retrieval, working memory, and observational memory. MCP servers can expose agents, tools, and structured resources to compatible clients.
Tradeoffs
The surface area is large, with separate packages for core behavior, memory, retrieval, evaluation, servers, deployment, authentication, and editing. Some packages require subpath imports rather than a convenient top-level entry. Compatibility code is duplicated across packages until peer requirements tighten. Enterprise directories require a commercial license for production use.
How to use it well
Pick Mastra for a TypeScript team building an agent service, a controlled multi-step process, or both. Start through the project generator, develop and test in Studio, then add persistence, evaluation, and tracing as behavior stabilizes. Use MCP when other compatible systems need access. It integrates with web UI libraries, but does not replace the product interface layer.
Technical notes+
The root package.json defines a private ESM pnpm workspace orchestrated with Turbo, TypeScript, Vitest, ESLint, and oxfmt, and requires pnpm 11 or newer. packages/cli/src/index.ts uses Commander and registers project creation, initialization, lint, development, build, deployment, worker, authentication, environment, and Studio commands, with PostHog analytics initialized at startup. packages/core/src/index.ts exposes Mastra and Config, while packages/mcp/src/index.ts re-exports client, server, and shared surfaces. packages/server/src/index.ts deliberately throws and directs consumers to subpath imports. packages/evals/src/index.ts likewise documents subpath-only usage. packages/memory/src/index.ts contains explicit compatibility copies for helpers missing from older permitted core versions.
Observed
- License
- Dual license: most code is Apache-2.0; directories named ee use the Mastra Enterprise License and require a valid enterprise license for production.
- Primary language
- TypeScript, with the repository configured as ECMAScript modules.
- Install surface
- The recommended project bootstrap is npm create mastra@latest; manual installation is also documented.
- Package structure
- Private pnpm monorepo with packages for core, CLI, MCP, retrieval, memory, evaluation, server, authentication, editor, logging, codemods, and deployment.
- Interfaces
- Provides a TypeScript library, CLI, MCP client and server exports, standalone server endpoints, Studio, and worker bundles.
- Application support
- Integrates with React, Next.js, and Node applications, or runs as a standalone server.
Read from README.md, package.json, packages/cli/src/index.ts, packages/mcp/src/index.ts, packages/rag/src/index.ts, packages/auth/src/index.ts, packages/core/src/index.ts, packages/evals/src/index.ts, packages/editor/src/index.ts, packages/memory/src/index.ts, packages/server/src/index.ts, packages/codemod/src/index.ts, packages/loggers/src/index.ts, packages/deployer/src/index.ts.
What it can do
Build and deploy AI agents with persistent memory
TypeScript code defining agent behavior and memory configuration → Production-ready AI agent that retains context across conversations
Create multi-step AI workflows
Workflow definition connecting multiple AI tasks and logic steps → Executable workflow that orchestrates AI operations in sequence or parallel
Integrate external tools into AI agents
Tool definitions or MCP (Model Context Protocol) server connections → AI agent capable of calling APIs, databases, or external services
Trace and observe AI agent behavior
Running AI agent or workflow → Detailed execution traces, logs, and observability data for debugging
Evaluate AI agent output quality
Agent responses and evaluation criteria → Scored evaluation results measuring agent accuracy and performance
Deploy AI agents to cloud infrastructure
Mastra agent or workflow project codebase → Hosted, scalable cloud deployment of the AI agent
Scaffold AI agent projects via CLI
CLI commands and project configuration options → Bootstrapped TypeScript project with agent boilerplate and dependencies
Tags
Tech Stack
Media
Comments (0)
No comments yet
Indexed by a proprietary survey. Corrections welcome.