@mastra/mcp-docs-server 1.1.23-alpha.3 → 1.1.24-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.docs/docs/editor/overview.md +155 -0
- package/.docs/docs/editor/prompts.md +71 -0
- package/.docs/docs/editor/tools.md +152 -0
- package/.docs/docs/studio/overview.md +2 -0
- package/.docs/models/index.md +1 -1
- package/.docs/models/providers/chutes.md +3 -2
- package/.docs/models/providers/cloudflare-workers-ai.md +13 -48
- package/.docs/models/providers/friendli.md +6 -7
- package/.docs/models/providers/opencode-go.md +2 -1
- package/.docs/models/providers/opencode.md +2 -2
- package/.docs/models/providers/poe.md +2 -1
- package/.docs/models/providers/zai.md +2 -1
- package/.docs/models/providers/zenmux.md +2 -1
- package/.docs/models/providers/zhipuai.md +2 -1
- package/.docs/reference/client-js/agents.md +136 -0
- package/.docs/reference/editor/mastra-editor.md +90 -0
- package/.docs/reference/editor/tool-provider.md +85 -0
- package/.docs/reference/index.md +2 -0
- package/CHANGELOG.md +8 -0
- package/package.json +6 -6
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# Editor overview
|
|
2
|
+
|
|
3
|
+
The editor is a CMS-style system that separates agent configuration from code. Subject-matter experts, prompt engineers, and product teams can iterate on agents directly while developers keep the codebase stable.
|
|
4
|
+
|
|
5
|
+
The editor manages two types of resources alongside agents:
|
|
6
|
+
|
|
7
|
+
- [**Prompts**](https://mastra.ai/docs/editor/prompts): Reusable, versioned instruction templates with template variables and display conditions.
|
|
8
|
+
- [**Tools**](https://mastra.ai/docs/editor/tools): Add tools from integration providers, MCP servers, and override tool descriptions at runtime.
|
|
9
|
+
|
|
10
|
+
## When to use the editor
|
|
11
|
+
|
|
12
|
+
Use the editor when you want to:
|
|
13
|
+
|
|
14
|
+
- **Let non-developers iterate**: Give subject-matter experts and prompt engineers a way to tune agent behavior without touching code or waiting for deploys.
|
|
15
|
+
- **Version everything**: Every save creates a snapshot so you can compare changes, roll back instantly, and audit what changed and when.
|
|
16
|
+
- **Run experiments**: Route different users or requests to different agent versions for A/B testing, canary rollouts, or prompt experimentation.
|
|
17
|
+
- **Target specific versions**: Pin a version per request, per user, or per environment so production stays stable while new versions are tested.
|
|
18
|
+
- **Manage tools at runtime**: Add integration tools from Composio or Arcade, or connect MCP servers, without updating code.
|
|
19
|
+
- **Override code agents**: Change the instructions, tools, or variables of a code-defined agent while keeping the original code as the baseline.
|
|
20
|
+
|
|
21
|
+
For building agents entirely in code, see the [Agents overview](https://mastra.ai/docs/agents/overview).
|
|
22
|
+
|
|
23
|
+
## Quickstart
|
|
24
|
+
|
|
25
|
+
Add `@mastra/editor` to your project:
|
|
26
|
+
|
|
27
|
+
**npm**:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install @mastra/editor
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**pnpm**:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
pnpm add @mastra/editor
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Yarn**:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
yarn add @mastra/editor
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Bun**:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
bun add @mastra/editor
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Pass a `MastraEditor` instance to your Mastra configuration with your existing agents:
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
import { Mastra } from '@mastra/core'
|
|
55
|
+
import { MastraEditor } from '@mastra/editor'
|
|
56
|
+
|
|
57
|
+
export const mastra = new Mastra({
|
|
58
|
+
agents: {
|
|
59
|
+
/* your existing agents */
|
|
60
|
+
},
|
|
61
|
+
editor: new MastraEditor(),
|
|
62
|
+
})
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Once registered, you can manage agents through [Studio](https://mastra.ai/docs/studio/overview) or programmatically through the server API and Client SDK.
|
|
66
|
+
|
|
67
|
+
> **Note:** See the [MastraEditor reference](https://mastra.ai/reference/editor/mastra-editor) for all configuration options.
|
|
68
|
+
|
|
69
|
+
## Studio
|
|
70
|
+
|
|
71
|
+
Go to the **Agents** tab in Studio and select an agent to edit. Select the **Editor** tab. You'll be taken to the editor interface, where you can modify the agent's instructions, tools, and variables.
|
|
72
|
+
|
|
73
|
+
Modify the system prompt and save a new draft version. Afterwards, publish the draft to make it the active version.
|
|
74
|
+
|
|
75
|
+
## What can be overridden
|
|
76
|
+
|
|
77
|
+
When you edit a code-defined agent through the editor, only specific fields can be changed:
|
|
78
|
+
|
|
79
|
+
| Field | Description |
|
|
80
|
+
| ------------ | ------------------------------------------------------------------------------------------------------------- |
|
|
81
|
+
| Instructions | Replace or extend the agent's system prompt using [prompt blocks](https://mastra.ai/docs/editor/prompts). |
|
|
82
|
+
| Tools | Add tools from the tool registry, integration providers, or MCP clients. Code-defined tools remain available. |
|
|
83
|
+
|
|
84
|
+
Fields like the agent's `id`, `name`, and `model` come from your code and can't be changed through the editor for code-defined agents. The variables are also read-only.
|
|
85
|
+
|
|
86
|
+
## Versioning
|
|
87
|
+
|
|
88
|
+
Every time you save changes to an agent or prompt block, a new version snapshot is created. Versions give you a full history of your agent's configuration. You can roll back to any previous state, compare what changed between two snapshots, and target specific versions per request for A/B testing or gradual rollouts.
|
|
89
|
+
|
|
90
|
+
Version management is available through the server Studio, REST API, the Client SDK, and the React SDK. See the [Client SDK agents reference](https://mastra.ai/reference/client-js/agents) for endpoints, SDK methods, and code examples.
|
|
91
|
+
|
|
92
|
+
### Version lifecycle
|
|
93
|
+
|
|
94
|
+
Each version has one of three statuses:
|
|
95
|
+
|
|
96
|
+
| Status | Description |
|
|
97
|
+
| --------- | ----------------------------------------------------------------------------------- |
|
|
98
|
+
| Draft | The latest working copy. Every save creates a new draft version. |
|
|
99
|
+
| Published | The active version used in production. Only one version can be published at a time. |
|
|
100
|
+
| Archived | A previous version that is no longer active. You can restore any archived version. |
|
|
101
|
+
|
|
102
|
+
The typical flow is: Edit the draft, test it, then activate it to make it the published version. The previously published version becomes archived so you can restore it if needed. You can do this through Studio or programmatically through the API.
|
|
103
|
+
|
|
104
|
+
This lifecycle makes it safe to experiment. Non-technical team members can iterate on a draft without affecting production traffic, then publish when ready. If something goes wrong, restoring a previous version is a single API call.
|
|
105
|
+
|
|
106
|
+
### Version targeting and experimentation
|
|
107
|
+
|
|
108
|
+
Because every version has a unique ID, you can route different requests to different agent configurations. This opens up several patterns:
|
|
109
|
+
|
|
110
|
+
- **A/B testing**: Split traffic between two published versions and compare performance metrics.
|
|
111
|
+
- **Canary rollouts**: Send a small percentage of requests to a new version before promoting it.
|
|
112
|
+
- **Per-user targeting**: Pin specific users or accounts to a version while others use the default.
|
|
113
|
+
- **Environment separation**: Use the draft version in staging and the published version in production.
|
|
114
|
+
|
|
115
|
+
Pass a `versionId` or `status` when calling the agent through the Client SDK, server query parameters, or React SDK `requestContext`, and the correct version is loaded automatically.
|
|
116
|
+
|
|
117
|
+
### Version selection
|
|
118
|
+
|
|
119
|
+
By default, [`mastra.getAgentById()`](https://mastra.ai/reference/core/getAgentById) loads the published (active) version of the stored override. You can request a specific version, which is useful for testing a draft before publishing, running A/B experiments, or pinning a user to a known-good configuration:
|
|
120
|
+
|
|
121
|
+
```typescript
|
|
122
|
+
// Load the published version (default)
|
|
123
|
+
const agent = mastra.getAgentById('support-agent')
|
|
124
|
+
|
|
125
|
+
// Load the latest draft
|
|
126
|
+
const agent = mastra.getAgentById('support-agent', {
|
|
127
|
+
status: 'draft',
|
|
128
|
+
})
|
|
129
|
+
|
|
130
|
+
// Load a specific version
|
|
131
|
+
const agent = mastra.getAgentById('support-agent', {
|
|
132
|
+
versionId: 'abc-123',
|
|
133
|
+
})
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
When calling the agent through the Mastra server, pass version parameters as query strings:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
# Published version (default)
|
|
140
|
+
curl http://localhost:4111/agents/support-agent
|
|
141
|
+
|
|
142
|
+
# Latest draft
|
|
143
|
+
curl http://localhost:4111/agents/support-agent?status=draft
|
|
144
|
+
|
|
145
|
+
# Specific version
|
|
146
|
+
curl http://localhost:4111/agents/support-agent?versionId=abc-123
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
See the [Client SDK agents reference](https://mastra.ai/reference/client-js/agents) for API methods.
|
|
150
|
+
|
|
151
|
+
## Next steps
|
|
152
|
+
|
|
153
|
+
- Set up [prompts](https://mastra.ai/docs/editor/prompts) to build reusable instruction templates.
|
|
154
|
+
- Add [tools](https://mastra.ai/docs/editor/tools) from integration providers and MCP servers.
|
|
155
|
+
- Explore the [MastraEditor reference](https://mastra.ai/reference/editor/mastra-editor) for all configuration options.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Prompts
|
|
2
|
+
|
|
3
|
+
Prompt blocks are reusable instruction templates that you compose into an agent's system prompt. Each block can contain plain text, template variables, and display conditions. Non-technical team members can edit prompt content, test different phrasings, and publish changes. Every edit is versioned, so you can compare prompt variations, roll back, and track what changed over time. You can create and manage prompt blocks through the Studio UI or programmatically through the server API, then reference them across multiple agents.
|
|
4
|
+
|
|
5
|
+
## Quickstart
|
|
6
|
+
|
|
7
|
+
1. Go to the **Prompts** tab in Studio.
|
|
8
|
+
2. Select **Create prompt** and enter a name and your instruction text.
|
|
9
|
+
3. Save the prompt block and publish it.
|
|
10
|
+
4. Open an agent's **Instructions** section and select **Add block**.
|
|
11
|
+
5. Pick the saved prompt block from the block picker dialog.
|
|
12
|
+
|
|
13
|
+
The block appears as a reference in the agent's instruction list. Changes to the original prompt block update every agent that references it.
|
|
14
|
+
|
|
15
|
+
## Block types
|
|
16
|
+
|
|
17
|
+
An agent's instructions are made up of an ordered list of blocks. Each block is one of three types:
|
|
18
|
+
|
|
19
|
+
| Type | Description |
|
|
20
|
+
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
|
|
21
|
+
| Inline text | Free-form text written directly in the agent's instruction list. Lives only on that agent. |
|
|
22
|
+
| Prompt block | A standalone block with its own content, stored in the agent snapshot. You can save an inline block as a prompt block to reuse it. |
|
|
23
|
+
| Prompt block reference | A pointer to a saved prompt block. The content is resolved at runtime from the referenced block. |
|
|
24
|
+
|
|
25
|
+
To turn an inline block into a reusable prompt block, open the block's menu and select **Save as prompt block**. To reference an existing prompt block, select **Add block** and pick one from the dialog.
|
|
26
|
+
|
|
27
|
+
## Template variables
|
|
28
|
+
|
|
29
|
+
Prompt blocks support `{{variable}}` syntax for dynamic content. Variables are resolved at runtime from the agent's variables and request context.
|
|
30
|
+
|
|
31
|
+
```text
|
|
32
|
+
You are helping {{userName}} with their {{task || 'request'}}.
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
| Syntax | Behavior |
|
|
36
|
+
| ----------------------------- | ------------------------------------------------------------------------------------------- |
|
|
37
|
+
| `{{variableName}}` | Replaced with the variable value. Left as-is if not found. |
|
|
38
|
+
| `{{nested.path.value}}` | Resolves dot-notation paths in the context object. |
|
|
39
|
+
| `{{variable \|\| 'default'}}` | Uses the fallback value when the variable is missing. Single or double quotes are accepted. |
|
|
40
|
+
|
|
41
|
+
Variables are passed through the agent's `variables` configuration or through [request context](https://mastra.ai/docs/server/request-context).
|
|
42
|
+
|
|
43
|
+
## Display conditions
|
|
44
|
+
|
|
45
|
+
Each block can have a **display condition**. A rule group that controls whether the block is included in the final prompt. Conditions are evaluated at runtime against the agent's variables and request context.
|
|
46
|
+
|
|
47
|
+
A rule group uses **AND** or **OR** logic with one or more conditions. Each condition checks a context field against a value using an operator:
|
|
48
|
+
|
|
49
|
+
| Operator | Description |
|
|
50
|
+
| ---------------------------------------------- | ------------------------------------- |
|
|
51
|
+
| `equals` / `not_equals` | Exact match comparison. |
|
|
52
|
+
| `contains` / `not_contains` | String inclusion or array membership. |
|
|
53
|
+
| `greater_than` / `less_than` | Numeric comparison. |
|
|
54
|
+
| `greater_than_or_equal` / `less_than_or_equal` | Numeric comparison with equality. |
|
|
55
|
+
| `in` / `not_in` | Checks if a value is in an array. |
|
|
56
|
+
| `exists` / `not_exists` | Checks if the field is present. |
|
|
57
|
+
|
|
58
|
+
Rule groups can be nested, so you can combine AND and OR conditions for complex logic.
|
|
59
|
+
|
|
60
|
+
In the Studio, open a block's **Display conditions** panel to set up rules visually. You can also configure conditions programmatically through the API. Blocks without conditions are always included.
|
|
61
|
+
|
|
62
|
+
## Versioning
|
|
63
|
+
|
|
64
|
+
Prompt blocks follow the same [versioning lifecycle](https://mastra.ai/docs/editor/overview) as agents. Each prompt block has a draft that you can edit and publish as a versioned snapshot. This means prompt content can be versioned and rolled back independently from the agent that uses it.
|
|
65
|
+
|
|
66
|
+
When an agent references a prompt block, the resolved content comes from the block's active published version by default. During editing, draft content is used for previews. This separation makes it safe for non-technical team members to experiment with prompt wording. The published version stays stable until they explicitly activate a new one.
|
|
67
|
+
|
|
68
|
+
## Related
|
|
69
|
+
|
|
70
|
+
- [Editor overview](https://mastra.ai/docs/editor/overview): Setup and versioning.
|
|
71
|
+
- [MastraEditor reference](https://mastra.ai/reference/editor/mastra-editor): Full configuration options for the editor.
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# Tools
|
|
2
|
+
|
|
3
|
+
The editor gives you three ways to add tools to agents:
|
|
4
|
+
|
|
5
|
+
- **Code tools**: Tools already registered in your Mastra instance.
|
|
6
|
+
- **Integration providers**: Third-party tool platforms like Composio and Arcade.
|
|
7
|
+
- **MCP clients**: Tools from MCP servers, configured as reusable client definitions.
|
|
8
|
+
|
|
9
|
+
You can manage all three sources through the Studio UI or programmatically through the server API. Non-technical team members can browse tool catalogs, add tools to agents, and test different tool combinations without code changes. Tool configurations are versioned alongside the rest of the agent, so you can roll back tool changes, compare versions, and experiment safely.
|
|
10
|
+
|
|
11
|
+
## Description overrides
|
|
12
|
+
|
|
13
|
+
Every tool, regardless of source, can have its description overridden at the agent level. This changes the description the agent sees during tool selection without modifying the original tool definition.
|
|
14
|
+
|
|
15
|
+
This is useful when you want to:
|
|
16
|
+
|
|
17
|
+
- Tailor a generic tool's purpose for a specific agent's context.
|
|
18
|
+
- Add instructions about when or how to use a tool.
|
|
19
|
+
- Clarify ambiguous tool descriptions.
|
|
20
|
+
|
|
21
|
+
In the Studio, select a tool in the agent's tool list and edit the **Description** field. The override applies only to that agent.
|
|
22
|
+
|
|
23
|
+
## Display conditions
|
|
24
|
+
|
|
25
|
+
Each tool in an agent can have display conditions — rule groups that control whether the tool is available at runtime. This uses the same rule system as [prompt blocks](https://mastra.ai/docs/editor/prompts).
|
|
26
|
+
|
|
27
|
+
When a request comes in, the editor evaluates each tool's rules against the current context (agent variables and request context). Tools whose conditions are not met are excluded from that run.
|
|
28
|
+
|
|
29
|
+
Use display conditions to:
|
|
30
|
+
|
|
31
|
+
- Restrict expensive tools to specific users or roles.
|
|
32
|
+
- Enable tools based on feature flags or environment variables.
|
|
33
|
+
- Conditionally include tools based on the conversation context.
|
|
34
|
+
|
|
35
|
+
Tools without display conditions are always available.
|
|
36
|
+
|
|
37
|
+
## Studio
|
|
38
|
+
|
|
39
|
+
Go to the **Agents** tab in Studio and select an agent to edit. Select the **Editor** tab. Scroll to the **Tools** section.
|
|
40
|
+
|
|
41
|
+
Here you are able to add tools and configure MCP clients.
|
|
42
|
+
|
|
43
|
+
Once you've made the changes, be sure to save the agent configuration.
|
|
44
|
+
|
|
45
|
+
## Integration providers
|
|
46
|
+
|
|
47
|
+
Integration providers connect external tool platforms to the editor. Once registered, you can browse available tools in the Studio and add them to any agent.
|
|
48
|
+
|
|
49
|
+
### Composio
|
|
50
|
+
|
|
51
|
+
[Composio](https://composio.dev) gives access to hundreds of integration tools organized into toolkits (GitHub, Slack, Gmail, and others).
|
|
52
|
+
|
|
53
|
+
1. Get an API key from your Composio dashboard.
|
|
54
|
+
|
|
55
|
+
2. Register the provider in your Editor configuration:
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
import { Mastra } from '@mastra/core'
|
|
59
|
+
import { MastraEditor } from '@mastra/editor'
|
|
60
|
+
import { ComposioToolProvider } from '@mastra/editor/providers/composio'
|
|
61
|
+
|
|
62
|
+
export const mastra = new Mastra({
|
|
63
|
+
agents: {
|
|
64
|
+
/* your agents */
|
|
65
|
+
},
|
|
66
|
+
editor: new MastraEditor({
|
|
67
|
+
toolProviders: {
|
|
68
|
+
composio: new ComposioToolProvider({
|
|
69
|
+
apiKey: process.env.COMPOSIO_API_KEY!,
|
|
70
|
+
}),
|
|
71
|
+
},
|
|
72
|
+
}),
|
|
73
|
+
})
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Composio tool slugs use a format like `GITHUB_CREATE_ISSUE`. Tool calls are scoped to a `userId` passed through request context for per-user authentication.
|
|
77
|
+
|
|
78
|
+
### Arcade
|
|
79
|
+
|
|
80
|
+
[Arcade](https://arcade.dev) provides a curated catalog of tools with built-in authentication handling.
|
|
81
|
+
|
|
82
|
+
1. Get an API key from your Arcade dashboard.
|
|
83
|
+
|
|
84
|
+
2. Register the provider in your Editor configuration:
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
import { Mastra } from '@mastra/core'
|
|
88
|
+
import { MastraEditor } from '@mastra/editor'
|
|
89
|
+
import { ArcadeToolProvider } from '@mastra/editor/providers/arcade'
|
|
90
|
+
|
|
91
|
+
export const mastra = new Mastra({
|
|
92
|
+
agents: {
|
|
93
|
+
/* your agents */
|
|
94
|
+
},
|
|
95
|
+
editor: new MastraEditor({
|
|
96
|
+
toolProviders: {
|
|
97
|
+
arcade: new ArcadeToolProvider({
|
|
98
|
+
apiKey: process.env.ARCADE_API_KEY!,
|
|
99
|
+
}),
|
|
100
|
+
},
|
|
101
|
+
}),
|
|
102
|
+
})
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Arcade tools use a `Toolkit.ToolName` format (for example, `Github.GetRepository`). The provider pre-seeds common toolkits to reduce API calls during browsing.
|
|
106
|
+
|
|
107
|
+
## MCP clients
|
|
108
|
+
|
|
109
|
+
The editor lets you create stored MCP client configurations that connect to MCP servers. Once created, you can reference these clients in any agent to give it access to the server's tools.
|
|
110
|
+
|
|
111
|
+
### Transport types
|
|
112
|
+
|
|
113
|
+
Stored MCP clients support two transport types:
|
|
114
|
+
|
|
115
|
+
| Transport | Description |
|
|
116
|
+
| --------- | ----------------------------------------------------------------------------------------------------------------- |
|
|
117
|
+
| **stdio** | Launches a local process and communicates over standard I/O. Specify the `command` and optional `args` and `env`. |
|
|
118
|
+
| **HTTP** | Connects to a remote MCP server over HTTP. Specify the server `url` and optional `headers`. |
|
|
119
|
+
|
|
120
|
+
### Tool filtering
|
|
121
|
+
|
|
122
|
+
You can filter MCP tools at two levels:
|
|
123
|
+
|
|
124
|
+
1. **Client level**: On the MCP client itself, specify which tools from the server to include or exclude. This applies to every agent that references the client.
|
|
125
|
+
2. **Agent level**: On the agent's MCP client reference, further limit which tools are available. This lets you use the same MCP client in multiple agents while exposing different tool subsets.
|
|
126
|
+
|
|
127
|
+
### Tool namespacing
|
|
128
|
+
|
|
129
|
+
Tools from MCP servers are namespaced as `serverName_toolName` to avoid conflicts. For example, a tool called `search` from a server named `docs` becomes `docs_search`.
|
|
130
|
+
|
|
131
|
+
### Conditional activation
|
|
132
|
+
|
|
133
|
+
MCP client references in an agent can have display conditions, just like [prompt blocks](https://mastra.ai/docs/editor/prompts). This lets you conditionally include MCP tools based on request context or agent variables.
|
|
134
|
+
|
|
135
|
+
## How tools are merged
|
|
136
|
+
|
|
137
|
+
When an agent runs, tools from all sources are merged in this order:
|
|
138
|
+
|
|
139
|
+
1. Code tools
|
|
140
|
+
2. Integration tools
|
|
141
|
+
3. MCP tools
|
|
142
|
+
|
|
143
|
+
If a tool ID exists in multiple sources, later sources take precedence. Description overrides set at the agent level always take priority over the original tool description.
|
|
144
|
+
|
|
145
|
+
> **Note:** See the [ToolProvider reference](https://mastra.ai/reference/editor/tool-provider) for the full provider API.
|
|
146
|
+
|
|
147
|
+
## Related
|
|
148
|
+
|
|
149
|
+
- [Editor overview](https://mastra.ai/docs/editor/overview): Setup and versioning.
|
|
150
|
+
- [Prompts](https://mastra.ai/docs/editor/prompts): Display conditions reference for prompt blocks.
|
|
151
|
+
- [ToolProvider reference](https://mastra.ai/reference/editor/tool-provider): Composio and Arcade API details.
|
|
152
|
+
- [MCP overview](https://mastra.ai/docs/mcp/overview): General MCP documentation.
|
|
@@ -49,6 +49,8 @@ Chat with your agent directly, dynamically switch [models](https://mastra.ai/mod
|
|
|
49
49
|
|
|
50
50
|
When you interact with your agent, you can follow each step of its reasoning, view tool call outputs, and [observe](#observability) traces and logs to see how responses are generated. You can also attach [scorers](#scorers) to measure and compare response quality over time.
|
|
51
51
|
|
|
52
|
+
Use [Editor](https://mastra.ai/docs/editor/overview) to let non-technical team members iterate on agents, version every change, and run experiments without redeploying.
|
|
53
|
+
|
|
52
54
|
### Workflows
|
|
53
55
|
|
|
54
56
|
Visualize your workflow as a graph and run it step by step with a custom input. During execution, the interface updates in real time to show the active step and the path taken.
|
package/.docs/models/index.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Model Providers
|
|
2
2
|
|
|
3
|
-
Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to
|
|
3
|
+
Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to 3584 models from 99 providers through a single API.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Chutes
|
|
2
2
|
|
|
3
|
-
Access
|
|
3
|
+
Access 69 Chutes models through Mastra's model router. Authentication is handled automatically using the `CHUTES_API_KEY` environment variable.
|
|
4
4
|
|
|
5
5
|
Learn more in the [Chutes documentation](https://llm.chutes.ai).
|
|
6
6
|
|
|
@@ -102,6 +102,7 @@ for await (const chunk of stream) {
|
|
|
102
102
|
| `chutes/zai-org/GLM-4.7-TEE` | 203K | | | | | | $0.40 | $2 |
|
|
103
103
|
| `chutes/zai-org/GLM-5-TEE` | 203K | | | | | | $0.95 | $3 |
|
|
104
104
|
| `chutes/zai-org/GLM-5-Turbo` | 203K | | | | | | $0.49 | $2 |
|
|
105
|
+
| `chutes/zai-org/GLM-5.1-TEE` | 203K | | | | | | $0.95 | $3 |
|
|
105
106
|
|
|
106
107
|
## Advanced configuration
|
|
107
108
|
|
|
@@ -131,7 +132,7 @@ const agent = new Agent({
|
|
|
131
132
|
model: ({ requestContext }) => {
|
|
132
133
|
const useAdvanced = requestContext.task === "complex";
|
|
133
134
|
return useAdvanced
|
|
134
|
-
? "chutes/zai-org/GLM-5-
|
|
135
|
+
? "chutes/zai-org/GLM-5.1-TEE"
|
|
135
136
|
: "chutes/MiniMaxAI/MiniMax-M2.1-TEE";
|
|
136
137
|
}
|
|
137
138
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Cloudflare Workers AI
|
|
2
2
|
|
|
3
|
-
Access
|
|
3
|
+
Access 7 Cloudflare Workers AI models through Mastra's model router. Authentication is handled automatically using the `CLOUDFLARE_API_KEY` environment variable. Configure `CLOUDFLARE_ACCOUNT_ID` as well.
|
|
4
4
|
|
|
5
5
|
Learn more in the [Cloudflare Workers AI documentation](https://developers.cloudflare.com/workers-ai/models/).
|
|
6
6
|
|
|
@@ -16,7 +16,7 @@ const agent = new Agent({
|
|
|
16
16
|
id: "my-agent",
|
|
17
17
|
name: "My Agent",
|
|
18
18
|
instructions: "You are a helpful assistant",
|
|
19
|
-
model: "cloudflare-workers-ai/@cf/
|
|
19
|
+
model: "cloudflare-workers-ai/@cf/google/gemma-4-26b-a4b-it"
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
// Generate a response
|
|
@@ -33,50 +33,15 @@ for await (const chunk of stream) {
|
|
|
33
33
|
|
|
34
34
|
## Models
|
|
35
35
|
|
|
36
|
-
| Model
|
|
37
|
-
|
|
|
38
|
-
| `cloudflare-workers-ai/@cf/
|
|
39
|
-
| `cloudflare-workers-ai/@cf/
|
|
40
|
-
| `cloudflare-workers-ai/@cf/
|
|
41
|
-
| `cloudflare-workers-ai/@cf/
|
|
42
|
-
| `cloudflare-workers-ai/@cf/
|
|
43
|
-
| `cloudflare-workers-ai/@cf/
|
|
44
|
-
| `cloudflare-workers-ai/@cf/
|
|
45
|
-
| `cloudflare-workers-ai/@cf/deepgram/aura-2-en` | 128K | | | | | | — | — |
|
|
46
|
-
| `cloudflare-workers-ai/@cf/deepgram/aura-2-es` | 128K | | | | | | — | — |
|
|
47
|
-
| `cloudflare-workers-ai/@cf/deepgram/nova-3` | 128K | | | | | | — | — |
|
|
48
|
-
| `cloudflare-workers-ai/@cf/deepseek-ai/deepseek-r1-distill-qwen-32b` | 128K | | | | | | $0.50 | $5 |
|
|
49
|
-
| `cloudflare-workers-ai/@cf/facebook/bart-large-cnn` | 128K | | | | | | — | — |
|
|
50
|
-
| `cloudflare-workers-ai/@cf/google/gemma-3-12b-it` | 128K | | | | | | $0.35 | $0.56 |
|
|
51
|
-
| `cloudflare-workers-ai/@cf/huggingface/distilbert-sst-2-int8` | 128K | | | | | | $0.03 | — |
|
|
52
|
-
| `cloudflare-workers-ai/@cf/ibm-granite/granite-4.0-h-micro` | 128K | | | | | | $0.02 | $0.11 |
|
|
53
|
-
| `cloudflare-workers-ai/@cf/meta/llama-2-7b-chat-fp16` | 128K | | | | | | $0.56 | $7 |
|
|
54
|
-
| `cloudflare-workers-ai/@cf/meta/llama-3-8b-instruct` | 128K | | | | | | $0.28 | $0.83 |
|
|
55
|
-
| `cloudflare-workers-ai/@cf/meta/llama-3-8b-instruct-awq` | 128K | | | | | | $0.12 | $0.27 |
|
|
56
|
-
| `cloudflare-workers-ai/@cf/meta/llama-3.1-8b-instruct` | 128K | | | | | | $0.28 | $0.83 |
|
|
57
|
-
| `cloudflare-workers-ai/@cf/meta/llama-3.1-8b-instruct-awq` | 128K | | | | | | $0.12 | $0.27 |
|
|
58
|
-
| `cloudflare-workers-ai/@cf/meta/llama-3.1-8b-instruct-fp8` | 128K | | | | | | $0.15 | $0.29 |
|
|
59
|
-
| `cloudflare-workers-ai/@cf/meta/llama-3.2-11b-vision-instruct` | 128K | | | | | | $0.05 | $0.68 |
|
|
60
|
-
| `cloudflare-workers-ai/@cf/meta/llama-3.2-1b-instruct` | 128K | | | | | | $0.03 | $0.20 |
|
|
61
|
-
| `cloudflare-workers-ai/@cf/meta/llama-3.2-3b-instruct` | 128K | | | | | | $0.05 | $0.34 |
|
|
62
|
-
| `cloudflare-workers-ai/@cf/meta/llama-3.3-70b-instruct-fp8-fast` | 128K | | | | | | $0.29 | $2 |
|
|
63
|
-
| `cloudflare-workers-ai/@cf/meta/llama-4-scout-17b-16e-instruct` | 128K | | | | | | $0.27 | $0.85 |
|
|
64
|
-
| `cloudflare-workers-ai/@cf/meta/llama-guard-3-8b` | 128K | | | | | | $0.48 | $0.03 |
|
|
65
|
-
| `cloudflare-workers-ai/@cf/meta/m2m100-1.2b` | 128K | | | | | | $0.34 | $0.34 |
|
|
66
|
-
| `cloudflare-workers-ai/@cf/mistral/mistral-7b-instruct-v0.1` | 128K | | | | | | $0.11 | $0.19 |
|
|
67
|
-
| `cloudflare-workers-ai/@cf/mistralai/mistral-small-3.1-24b-instruct` | 128K | | | | | | $0.35 | $0.56 |
|
|
68
|
-
| `cloudflare-workers-ai/@cf/moonshotai/kimi-k2.5` | 256K | | | | | | $0.60 | $3 |
|
|
69
|
-
| `cloudflare-workers-ai/@cf/myshell-ai/melotts` | 128K | | | | | | — | — |
|
|
70
|
-
| `cloudflare-workers-ai/@cf/nvidia/nemotron-3-120b-a12b` | 256K | | | | | | $0.50 | $2 |
|
|
71
|
-
| `cloudflare-workers-ai/@cf/openai/gpt-oss-120b` | 128K | | | | | | $0.35 | $0.75 |
|
|
72
|
-
| `cloudflare-workers-ai/@cf/openai/gpt-oss-20b` | 128K | | | | | | $0.20 | $0.30 |
|
|
73
|
-
| `cloudflare-workers-ai/@cf/pfnet/plamo-embedding-1b` | 128K | | | | | | $0.02 | — |
|
|
74
|
-
| `cloudflare-workers-ai/@cf/pipecat-ai/smart-turn-v2` | 128K | | | | | | — | — |
|
|
75
|
-
| `cloudflare-workers-ai/@cf/qwen/qwen2.5-coder-32b-instruct` | 128K | | | | | | $0.66 | $1 |
|
|
76
|
-
| `cloudflare-workers-ai/@cf/qwen/qwen3-30b-a3b-fp8` | 128K | | | | | | $0.05 | $0.34 |
|
|
77
|
-
| `cloudflare-workers-ai/@cf/qwen/qwen3-embedding-0.6b` | 128K | | | | | | $0.01 | — |
|
|
78
|
-
| `cloudflare-workers-ai/@cf/qwen/qwq-32b` | 128K | | | | | | $0.66 | $1 |
|
|
79
|
-
| `cloudflare-workers-ai/@cf/zai-org/glm-4.7-flash` | 131K | | | | | | $0.06 | $0.40 |
|
|
36
|
+
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
37
|
+
| --------------------------------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
38
|
+
| `cloudflare-workers-ai/@cf/google/gemma-4-26b-a4b-it` | 256K | | | | | | $0.10 | $0.30 |
|
|
39
|
+
| `cloudflare-workers-ai/@cf/meta/llama-4-scout-17b-16e-instruct` | 128K | | | | | | $0.27 | $0.85 |
|
|
40
|
+
| `cloudflare-workers-ai/@cf/moonshotai/kimi-k2.5` | 256K | | | | | | $0.60 | $3 |
|
|
41
|
+
| `cloudflare-workers-ai/@cf/nvidia/nemotron-3-120b-a12b` | 256K | | | | | | $0.50 | $2 |
|
|
42
|
+
| `cloudflare-workers-ai/@cf/openai/gpt-oss-120b` | 128K | | | | | | $0.35 | $0.75 |
|
|
43
|
+
| `cloudflare-workers-ai/@cf/openai/gpt-oss-20b` | 128K | | | | | | $0.20 | $0.30 |
|
|
44
|
+
| `cloudflare-workers-ai/@cf/zai-org/glm-4.7-flash` | 131K | | | | | | $0.06 | $0.40 |
|
|
80
45
|
|
|
81
46
|
## Advanced configuration
|
|
82
47
|
|
|
@@ -88,7 +53,7 @@ const agent = new Agent({
|
|
|
88
53
|
name: "custom-agent",
|
|
89
54
|
model: {
|
|
90
55
|
url: "https://api.cloudflare.com/client/v4/accounts/${CLOUDFLARE_ACCOUNT_ID}/ai/v1",
|
|
91
|
-
id: "cloudflare-workers-ai/@cf/
|
|
56
|
+
id: "cloudflare-workers-ai/@cf/google/gemma-4-26b-a4b-it",
|
|
92
57
|
apiKey: process.env.CLOUDFLARE_API_KEY,
|
|
93
58
|
headers: {
|
|
94
59
|
"X-Custom-Header": "value"
|
|
@@ -107,7 +72,7 @@ const agent = new Agent({
|
|
|
107
72
|
const useAdvanced = requestContext.task === "complex";
|
|
108
73
|
return useAdvanced
|
|
109
74
|
? "cloudflare-workers-ai/@cf/zai-org/glm-4.7-flash"
|
|
110
|
-
: "cloudflare-workers-ai/@cf/
|
|
75
|
+
: "cloudflare-workers-ai/@cf/google/gemma-4-26b-a4b-it";
|
|
111
76
|
}
|
|
112
77
|
});
|
|
113
78
|
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Friendli
|
|
2
2
|
|
|
3
|
-
Access
|
|
3
|
+
Access 6 Friendli models through Mastra's model router. Authentication is handled automatically using the `FRIENDLI_TOKEN` environment variable.
|
|
4
4
|
|
|
5
5
|
Learn more in the [Friendli documentation](https://friendli.ai/docs/guides/serverless_endpoints/introduction).
|
|
6
6
|
|
|
@@ -15,7 +15,7 @@ const agent = new Agent({
|
|
|
15
15
|
id: "my-agent",
|
|
16
16
|
name: "My Agent",
|
|
17
17
|
instructions: "You are a helpful assistant",
|
|
18
|
-
model: "friendli/MiniMaxAI/MiniMax-M2.
|
|
18
|
+
model: "friendli/MiniMaxAI/MiniMax-M2.5"
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
// Generate a response
|
|
@@ -36,11 +36,10 @@ for await (const chunk of stream) {
|
|
|
36
36
|
| --------------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
37
37
|
| `friendli/meta-llama/Llama-3.1-8B-Instruct` | 131K | | | | | | $0.10 | $0.10 |
|
|
38
38
|
| `friendli/meta-llama/Llama-3.3-70B-Instruct` | 131K | | | | | | $0.60 | $0.60 |
|
|
39
|
-
| `friendli/MiniMaxAI/MiniMax-M2.1` | 197K | | | | | | $0.30 | $1 |
|
|
40
39
|
| `friendli/MiniMaxAI/MiniMax-M2.5` | 197K | | | | | | $0.30 | $1 |
|
|
41
40
|
| `friendli/Qwen/Qwen3-235B-A22B-Instruct-2507` | 262K | | | | | | $0.20 | $0.80 |
|
|
42
|
-
| `friendli/zai-org/GLM-4.7` | 203K | | | | | | — | — |
|
|
43
41
|
| `friendli/zai-org/GLM-5` | 203K | | | | | | $1 | $3 |
|
|
42
|
+
| `friendli/zai-org/GLM-5.1` | 203K | | | | | | $1 | $4 |
|
|
44
43
|
|
|
45
44
|
## Advanced configuration
|
|
46
45
|
|
|
@@ -52,7 +51,7 @@ const agent = new Agent({
|
|
|
52
51
|
name: "custom-agent",
|
|
53
52
|
model: {
|
|
54
53
|
url: "https://api.friendli.ai/serverless/v1",
|
|
55
|
-
id: "friendli/MiniMaxAI/MiniMax-M2.
|
|
54
|
+
id: "friendli/MiniMaxAI/MiniMax-M2.5",
|
|
56
55
|
apiKey: process.env.FRIENDLI_TOKEN,
|
|
57
56
|
headers: {
|
|
58
57
|
"X-Custom-Header": "value"
|
|
@@ -70,8 +69,8 @@ const agent = new Agent({
|
|
|
70
69
|
model: ({ requestContext }) => {
|
|
71
70
|
const useAdvanced = requestContext.task === "complex";
|
|
72
71
|
return useAdvanced
|
|
73
|
-
? "friendli/zai-org/GLM-5"
|
|
74
|
-
: "friendli/MiniMaxAI/MiniMax-M2.
|
|
72
|
+
? "friendli/zai-org/GLM-5.1"
|
|
73
|
+
: "friendli/MiniMaxAI/MiniMax-M2.5";
|
|
75
74
|
}
|
|
76
75
|
});
|
|
77
76
|
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# OpenCode Go
|
|
2
2
|
|
|
3
|
-
Access
|
|
3
|
+
Access 7 OpenCode Go models through Mastra's model router. Authentication is handled automatically using the `OPENCODE_API_KEY` environment variable.
|
|
4
4
|
|
|
5
5
|
Learn more in the [OpenCode Go documentation](https://opencode.ai/docs/zen).
|
|
6
6
|
|
|
@@ -35,6 +35,7 @@ for await (const chunk of stream) {
|
|
|
35
35
|
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
36
36
|
| -------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
37
37
|
| `opencode-go/glm-5` | 205K | | | | | | $1 | $3 |
|
|
38
|
+
| `opencode-go/glm-5.1` | 205K | | | | | | $1 | $4 |
|
|
38
39
|
| `opencode-go/kimi-k2.5` | 262K | | | | | | $0.60 | $3 |
|
|
39
40
|
| `opencode-go/mimo-v2-omni` | 262K | | | | | | $0.40 | $2 |
|
|
40
41
|
| `opencode-go/mimo-v2-pro` | 1.0M | | | | | | $1 | $3 |
|
|
@@ -46,6 +46,7 @@ for await (const chunk of stream) {
|
|
|
46
46
|
| `opencode/gemini-3-flash` | 1.0M | | | | | | $0.50 | $3 |
|
|
47
47
|
| `opencode/gemini-3.1-pro` | 1.0M | | | | | | $2 | $12 |
|
|
48
48
|
| `opencode/glm-5` | 205K | | | | | | $1 | $3 |
|
|
49
|
+
| `opencode/glm-5.1` | 205K | | | | | | $1 | $4 |
|
|
49
50
|
| `opencode/gpt-5` | 400K | | | | | | $1 | $9 |
|
|
50
51
|
| `opencode/gpt-5-codex` | 400K | | | | | | $1 | $9 |
|
|
51
52
|
| `opencode/gpt-5-nano` | 400K | | | | | | — | — |
|
|
@@ -65,7 +66,6 @@ for await (const chunk of stream) {
|
|
|
65
66
|
| `opencode/minimax-m2.5` | 205K | | | | | | $0.30 | $1 |
|
|
66
67
|
| `opencode/minimax-m2.5-free` | 205K | | | | | | — | — |
|
|
67
68
|
| `opencode/nemotron-3-super-free` | 205K | | | | | | — | — |
|
|
68
|
-
| `opencode/qwen3.6-plus-free` | 1.0M | | | | | | — | — |
|
|
69
69
|
|
|
70
70
|
## Advanced configuration
|
|
71
71
|
|
|
@@ -95,7 +95,7 @@ const agent = new Agent({
|
|
|
95
95
|
model: ({ requestContext }) => {
|
|
96
96
|
const useAdvanced = requestContext.task === "complex";
|
|
97
97
|
return useAdvanced
|
|
98
|
-
? "opencode/
|
|
98
|
+
? "opencode/nemotron-3-super-free"
|
|
99
99
|
: "opencode/big-pickle";
|
|
100
100
|
}
|
|
101
101
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Poe
|
|
2
2
|
|
|
3
|
-
Access
|
|
3
|
+
Access 127 Poe models through Mastra's model router. Authentication is handled automatically using the `POE_API_KEY` environment variable.
|
|
4
4
|
|
|
5
5
|
Learn more in the [Poe documentation](https://creator.poe.com/docs/external-applications/openai-compatible-api).
|
|
6
6
|
|
|
@@ -66,6 +66,7 @@ for await (const chunk of stream) {
|
|
|
66
66
|
| `poe/google/gemini-3.1-flash-lite` | 1.0M | | | | | | $0.25 | $2 |
|
|
67
67
|
| `poe/google/gemini-3.1-pro` | 1.0M | | | | | | $2 | $12 |
|
|
68
68
|
| `poe/google/gemini-deep-research` | 1.0M | | | | | | $2 | $10 |
|
|
69
|
+
| `poe/google/gemma-4-31b` | 262K | | | | | | — | — |
|
|
69
70
|
| `poe/google/imagen-3` | 480 | | | | | | — | — |
|
|
70
71
|
| `poe/google/imagen-3-fast` | 480 | | | | | | — | — |
|
|
71
72
|
| `poe/google/imagen-4` | 480 | | | | | | — | — |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Z.AI
|
|
2
2
|
|
|
3
|
-
Access
|
|
3
|
+
Access 13 Z.AI models through Mastra's model router. Authentication is handled automatically using the `ZHIPU_API_KEY` environment variable.
|
|
4
4
|
|
|
5
5
|
Learn more in the [Z.AI documentation](https://docs.z.ai/guides/overview/pricing).
|
|
6
6
|
|
|
@@ -45,6 +45,7 @@ for await (const chunk of stream) {
|
|
|
45
45
|
| `zai/glm-4.7-flashx` | 200K | | | | | | $0.07 | $0.40 |
|
|
46
46
|
| `zai/glm-5` | 205K | | | | | | $1 | $3 |
|
|
47
47
|
| `zai/glm-5-turbo` | 200K | | | | | | $1 | $4 |
|
|
48
|
+
| `zai/glm-5.1` | 200K | | | | | | $1 | $4 |
|
|
48
49
|
| `zai/glm-5v-turbo` | 200K | | | | | | $1 | $4 |
|
|
49
50
|
|
|
50
51
|
## Advanced configuration
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ZenMux
|
|
2
2
|
|
|
3
|
-
Access
|
|
3
|
+
Access 87 ZenMux models through Mastra's model router. Authentication is handled automatically using the `ZENMUX_API_KEY` environment variable.
|
|
4
4
|
|
|
5
5
|
Learn more in the [ZenMux documentation](https://docs.zenmux.ai).
|
|
6
6
|
|
|
@@ -119,6 +119,7 @@ for await (const chunk of stream) {
|
|
|
119
119
|
| `zenmux/z-ai/glm-4.7-flashx` | 200K | | | | | | $0.07 | $0.42 |
|
|
120
120
|
| `zenmux/z-ai/glm-5` | 200K | | | | | | $0.58 | $3 |
|
|
121
121
|
| `zenmux/z-ai/glm-5-turbo` | 200K | | | | | | $0.88 | $3 |
|
|
122
|
+
| `zenmux/z-ai/glm-5.1` | 200K | | | | | | $0.88 | $4 |
|
|
122
123
|
| `zenmux/z-ai/glm-5v-turbo` | 200K | | | | | | $0.73 | $3 |
|
|
123
124
|
|
|
124
125
|
## Advanced configuration
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Zhipu AI
|
|
2
2
|
|
|
3
|
-
Access
|
|
3
|
+
Access 12 Zhipu AI models through Mastra's model router. Authentication is handled automatically using the `ZHIPU_API_KEY` environment variable.
|
|
4
4
|
|
|
5
5
|
Learn more in the [Zhipu AI documentation](https://docs.z.ai/guides/overview/pricing).
|
|
6
6
|
|
|
@@ -44,6 +44,7 @@ for await (const chunk of stream) {
|
|
|
44
44
|
| `zhipuai/glm-4.7-flash` | 200K | | | | | | — | — |
|
|
45
45
|
| `zhipuai/glm-4.7-flashx` | 200K | | | | | | $0.07 | $0.40 |
|
|
46
46
|
| `zhipuai/glm-5` | 205K | | | | | | $1 | $3 |
|
|
47
|
+
| `zhipuai/glm-5.1` | 200K | | | | | | $6 | $24 |
|
|
47
48
|
| `zhipuai/glm-5v-turbo` | 200K | | | | | | $5 | $22 |
|
|
48
49
|
|
|
49
50
|
## Advanced configuration
|
|
@@ -439,4 +439,140 @@ Delete a stored agent:
|
|
|
439
439
|
```typescript
|
|
440
440
|
const result = await storedAgent.delete()
|
|
441
441
|
console.log(result.success) // true
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
## Version management
|
|
445
|
+
|
|
446
|
+
Both `Agent` (code-defined) and `StoredAgent` instances have methods for managing configuration versions. See the [Editor overview](https://mastra.ai/docs/editor/overview) for an introduction to version management.
|
|
447
|
+
|
|
448
|
+
### Server endpoints
|
|
449
|
+
|
|
450
|
+
Version management is also available through the stored agents REST API:
|
|
451
|
+
|
|
452
|
+
| Method | Endpoint | Description |
|
|
453
|
+
| -------- | ------------------------------------------------------------ | --------------------------------------- |
|
|
454
|
+
| `GET` | `/stored/agents/:agentId/versions` | List all versions. |
|
|
455
|
+
| `POST` | `/stored/agents/:agentId/versions` | Create a new version. |
|
|
456
|
+
| `GET` | `/stored/agents/:agentId/versions/:versionId` | Get a specific version. |
|
|
457
|
+
| `POST` | `/stored/agents/:agentId/versions/:versionId/activate` | Set the active version. |
|
|
458
|
+
| `POST` | `/stored/agents/:agentId/versions/:versionId/restore` | Restore a version (creates a new copy). |
|
|
459
|
+
| `DELETE` | `/stored/agents/:agentId/versions/:versionId` | Delete a version. |
|
|
460
|
+
| `GET` | `/stored/agents/:agentId/versions/compare?from=<id>&to=<id>` | Compare two versions. |
|
|
461
|
+
|
|
462
|
+
### Getting an agent with a specific version
|
|
463
|
+
|
|
464
|
+
Pass a version identifier when getting an agent:
|
|
465
|
+
|
|
466
|
+
```typescript
|
|
467
|
+
// Load the published version (default)
|
|
468
|
+
const agent = mastraClient.getAgent('support-agent')
|
|
469
|
+
|
|
470
|
+
// Load the latest draft
|
|
471
|
+
const draftAgent = mastraClient.getAgent('support-agent', { status: 'draft' })
|
|
472
|
+
|
|
473
|
+
// Load a specific version
|
|
474
|
+
const versionedAgent = mastraClient.getAgent('support-agent', { versionId: 'abc-123' })
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
For stored agents, pass a status option to `details()`:
|
|
478
|
+
|
|
479
|
+
```typescript
|
|
480
|
+
const storedAgent = mastraClient.getStoredAgent('my-agent')
|
|
481
|
+
const draft = await storedAgent.details(undefined, { status: 'draft' })
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
### `listVersions()`
|
|
485
|
+
|
|
486
|
+
List all versions for an agent:
|
|
487
|
+
|
|
488
|
+
```typescript
|
|
489
|
+
const versions = await agent.listVersions()
|
|
490
|
+
console.log(versions.items) // Array of version snapshots
|
|
491
|
+
console.log(versions.total)
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
With pagination and sorting:
|
|
495
|
+
|
|
496
|
+
```typescript
|
|
497
|
+
const versions = await agent.listVersions({
|
|
498
|
+
page: 0,
|
|
499
|
+
perPage: 10,
|
|
500
|
+
orderBy: {
|
|
501
|
+
field: 'createdAt',
|
|
502
|
+
direction: 'DESC',
|
|
503
|
+
},
|
|
504
|
+
})
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
### `createVersion()`
|
|
508
|
+
|
|
509
|
+
Create a new version snapshot:
|
|
510
|
+
|
|
511
|
+
```typescript
|
|
512
|
+
const version = await agent.createVersion({
|
|
513
|
+
changeMessage: 'Updated tone to be more friendly',
|
|
514
|
+
})
|
|
515
|
+
```
|
|
516
|
+
|
|
517
|
+
### `getVersion()`
|
|
518
|
+
|
|
519
|
+
Get a specific version by ID:
|
|
520
|
+
|
|
521
|
+
```typescript
|
|
522
|
+
const version = await agent.getVersion('version-123')
|
|
523
|
+
console.log(version.versionNumber)
|
|
524
|
+
console.log(version.changedFields)
|
|
525
|
+
console.log(version.createdAt)
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
### `activateVersion()`
|
|
529
|
+
|
|
530
|
+
Set a version as the active published version:
|
|
531
|
+
|
|
532
|
+
```typescript
|
|
533
|
+
await agent.activateVersion('version-123')
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
### `restoreVersion()`
|
|
537
|
+
|
|
538
|
+
Restore a previous version by creating a new version with the same configuration:
|
|
539
|
+
|
|
540
|
+
```typescript
|
|
541
|
+
await agent.restoreVersion('version-456')
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
### `deleteVersion()`
|
|
545
|
+
|
|
546
|
+
Delete a version:
|
|
547
|
+
|
|
548
|
+
```typescript
|
|
549
|
+
await agent.deleteVersion('version-789')
|
|
550
|
+
```
|
|
551
|
+
|
|
552
|
+
### `compareVersions()`
|
|
553
|
+
|
|
554
|
+
Compare two versions and return their differences:
|
|
555
|
+
|
|
556
|
+
```typescript
|
|
557
|
+
const diff = await agent.compareVersions('version-123', 'version-456')
|
|
558
|
+
console.log(diff.changes) // Fields that changed between versions
|
|
559
|
+
```
|
|
560
|
+
|
|
561
|
+
### React SDK
|
|
562
|
+
|
|
563
|
+
In the React SDK, pass an `agentVersionId` through `requestContext` when using the `useChat` hook:
|
|
564
|
+
|
|
565
|
+
```typescript
|
|
566
|
+
import { useChat } from '@mastra/react'
|
|
567
|
+
|
|
568
|
+
function Chat() {
|
|
569
|
+
const { messages, input, handleInputChange, handleSubmit } = useChat({
|
|
570
|
+
agentId: 'support-agent',
|
|
571
|
+
requestContext: {
|
|
572
|
+
agentVersionId: 'abc-123',
|
|
573
|
+
},
|
|
574
|
+
})
|
|
575
|
+
|
|
576
|
+
// ... render chat UI
|
|
577
|
+
}
|
|
442
578
|
```
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# MastraEditor class
|
|
2
|
+
|
|
3
|
+
The `MastraEditor` class sets up the editor system. Pass it to the `Mastra` constructor to turn on editor features like prompt blocks, agent code override, versioning, and tool providers.
|
|
4
|
+
|
|
5
|
+
See the [Editor overview](https://mastra.ai/docs/editor/overview) for an introduction to what the editor does.
|
|
6
|
+
|
|
7
|
+
## Usage example
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
import { Mastra } from '@mastra/core'
|
|
11
|
+
import { MastraEditor } from '@mastra/editor'
|
|
12
|
+
import { ComposioToolProvider } from '@mastra/editor/providers/composio'
|
|
13
|
+
|
|
14
|
+
export const mastra = new Mastra({
|
|
15
|
+
agents: {
|
|
16
|
+
/* your agents */
|
|
17
|
+
},
|
|
18
|
+
editor: new MastraEditor({
|
|
19
|
+
toolProviders: {
|
|
20
|
+
composio: new ComposioToolProvider({
|
|
21
|
+
apiKey: process.env.COMPOSIO_API_KEY!,
|
|
22
|
+
}),
|
|
23
|
+
},
|
|
24
|
+
}),
|
|
25
|
+
})
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Constructor parameters
|
|
29
|
+
|
|
30
|
+
**logger** (`Logger`): Logger instance. Falls back to the Mastra instance logger if not set.
|
|
31
|
+
|
|
32
|
+
**toolProviders** (`Record<string, ToolProvider>`): Integration tool providers keyed by ID (for example, Composio or Arcade). Lets agents use third-party tools added through the editor. (Default: `{}`)
|
|
33
|
+
|
|
34
|
+
**processorProviders** (`Record<string, ProcessorProvider>`): Processor providers for configurable input/output processing (for example, moderation or token limiting). Built-in providers are always included. (Default: `{}`)
|
|
35
|
+
|
|
36
|
+
**filesystems** (`Record<string, FilesystemProvider>`): Filesystem providers for file access (for example, S3 or GCS). A local filesystem provider is always included. (Default: `{}`)
|
|
37
|
+
|
|
38
|
+
**sandboxes** (`Record<string, SandboxProvider>`): Sandbox providers for code execution (for example, E2B). A local sandbox provider is always included. (Default: `{}`)
|
|
39
|
+
|
|
40
|
+
**blobStores** (`Record<string, BlobStoreProvider>`): Blob storage providers for binary data (for example, S3). Falls back to the Mastra storage blob store if no provider is specified. (Default: `{}`)
|
|
41
|
+
|
|
42
|
+
## Namespaces
|
|
43
|
+
|
|
44
|
+
The editor exposes namespaces for managing different entity types. These are used by the Mastra server and Studio — you don't call them directly in application code.
|
|
45
|
+
|
|
46
|
+
**agent** (`EditorAgentNamespace`): CRUD operations and version management for stored agents. Handles applying stored overrides to code-defined agents.
|
|
47
|
+
|
|
48
|
+
**prompt** (`EditorPromptNamespace`): CRUD operations for prompt blocks. Includes a preview method for resolving instruction blocks with draft content.
|
|
49
|
+
|
|
50
|
+
**mcp** (`EditorMCPNamespace`): CRUD operations for stored MCP client configurations.
|
|
51
|
+
|
|
52
|
+
**mcpServer** (`EditorMCPServerNamespace`): CRUD operations for MCP server configurations.
|
|
53
|
+
|
|
54
|
+
**scorer** (`EditorScorerNamespace`): CRUD operations for scorer configurations.
|
|
55
|
+
|
|
56
|
+
## Methods
|
|
57
|
+
|
|
58
|
+
### Provider access
|
|
59
|
+
|
|
60
|
+
#### `getToolProvider(id)`
|
|
61
|
+
|
|
62
|
+
Returns a registered tool provider by its ID.
|
|
63
|
+
|
|
64
|
+
```typescript
|
|
65
|
+
const composio = mastra.getEditor()?.getToolProvider('composio')
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
#### `getToolProviders()`
|
|
69
|
+
|
|
70
|
+
Returns all registered tool providers as a `Record<string, ToolProvider>`.
|
|
71
|
+
|
|
72
|
+
#### `getProcessorProvider(id)`
|
|
73
|
+
|
|
74
|
+
Returns a registered processor provider by its ID.
|
|
75
|
+
|
|
76
|
+
#### `getProcessorProviders()`
|
|
77
|
+
|
|
78
|
+
Returns all registered processor providers.
|
|
79
|
+
|
|
80
|
+
#### `getFilesystemProviders()`
|
|
81
|
+
|
|
82
|
+
Returns all registered filesystem providers.
|
|
83
|
+
|
|
84
|
+
#### `getSandboxProviders()`
|
|
85
|
+
|
|
86
|
+
Returns all registered sandbox providers.
|
|
87
|
+
|
|
88
|
+
#### `getBlobStoreProviders()`
|
|
89
|
+
|
|
90
|
+
Returns all registered blob store providers.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# ToolProvider
|
|
2
|
+
|
|
3
|
+
The `ToolProvider` interface defines how the editor discovers and resolves integration tools from external platforms. Mastra ships with two built-in implementations: `ComposioToolProvider` and `ArcadeToolProvider`.
|
|
4
|
+
|
|
5
|
+
See [Tools](https://mastra.ai/docs/editor/tools) for a guide on setting up tool providers.
|
|
6
|
+
|
|
7
|
+
## ToolProvider interface
|
|
8
|
+
|
|
9
|
+
Tool providers implement these methods:
|
|
10
|
+
|
|
11
|
+
**listToolkits()** (`() => Promise<Toolkit[]>`): Returns a list of available toolkits (tool categories) from the provider.
|
|
12
|
+
|
|
13
|
+
**listTools(params?)** (`(params?) => Promise<Tool[]>`): Returns a list of available tools. Accepts optional filtering by toolkit, search query, and limit.
|
|
14
|
+
|
|
15
|
+
**getToolSchema(slug)** (`(slug: string) => Promise<JSONSchema>`): Returns the JSON schema for a specific tool identified by its slug.
|
|
16
|
+
|
|
17
|
+
**resolveTools(slugs, options?)** (`(slugs: string[], options?) => Promise<Record<string, ToolAction>>`): Resolves tool slugs into executable Mastra tool actions. The options object can include userId for per-user authentication.
|
|
18
|
+
|
|
19
|
+
***
|
|
20
|
+
|
|
21
|
+
## ComposioToolProvider
|
|
22
|
+
|
|
23
|
+
Connects to [Composio](https://composio.dev) for access to hundreds of integration tools.
|
|
24
|
+
|
|
25
|
+
### Usage example
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
import { MastraEditor } from '@mastra/editor'
|
|
29
|
+
import { ComposioToolProvider } from '@mastra/editor/providers/composio'
|
|
30
|
+
|
|
31
|
+
const editor = new MastraEditor({
|
|
32
|
+
toolProviders: {
|
|
33
|
+
composio: new ComposioToolProvider({
|
|
34
|
+
apiKey: process.env.COMPOSIO_API_KEY!,
|
|
35
|
+
}),
|
|
36
|
+
},
|
|
37
|
+
})
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Constructor parameters
|
|
41
|
+
|
|
42
|
+
**apiKey** (`string`): Your Composio API key.
|
|
43
|
+
|
|
44
|
+
### Tool slugs
|
|
45
|
+
|
|
46
|
+
Composio tools use uppercase slug format: `GITHUB_CREATE_ISSUE`, `SLACK_SEND_MESSAGE`.
|
|
47
|
+
|
|
48
|
+
### Authentication
|
|
49
|
+
|
|
50
|
+
Tool execution is scoped to a `userId` passed through request context. Each user authenticates with the integration separately through Composio's auth flow.
|
|
51
|
+
|
|
52
|
+
***
|
|
53
|
+
|
|
54
|
+
## ArcadeToolProvider
|
|
55
|
+
|
|
56
|
+
Connects to [Arcade](https://arcade.dev) for a curated tool catalog with built-in authentication.
|
|
57
|
+
|
|
58
|
+
### Usage example
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
import { MastraEditor } from '@mastra/editor'
|
|
62
|
+
import { ArcadeToolProvider } from '@mastra/editor/providers/arcade'
|
|
63
|
+
|
|
64
|
+
const editor = new MastraEditor({
|
|
65
|
+
toolProviders: {
|
|
66
|
+
arcade: new ArcadeToolProvider({
|
|
67
|
+
apiKey: process.env.ARCADE_API_KEY!,
|
|
68
|
+
}),
|
|
69
|
+
},
|
|
70
|
+
})
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Constructor parameters
|
|
74
|
+
|
|
75
|
+
**apiKey** (`string`): Your Arcade API key.
|
|
76
|
+
|
|
77
|
+
**baseURL** (`string`): Custom base URL for the Arcade API.
|
|
78
|
+
|
|
79
|
+
### Tool slugs
|
|
80
|
+
|
|
81
|
+
Arcade tools use `Toolkit.ToolName` format: `Github.GetRepository`, `Slack.SendMessage`.
|
|
82
|
+
|
|
83
|
+
### Authentication
|
|
84
|
+
|
|
85
|
+
Like Composio, tool execution requires a `userId` for per-user authorization through Arcade's auth flow.
|
package/.docs/reference/index.md
CHANGED
|
@@ -91,6 +91,8 @@ The Reference section provides documentation of Mastra's API, including paramete
|
|
|
91
91
|
- [Deployer](https://mastra.ai/reference/deployer)
|
|
92
92
|
- [Netlify](https://mastra.ai/reference/deployer/netlify)
|
|
93
93
|
- [Vercel](https://mastra.ai/reference/deployer/vercel)
|
|
94
|
+
- [MastraEditor Class](https://mastra.ai/reference/editor/mastra-editor)
|
|
95
|
+
- [ToolProvider](https://mastra.ai/reference/editor/tool-provider)
|
|
94
96
|
- [createScorer()](https://mastra.ai/reference/evals/create-scorer)
|
|
95
97
|
- [MastraScorer](https://mastra.ai/reference/evals/mastra-scorer)
|
|
96
98
|
- [runEvals()](https://mastra.ai/reference/evals/run-evals)
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @mastra/mcp-docs-server
|
|
2
2
|
|
|
3
|
+
## 1.1.23
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`8db7663`](https://github.com/mastra-ai/mastra/commit/8db7663c9a9c735828094c359d2e327fd4f8fba3), [`153e864`](https://github.com/mastra-ai/mastra/commit/153e86476b425db7cd0dc8490050096e92964a38), [`715710d`](https://github.com/mastra-ai/mastra/commit/715710d12fa47cf88e09d41f13843eddc29327b0), [`378c6c4`](https://github.com/mastra-ai/mastra/commit/378c6c4755726e8d8cf83a14809b350b90d46c62), [`9f91fd5`](https://github.com/mastra-ai/mastra/commit/9f91fd538ab2a44f8cc740bcad8e51205f74fbea), [`ba6fa9c`](https://github.com/mastra-ai/mastra/commit/ba6fa9cc0f3e1912c49fd70d4c3bb8c44903ddaa), [`98209a0`](https://github.com/mastra-ai/mastra/commit/98209a03c35c5479c25cca26ee0c63eff81e6d74), [`2bdb5fd`](https://github.com/mastra-ai/mastra/commit/2bdb5fd887bfd81bdb71c4a5db22a4fda99f2591)]:
|
|
8
|
+
- @mastra/core@1.24.0
|
|
9
|
+
- @mastra/mcp@1.4.2
|
|
10
|
+
|
|
3
11
|
## 1.1.23-alpha.3
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/mcp-docs-server",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.24-alpha.0",
|
|
4
4
|
"description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"jsdom": "^26.1.0",
|
|
30
30
|
"local-pkg": "^1.1.2",
|
|
31
31
|
"zod": "^4.3.6",
|
|
32
|
-
"@mastra/core": "1.24.0
|
|
33
|
-
"@mastra/mcp": "^1.4.2
|
|
32
|
+
"@mastra/core": "1.24.0",
|
|
33
|
+
"@mastra/mcp": "^1.4.2"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@hono/node-server": "^1.19.11",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"tsx": "^4.21.0",
|
|
47
47
|
"typescript": "^5.9.3",
|
|
48
48
|
"vitest": "4.0.18",
|
|
49
|
-
"@internal/lint": "0.0.
|
|
50
|
-
"@mastra/core": "1.24.0
|
|
51
|
-
"@internal/types-builder": "0.0.
|
|
49
|
+
"@internal/lint": "0.0.81",
|
|
50
|
+
"@mastra/core": "1.24.0",
|
|
51
|
+
"@internal/types-builder": "0.0.56"
|
|
52
52
|
},
|
|
53
53
|
"homepage": "https://mastra.ai",
|
|
54
54
|
"repository": {
|