项目介绍
Agent 开发框架 · 2026-11-09 更新 · 本站尚未实测
Mastra 是一个用现代 TypeScript 技术栈构建 AI 应用与智能体的框架,面向从早期原型到生产应用的完整过程。它可以与 React、Next.js、Node 等前后端框架集成,也可以作为独立服务器部署。README 将其定位为“building AI-powered applications and agents”(构建 AI 应用与智能体),它本身是框架,并非可直接安装使用的成品智能体。
仓库当前处于公开维护状态,未在资料中显示归档或停止维护。
核心能力
点击能力名称查看输入、输出和原文依据。
- 模型路由:通过一个统一接口连接 40+ 提供方,README 明确提到 OpenAI、Anthropic、Gemini 等;模型目录页面为 https://mastra.ai/models 。
- Agents:基于 LLM 与工具构建自主智能体,可围绕目标推理、选择工具并迭代,直到输出最终答案或满足停止条件。
- Workflows:需要显式控制时,使用图式工作流引擎编排多步流程,语法包括
.then()、.branch()、.parallel()。 - Human-in-the-loop:可暂停智能体或工作流,等待用户输入或批准后恢复,执行状态依赖存储记录。
- 上下文管理:支持对话历史、从 API/数据库/文件检索数据(RAG),以及 Observational Memory 记忆机制。
- 集成与 MCP:可将智能体和工作流打包进 React、Next.js、Node 应用,或作为独立端点发布;也可编写 Model Context Protocol 服务端,对外暴露智能体、工具与结构化资源。
- 生产配套:内置 evals 评估与 observability 可观测能力,用于持续观察和迭代。
实际应用场景
适用场景
适合熟悉 TypeScript 的团队在自有项目中开发 AI 助手、对话应用、多步骤自动化流程,需要工具调用、流程分支、人工审批、检索增强和运行观测的场景。也适合需要把智能体或工具通过 MCP 暴露给其他系统接入的开发者。对于只想直接使用现成智能体、不愿写代码的用户,本项目并不合适。
安装与接入
README 推荐方式是运行:
npm create mastra@latest
并建议参照官方安装指南(https://mastra.ai/docs)完成 CLI 或手动安装。README 还给出带参数的创建方式:
npm create mastra@latest <project-name> -- --llm <provider>
其中 provider 在提示词中列出的选项为 openai、anthropic、google、xai。创建后进入项目目录并启动开发服务器,README 示例为:
创建项目后,请按官方安装指南启动开发服务器。
随后可在 http://localhost:4111 打开 Mastra Studio,用于构建、测试和管理智能体、工作流与工具。
注意:bgproc 仅出现在 README 的预置提示文本中,其来源与可用性待核验;实际安装参数与步骤请以官方文档为准。
使用条件与限制
- 是否需要部署
- 需自行准备运行环境,具体要求见正文
- 是否需要注册
- 账号和认证要求见正文;未明确说明的项目仍待核验
- 是否需要 API Key
- 待核验
- 费用与额度
- 费用边界见正文,项目许可不代表模型或托管服务免费
- 所需权限
- 待核验
- 许可证与服务条款
- 待核验
权限费用与限制
- 框架本身代码按 Apache-2.0 开源,但
ee/目录下代码采用 Mastra Enterprise License,生产使用需有效企业许可,开发与测试可免费使用。 - 调用 OpenAI、Anthropic、Gemini 等模型需自备相应账号与 API Key,模型调用费用由各提供方收取,README 未给出价格。
- 托管服务、企业功能及第三方模型是否收费,官方未在本资料中说明,需向官方核验。
- README 未声明对 Windows 或国内模型/国内网络环境的支持情况,均待核验。
- 数据存储、鉴权与权限边界取决于具体部署方式,README 未给出安全合规结论,需自行评估。
国内使用情况
网友核验 用户经验分享
与站长实测独立,不代表官方认证或本站已实测。
最近核验:暂无有效核验。参与人数按当前项目有效身份去重;不同核验项分别统计,不合并成用户总结果。仅统计审核通过且未过期的记录。
分项统计、有效期与样本量
| 核验项目 | 有效人数 | 成功 / 部分 / 失败 / 无法判断 | 成功率 | 最近核验 / 有效期 |
|---|---|---|---|---|
| 官方网站访问 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 7 天 |
| GitHub 仓库访问 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 7 天 |
| 安装与运行 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 官方服务国内连接 / MCP 连接 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 国内网络情况 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 7 天 |
| 国内模型兼容性 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 自定义 API | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 海外服务依赖 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 海外账号要求 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 中文界面 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 客户端兼容性 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 账号及费用信息 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
成功率 = 成功 ÷(成功 + 部分成功 + 失败);无法判断不计入分母。至少 5 份可判断结果才显示成功率。账号、费用、海外依赖与语言等事实项,成功表示核查结论与资料吻合,具体观察另行统计;不表示免费或没有海外依赖。不同网络、客户端和版本的结果不能直接等同。
最近有效核验
暂无审核通过且未过期的网友核验。欢迎提交真实使用记录。
查看全部有效核验 →国内实测状态:国内可用性待核验。协议兼容和官方资料说明不等于国内网络可用。
- 官方网站访问
- 尚未实测 待核验
- GitHub 仓库访问
- 尚未实测 待核验
- 官方服务国内连接
- 尚未实测 待核验
- 国内网络情况
- 尚未实测 待核验
- 国内模型兼容性
- 尚未实测 待核验
- 自定义 API
- 尚未实测 待核验
- 海外服务依赖
- 尚未实测 待核验
- 海外账号要求
- 尚未实测 待核验
- 中文界面
- 尚未实测 待核验
- 国内最后核验时间
- 尚未实测
许可与国内使用
本仓库采用双许可:核心框架及大部分代码为 Apache License 2.0;任何名为 ee/ 的目录(如 packages/core/src/auth/ee)为源可用,受 Mastra Enterprise License 约束。第三方组件沿用原许可证。公开仓库不代表全部功能免费,也不代表托管服务与模型调用免费。README 未说明服务器部署地域或国内访问情况,国内使用时的网络可达性、模型供应与合规要求均待核验。
项目资料与来源
字段依据与待核验事项
access:来源确认 · npm create mastra@latest
project_type:来源确认 · Mastra is a framework for building AI-powered applications and agents with a modern TypeScript stack.
原始 README(折叠技术参考)
# Mastra [](https://www.npmjs.com/package/@mastra/core) [](https://github.com/mastra-ai/mastra/actions/workflows/github-code-scanning/codeql) [](https://github.com/mastra-ai/mastra/stargazers) [](https://discord.gg/mastra-ai) [](https://x.com/mastra) [](https://www.npmjs.com/package/@mastra/core) [](https://www.ycombinator.com/companies?batch=W25) Mastra is a framework for building AI-powered applications and agents with a modern TypeScript stack. It includes everything you need to go from early prototypes to production-ready applications. Mastra integrates with frontend and backend frameworks like React, Next.js, and Node, or you can deploy it anywhere as a standalone server. It's the easiest way to build, tune, and scale reliable AI products. ## Why Mastra? Purpose-built for TypeScript and designed around established AI patterns, Mastra gives you everything you need to build great AI applications out-of-the-box. Some highlights include: - [**Model routing**](https://mastra.ai/models): Connect to 40+ providers through one standard interface. Use models from OpenAI, Anthropic, Gemini, and more. - [**Agents**](https://mastra.ai/docs/agents/overview): Build autonomous agents that use LLMs and tools to solve open-ended tasks. Agents reason about goals, decide which tools to use, and iterate internally until the model emits a final answer or an optional stopping condition is met. - [**Workflows**](https://mastra.ai/docs/workflows/overview): When you need explicit control over execution, use Mastra's graph-based workflow engine to orchestrate complex multi-step processes. Mastra workflows use an intuitive syntax for control flow (`.then()`, `.branch()`, `.parallel()`). - [**Human-in-the-loop**](https://mastra.ai/docs/workflows/suspend-and-resume): Suspend an agent or workflow and await user input or approval before resuming. Mastra uses [storage](https://mastra.ai/docs/server-db/storage) to remember execution state, so you can pause indefinitely and resume where you left off. - **Context management**: Give your agents the right context at the right time. Provide [conversation history](https://mastra.ai/docs/memory/conversation-history), [retrieve](https://mastra.ai/docs/rag/overview) data from your sources (APIs, databases, files), and add human-like memory with [Observational Memory](https://mastra.ai/docs/memory/observational-memory) so your agents behave coherently. - **Integrations**: Bundle agents and workflows into existing React, Next.js, or Node.js apps, or ship them as standalone endpoints. When building UIs, integrate with agentic libraries like Vercel's AI SDK UI and CopilotKit to bring your AI assistant to life on the web. - [**MCP servers**](https://mastra.ai/docs/tools-mcp/mcp-overview): Author Model Context Protocol servers, exposing agents, tools, and other structured resources via the MCP interface. These can then be accessed by any system or agent that supports the protocol. - **Production essentials**: Shipping reliable agents takes ongoing insight, evaluation, and iteration. With built-in [evals](https://mastra.ai/docs/evals/overview) and [observability](https://mastra.ai/docs/observability/overview), Mastra gives you the tools to observe, measure, and refine continuously. ## Get started The **recommended** way to get started with Mastra is by running the command below: ```shell npm create mastra@latest ``` Follow the [Installation guide](https://mastra.ai/docs) for step-by-step setup with the CLI or a manual install. If you're new to AI agents, check out our [templates](https://mastra.ai/docs/getting-started/templates), [course](https://mastra.ai/course), and [YouTube videos](https://youtube.com/@mastra-ai) to start building with Mastra today. <details> <summary><strong>Alternative:</strong> Use this pre-built prompt to get started</summary> ```md Create a new Mastra project. Mastra is a framework for AI applications and agents on a modern TypeScript stack. Before running the command, ask these questions one at a time and wait for each answer unless it was already provided: 1. Project name? (default: "my-mastra-app") 2. Provider? (required; options: "openai", "anthropic", "google", "xai") If the provider isn't supported, ask again and list the supported values. Run: `npm create mastra@latest <project-name> -- --llm <provider>` The command creates a default Mastra project, installs Mastra skills for detected coding assistants, and initializes Git when appropriate. After creation, enter the project directory and start the dev server: `npx bgproc start -n <project-name> -w -- npm run dev` Open Mastra Studio at `http://localhost:4111`. Studio is the interface for building, testing, and managing agents, workflows, and tools. Also mention that the Mastra model router provides access to thousands of models: https://mastra.ai/models ``` </details> ## Documentation Visit our [official documentation](https://mastra.ai/docs). ## Build with AI Learn how to make your agent a Mastra expert by following the [Build with AI guide](https://mastra.ai/reference/build-with-ai). ## Contributing Looking to contribute? Pull requests are limited to collaborators only. Therefore you can _best_ help by creating high-quality issues with good reproductions and descriptions. Mastra will then verify your report and prioritize it accordingly. If you want to run Mastra or its tests locally, refer to the [development documentation](./DEVELOPMENT.md) ## Support We have an [open community Discord](https://discord.gg/mastra-ai). Come and say hello and let us know if you have any questions or need any help getting things running. It's also super helpful if you leave the project a star here, at the [top of the page](https://github.com/mastra-ai/mastra) ## Licensing This repository uses a dual-license model: - **Apache License 2.0**: The core framework and the vast majority of this codebase is open source under Apache-2.0. - **Mastra Enterprise License**: Code in any directory named `ee/` (e.g., `packages/core/src/auth/ee/`) is source-available under the Mastra Enterprise License. These features require a valid enterprise license for production use but can be freely used for development and testing. See [LICENSE.md](./LICENSE.md) for the full license mapping and [ee/LICENSE](./ee/LICENSE) for the enterprise license terms. ## Security We are committed to maintaining the security of this repo and of Mastra as a whole. If you discover a security finding we ask you to please responsibly disclose this to us at [security@mastra.ai](mailto:security@mastra.ai) and we will get back to you.
历史前置条件说明(补充参考)
需 Node.js 与 npm 环境(README 以 npm 命令安装,具体版本待核验);使用模型需自备 OpenAI、Anthropic、Google 或 xAI 等提供方账号与 API Key;模型调用费用由提供方收取,价格待核验;企业版 `ee/` 功能生产使用需企业许可;Windows 支持、国内网络与国内模型兼容性待核验。
项目来源与清单版权许可
https://github.com/mastra-ai/mastra
整理来源:https://github.com/slavakurilyak/awesome-ai-agents
清单版权与许可:
MIT License
Copyright (c) 2024 Slava Kurilyak
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.