Mastra

Mastra

Modern TypeScript framework for building AI agents, graph workflows, RAG pipelines, and MCP servers with built-in evals.

★ 29.9K

Build production AI agents in pure TypeScript with Mastra

Web developers building in React and Next.js often feel forced to spin up a separate Python microservice just to get serious AI agent orchestration, memory, and evaluation tools. Mastra brings a complete agent engineering framework directly to your TypeScript stack. Backed by 29.9K GitHub stars and 3,200 forks with an Apache-2.0 core, it lets you ship agents inside your existing Node.js or Next.js app or as a standalone server.

Core features for TypeScript AI engineers

  • A unified model router connects to over 40 LLM providers, including OpenAI, Anthropic, Google Gemini, and xAI, through one typed interface.
  • Its graph-based workflow engine gives you explicit `.then()`, `.branch()`, and `.parallel()` control flow with durable pause-and-resume for human-in-the-loop approvals.
  • Observational memory and RAG utilities pull context from conversations, APIs, vector stores, and files without custom boilerplate.
  • Mastra Studio runs locally on port 4111 so you can test prompts, inspect OpenTelemetry traces, run automated evals, and publish MCP servers visually.

Practical caveats

While the core framework is open source under Apache-2.0, folders marked `ee/` (such as certain enterprise auth modules) use the Mastra Enterprise License for production deployment. Also note that the repository restricts direct pull requests to collaborators, so community members contribute via detailed reproducible issues.

Quick takeaway

Run npm create mastra@latest to spin up a local TypeScript agent studio and build your first tool-using workflow in minutes.

Ready to try Mastra?

Experience the full capabilities on their official website.

Visit Official Website