Skip to content
AgentAgent framework

mastra

TypeScript framework for building AI agents, workflows and MCP servers

mastra is a freemium agent framework for ai models and llm tooling. It is available on Web, API, CLI and Self-hosted.

Pricing
Freemium
Platforms
Web, API, CLI
GitHub stars
30K
Last commit
Language
TypeScript
Built with
Mastra

Similar agents

About mastra

Mastra gives TypeScript teams a set of building blocks for AI features: agents that choose their own tools, graph-based workflows with explicit control flow, and memory that keeps conversation history and retrieved data available across calls. Model access goes through one interface that covers a large number of providers, so switching between OpenAI, Anthropic, Gemini and others does not require rewriting application code.

Apps can be bundled into an existing React, Next.js or Node project, or run as a standalone server built on Hono. Workflows can suspend and wait for a person to approve or supply input, with execution state kept in storage so a paused run resumes where it stopped. Built-in evals and tracing show how agent runs behave, and agents can also be published as MCP servers for other clients to call.

The framework suits developers who want to stay in TypeScript rather than Python, from prototype to production deployment. The core is Apache 2.0 licensed, while code in ee/ directories falls under a separate enterprise license.

What it does

Autonomous agents
Agents use LLMs and tools to work through open-ended tasks and decide which tool to call next.
Graph-based workflows
Multi-step processes are chained with then, branch and parallel controls, with explicit execution order.
Human-in-the-loop pauses
Workflows can suspend for user input or approval and resume later from stored state.
Memory and context
Conversation history and data retrieved from APIs, databases and files are supplied to agents as context.
Evals and observability
Agent runs can be scored against checks and traced, including token usage, with external platform support.
MCP server authoring
Agents and tools can be exposed as Model Context Protocol servers for other AI clients.

Good for

  • Building a customer-facing chat assistant inside an existing Next.js app
  • Automating multi-step business processes with approval steps
  • Creating a domain copilot for research, legal or finance teams
  • Exposing internal tools to Claude Code or Cursor through an MCP server
  • Running scored test suites against agent behaviour before release

Pricing

Freemium, from $25 a month

Free plan; Starter from $25/month per project; Team and Enterprise tiers

Prices change. Check mastra.ai before you buy.

mastra FAQ

Is Mastra open source?

The core framework is licensed under Apache 2.0. Enterprise features in ee/ directories are source-available under the Mastra Enterprise License and need a license for production use.

How many model providers does mastra support?

Model routing connects to a large set of providers through one standard interface, including OpenAI, Anthropic and Gemini.

Can I deploy Mastra apps to serverless platforms?

Yes. Apps can run on any Node.js-compatible environment, with optional built-in deployers for Vercel, Netlify and Cloudflare.

Does mastra support MCP?

Yes, you can author MCP servers that expose agents, tools and other structured resources to any MCP-compatible client.

Is mastra free?

mastra has a free plan, with paid plans for more usage or features. Paid plans start at $25 a month.

What are the best alternatives to mastra?

The closest alternatives to mastra are typedai, maestro-orchestrate, OpenProgram, voltagent and automatos-ai.

Where this comes from

  • Description: written from the project's README and the project's website.