Mastra logo

Mastra

Visit

Open-source TypeScript agent framework: agents, workflows, RAG, memory, MCP, and eval with a hosted platform. About 27,437 GitHub stars (2026-08-25).

Share:

Mastra

Mastra is an open-source TypeScript framework for building AI agents and agentic applications. The core framework is free and Apache-2.0 licensed (with a separate commercial license for ee/ enterprise modules), and the GitHub repo mastra-ai/mastra showed 27,437 stars when we checked on 2026-08-25. It is popular on social feeds as a fast way to ship agents, workflows, RAG, and evaluations without leaving the TypeScript ecosystem.

Key Features

  • Agents: Combine an LLM with tools, memory, and instructions in one primitive, with streaming and structured output.
  • Workflows: Deterministic, graph-based orchestration for multi-step pipelines where you control the order of execution.
  • RAG: Built-in retrieval, with vector store integrations and reranking for grounded answers.
  • Memory: Working memory and long-term memory, including the Observational Memory pattern referenced widely in community posts.
  • MCP support: Model Context Protocol servers and clients work out of the box, so you can plug in external tools.
  • Eval and observability: Built-in evaluation harness plus metrics, logs, and traces that you can view in the hosted platform.

Use Cases

  • Customer-facing agents: Agents that act inside your own product and return complete deliverables.
  • Internal agents: Bots in Slack or other internal systems that summarize, triage, and automate.
  • Developer platforms: Let other product teams build agents on top of your primitives.
  • Prototyping to production: Teams that want one TypeScript codebase for both experiments and deployment.

Pricing

The framework is open source and free. mastra.ai/pricing offers a hosted platform with the following plans (checked 2026-08-25):

Plan Price Included
Starter $0/month 100K observability events, 24 CPU hours, 15-day retention
Teams $250/month 1M events, 250 CPU hours, 6-month retention, SSO and SOC 2 docs
Enterprise Custom Custom volume, RBAC, audit logs, SLA, dedicated engineer

Usage-based add-ons (events, CPU time, memory tokens, retrieval storage) apply beyond plan limits. Persistent 24/7 server deployments are a $100/project add-on.

Advantages & Unique Selling Points

Compared to competitors:

  1. TypeScript native: End-to-end types from agent definition to tools, which fits teams already on Node.
  2. Everything in one repo: Agents, workflows, RAG, memory, eval, and deployment are first-party, so you do not stitch five libraries together.
  3. MCP first: Native Model Context Protocol support makes the growing MCP tool ecosystem immediately usable.

What makes it stand out: it treats observability and evaluation as core features, not afterthoughts, which is why community posts compare it favorably to stitching raw LangChain calls.

Getting Started

Quick Start Guide

  1. Scaffold: npm create mastra@latest and follow the CLI prompts.
  2. Build an agent: Give it a model, tools, and instructions, then stream responses.
  3. Add memory or RAG: Wire in long-term memory or a vector store for grounded answers.
  4. Deploy: Push to Mastra Server (self-hosted) or the hosted platform and watch traces.

Integration

Integrates with 100+ LLM providers, OpenAI-compatible endpoints, vector databases (including LibSQL/Postgres), and MCP servers.

Frequently Asked Questions

Is Mastra free?

The framework is open source and free. The hosted platform has a $0 Starter tier and paid Teams/Enterprise tiers.

What license is it under?

Core is Apache-2.0; ee/ enterprise modules are under a separate commercial license (see LICENSE.md in the repo).

Does it support MCP?

Yes, MCP servers and clients are supported out of the box.

Alternatives

If Mastra is not the right fit, consider these alternatives:

Tips & Best Practices

  1. Start with a workflow before reaching for free-form agents when the task is a fixed pipeline.
  2. Use built-in eval early; it is cheaper to catch regressions on a small set than to re-run a big harness.
  3. Watch observability events on the free tier, since overage is metered per 100K events.

Conclusion

Mastra gives TypeScript teams a single, open-source framework for agents, workflows, RAG, memory, and eval, with a hosted platform when you need it. Start at mastra.ai or the GitHub repo, and compare with LangGraph if you need a lower-level runtime.

Comments

No comments yet. Be the first to comment!