A community-curated open-source library of prompts for AI chat models, with a website, CSV/Hugging Face datasets, CLI and MCP server integration.
mastra-ai/mastra
A TypeScript framework for building AI agents and LLM-powered applications, with workflows, tools, memory, MCP servers, and evals.
- Stars
- 28,941
- Forks
- 3,021
- Open issues
- 568
- Last commit
- 10 hours ago
What is it?
Mastra is a framework for building AI-powered applications and agents on a TypeScript stack. It can be bundled into existing React, Next.js, or Node.js apps, or deployed as a standalone server. It connects to 40+ model providers, including OpenAI, Anthropic, and Gemini, through one standard interface.
The framework covers the main building blocks of an AI product. Agents use LLMs and tools to work toward open-ended goals, while a graph-based workflow engine provides explicit control flow with .then(), .branch(), and .parallel(). Agents and workflows can be suspended to wait for user input or approval and resumed later, with execution state kept in storage. Context features include conversation history, retrieval from data sources, and Observational Memory.
Mastra also includes tooling for production use: it can author MCP servers that expose agents and tools to any MCP-compatible client, and it provides built-in evals and observability. A CLI scaffolds new projects, and a local Studio interface is used to build and test agents, workflows, and tools.
Key features
- 01Connects to 40+ model providers through one standard interface.
- 02Graph-based workflow engine with branching and parallel steps.
- 03Agents that choose tools and iterate toward a goal.
- 04Suspend and resume agents or workflows for human approval.
- 05Built-in evals and observability for measuring agent quality.
Use cases
- Adding an AI assistant to an existing Next.js or React application.
- Orchestrating multi-step LLM pipelines with explicit control flow.
- Exposing internal agents and tools to other systems through MCP.
- Building agents that pause for human approval before taking action.
Quick start
- 1
Create a new Mastra project with the CLI
npm create mastra@latest - 2
Follow the installation guide for step-by-step setup
Things to know
- Enterprise features in ee/ directories require a paid license for production use.
- Mixed Apache-2.0 and source-available licensing means some code has different terms.
Topics
FAQ
- What is mastra?
- A TypeScript framework for building AI agents and LLM-powered applications, with workflows, tools, memory, MCP servers, and evals. Mastra is a framework for building AI-powered applications and agents on a TypeScript stack. It can be bundled into existing React, Next.js, or Node.js apps, or deployed as a standalone server. It connects to 40+ model providers, including OpenAI, Anthropic, and Gemini, through one standard interface.
- Is mastra free to use? What license does it have?
- mastra is open source under the Other license. Check the license terms before using it in commercial products.
- Is mastra still maintained?
- Actively maintained. The last commit to mastra was on Oct 20, 2026.
- What can I use mastra for?
- Adding an AI assistant to an existing Next.js or React application. Orchestrating multi-step LLM pipelines with explicit control flow. Exposing internal agents and tools to other systems through MCP. Building agents that pause for human approval before taking action.
- How do I install mastra?
- Create a new Mastra project with the CLI: npm create mastra@latest Follow the installation guide for step-by-step setup
- Where can I get mastra?
- The source code and installation instructions are on GitHub: https://github.com/mastra-ai/mastra
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
LobeHub is a platform for organizing AI agents into always-on teams that can be hired, scheduled, and reviewed from one place.
A JavaScript library that embeds a GUI agent in any web page, letting users control the interface with natural language.
TypeScript framework for building AI agents with memory, tools, MCP, RAG, voice and workflows, plus the VoltOps console for observability.
Open-source SDK for building and running AI agents in Python and TypeScript, with tools, MCP, memory, and model portability.
A TypeScript SDK for building persistent, stateful AI agents on Cloudflare Durable Objects, with real-time state sync, scheduling, and MCP support.