@mastra/mcp-docs-server 1.2.8-alpha.19 → 1.2.8-alpha.23
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/getting-started/build-with-ai.md +2 -6
- package/.docs/docs/getting-started/manual-install.md +1 -1
- package/.docs/docs/long-running-agents/goals.md +3 -1
- package/.docs/docs/mastra-platform/observability.md +4 -12
- package/.docs/docs/mastra-platform/workspace.md +7 -7
- package/.docs/docs/observability/feedback.md +4 -0
- package/.docs/docs/server/auth/fga.md +40 -0
- package/.docs/guides/getting-started/quickstart.md +40 -25
- package/.docs/guides/index.md +1 -1
- package/.docs/models/environment-variables.md +2 -0
- package/.docs/models/gateways/netlify.md +3 -1
- package/.docs/models/gateways/openrouter.md +5 -2
- package/.docs/models/gateways/vercel.md +3 -1
- package/.docs/models/index.md +1 -1
- package/.docs/models/providers/aki-io.md +78 -0
- package/.docs/models/providers/cline-pass.md +82 -0
- package/.docs/models/providers/deepseek.md +3 -1
- package/.docs/models/providers/google.md +4 -2
- package/.docs/models/providers/inferx.md +3 -3
- package/.docs/models/providers/llmgateway.md +3 -1
- package/.docs/models/providers/opencode.md +4 -2
- package/.docs/models/providers/wandb.md +2 -1
- package/.docs/models/providers.md +2 -0
- package/.docs/reference/cli/create-mastra.md +118 -43
- package/.docs/reference/cli/mastra.md +34 -0
- package/.docs/reference/code-sdk/mount-agent-controller.md +3 -1
- package/.docs/reference/observability/tracing/exporters/posthog.md +39 -1
- package/.docs/reference/templates/overview.md +6 -32
- package/.docs/reference/workspace/platform-filesystem.md +2 -2
- package/.docs/reference/workspace/platform-sandbox.md +2 -2
- package/.docs/reference/workspace/railway-sandbox.md +37 -1
- package/CHANGELOG.md +14 -0
- package/package.json +5 -5
|
@@ -142,13 +142,9 @@ If you're unable to use a local MCP server and need to connect to a remote serve
|
|
|
142
142
|
|
|
143
143
|
### Installation
|
|
144
144
|
|
|
145
|
-
|
|
145
|
+
The [`create-mastra`](https://mastra.ai/reference/cli/create-mastra) command installs Mastra skills automatically. It doesn't configure the MCP docs server. Add the server manually when you need MCP-specific tools such as the migration tool.
|
|
146
146
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
#### Manual setup
|
|
150
|
-
|
|
151
|
-
If there are no specific instructions for your tool below, you may be able to add the MCP server with this common JSON configuration anyways.
|
|
147
|
+
If there are no specific instructions for your tool below, you may be able to add the MCP server with this common JSON configuration.
|
|
152
148
|
|
|
153
149
|
```json
|
|
154
150
|
{
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
**For AI agents:** Use this guide when tasked to create a runnable Mastra project from scratch without a CLI/boilerplate. It provides code examples for agents, tools, model configuration and how to install dependencies. Do not navigate to the quickstart guide, which is for humans. The model string is Mastra's model router format ('provider/model'; use / and not : to separate provider and model). Do not install any ai-sdk packages.
|
|
6
6
|
|
|
7
|
-
Use this guide to manually build a standalone Mastra server step by step. In most cases, it's quicker to follow the [quickstart guide](https://mastra.ai/guides/getting-started/quickstart), which achieves the same result using the [`mastra
|
|
7
|
+
Use this guide to manually build a standalone Mastra server step by step. In most cases, it's quicker to follow the [quickstart guide](https://mastra.ai/guides/getting-started/quickstart), which achieves the same result using the [`create-mastra`](https://mastra.ai/reference/cli/create-mastra) command. For existing projects, you can also use [`mastra init`](https://mastra.ai/reference/cli/mastra).
|
|
8
8
|
|
|
9
9
|
## Instructions
|
|
10
10
|
|
|
@@ -59,7 +59,7 @@ A goal step runs inside the agentic execution loop, right after `isTaskComplete`
|
|
|
59
59
|
|
|
60
60
|
- **Not satisfied, budget remaining** → the loop continues; per-evaluation feedback is injected so the agent iterates.
|
|
61
61
|
- **Satisfied** → the loop stops and the objective is marked `done`.
|
|
62
|
-
- **Budget exhausted** (`runsUsed >= maxRuns`) → the loop stops
|
|
62
|
+
- **Budget exhausted** (`runsUsed >= maxRuns`) → the loop stops and the objective is marked `paused`. Raise `maxRuns`, then resume the objective to continue.
|
|
63
63
|
|
|
64
64
|
The step is a no-op for background-task, mid-tool-loop, and working-memory-only iterations — the same gating as `isTaskComplete`.
|
|
65
65
|
|
|
@@ -103,6 +103,8 @@ await worker.updateObjectiveOptions({ threadId, maxRuns: 100 })
|
|
|
103
103
|
await worker.clearObjective({ threadId })
|
|
104
104
|
```
|
|
105
105
|
|
|
106
|
+
Objective records include an optional `activeDurationMs` value for user interfaces that display active pursuit time. Mastra advances this value while an agent runs toward an active objective and checkpoints it when the run ends or waits for tool approval. Missing values represent zero, and the duration measures agent execution rather than the goal's wall-clock age.
|
|
107
|
+
|
|
106
108
|
Per-objective values written by `setObjective` / `updateObjectiveOptions` take precedence over the agent's `goal` config, and that precedence is remembered in thread state. See the [`GoalEvaluationPayload` in the ChunkType reference](https://mastra.ai/reference/streaming/ChunkType) for the full goal chunk shape.
|
|
107
109
|
|
|
108
110
|
## Related
|
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
Observability on Mastra platform is a standalone hosted product for searchable traces, logs, and metrics across Mastra projects and deploys. Use it when you want observability without deploying Studio first or setting up local storage.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Use `mastra init` to configure platform observability while adding Mastra to an existing application, or configure it manually in a newly created Mastra project.
|
|
8
8
|
|
|
9
9
|
## Quickstart
|
|
10
10
|
|
|
11
|
-
Choose the setup path that matches your project.
|
|
11
|
+
Choose the setup path that matches your project.
|
|
12
12
|
|
|
13
13
|
### New project
|
|
14
14
|
|
|
15
|
-
Create a
|
|
15
|
+
Create a managed Mastra project. When prompted, opt into Mastra Platform Observability to configure it automatically:
|
|
16
16
|
|
|
17
17
|
**npm**:
|
|
18
18
|
|
|
@@ -38,15 +38,7 @@ yarn create mastra
|
|
|
38
38
|
bunx create-mastra
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
When
|
|
42
|
-
|
|
43
|
-
```bash
|
|
44
|
-
Enable Mastra Observability? (will open auth flow)
|
|
45
|
-
|
|
46
|
-
> Yes
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
The CLI authenticates with Mastra platform, creates a platform project, writes the required environment variables, and configures the observability exporters.
|
|
41
|
+
When you select observability, the create command authenticates with Mastra Platform, provisions a platform project, and writes the credentials to your project. If you skip platform setup or use a prompt-free creation flow, follow the [manual setup](#manual-setup) steps instead.
|
|
50
42
|
|
|
51
43
|
### Existing non-Mastra projects
|
|
52
44
|
|
|
@@ -72,12 +72,12 @@ export const mastra = new Mastra({
|
|
|
72
72
|
|
|
73
73
|
Every deploy that runs on a platform environment with a workspace receives these variables:
|
|
74
74
|
|
|
75
|
-
| Variable
|
|
76
|
-
|
|
|
77
|
-
| `
|
|
78
|
-
| `MASTRA_PROJECT_ID`
|
|
79
|
-
| `MASTRA_ENVIRONMENT_ID`
|
|
80
|
-
| `MASTRA_PLATFORM_BUCKET_NAME`
|
|
75
|
+
| Variable | Contents |
|
|
76
|
+
| ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
77
|
+
| `MASTRA_PLATFORM_SECRET_KEY` | Secret key scoped to the deploy. Used by the workspace providers to authenticate. `MASTRA_PLATFORM_ACCESS_TOKEN` is also injected as a deprecated alias. |
|
|
78
|
+
| `MASTRA_PROJECT_ID` | Project the deploy belongs to. |
|
|
79
|
+
| `MASTRA_ENVIRONMENT_ID` | Environment the deploy belongs to. Selects which sandbox pool the platform uses. |
|
|
80
|
+
| `MASTRA_PLATFORM_BUCKET_NAME` | Bucket name attached to the environment. Selects which bucket `PlatformFilesystem` reads and writes. |
|
|
81
81
|
|
|
82
82
|
These names are reserved. If your project sets any of them explicitly, the platform-managed values take precedence.
|
|
83
83
|
|
|
@@ -86,7 +86,7 @@ These names are reserved. If your project sets any of them explicitly, the platf
|
|
|
86
86
|
Reuse the same providers locally by putting the four variables in your `.env` file. Get the values from your project's Workspaces tab:
|
|
87
87
|
|
|
88
88
|
```bash
|
|
89
|
-
|
|
89
|
+
MASTRA_PLATFORM_SECRET_KEY=your-secret-key
|
|
90
90
|
MASTRA_PROJECT_ID=your-project-id
|
|
91
91
|
MASTRA_ENVIRONMENT_ID=your-environment-id
|
|
92
92
|
MASTRA_PLATFORM_BUCKET_NAME=your-bucket-name
|
|
@@ -127,6 +127,10 @@ const ratingsOverTime = await observability!.getFeedbackTimeSeries({
|
|
|
127
127
|
|
|
128
128
|
See the [feedback reference](https://mastra.ai/reference/observability/feedback) for all fields, filters, return types, and percentile query parameters.
|
|
129
129
|
|
|
130
|
+
## Export feedback to external platforms
|
|
131
|
+
|
|
132
|
+
Feedback flows through the observability event bus, so exporters that support feedback forward it automatically. The [PostHog exporter](https://mastra.ai/reference/observability/tracing/exporters/posthog) sends feedback as native `$ai_feedback` events that appear on the linked trace in PostHog.
|
|
133
|
+
|
|
130
134
|
## Related
|
|
131
135
|
|
|
132
136
|
- [Observability overview](https://mastra.ai/docs/observability/overview)
|
|
@@ -254,6 +254,46 @@ class MyFGAProvider implements IFGAProvider {
|
|
|
254
254
|
}
|
|
255
255
|
```
|
|
256
256
|
|
|
257
|
+
## System actors
|
|
258
|
+
|
|
259
|
+
Autonomous and scheduled agents run without an end user. Mark these calls with an actor signal so FGA can tell them apart from user requests:
|
|
260
|
+
|
|
261
|
+
- `true` or `{ actorKind: 'system' }` identifies an anonymous system actor.
|
|
262
|
+
- The object form can also carry `agentId`, `permissions`, and `scope` to identify and constrain the acting agent.
|
|
263
|
+
|
|
264
|
+
By default, a trusted actor skips the user-centric `require()` check after a tenant-scope check. To enforce per-agent least privilege, implement the optional `requireActor` method on your provider. It receives the actor and the same `FGACheckParams` as `require`, and throws `FGADeniedError` to deny. When your provider doesn't implement `requireActor`, the trusted-actor bypass is preserved, so adding it is backward compatible.
|
|
265
|
+
|
|
266
|
+
```typescript
|
|
267
|
+
import { FGADeniedError } from '@mastra/core/auth/ee'
|
|
268
|
+
import type { ActorSignal, FGACheckParams, IFGAProvider } from '@mastra/core/auth/ee'
|
|
269
|
+
|
|
270
|
+
class MyFGAProvider implements IFGAProvider {
|
|
271
|
+
// ...check, require, filterAccessible...
|
|
272
|
+
|
|
273
|
+
async requireActor(actor: ActorSignal, params: FGACheckParams): Promise<void> {
|
|
274
|
+
const agentId = actor === true ? undefined : actor.agentId
|
|
275
|
+
// Resolve the agent's real grants from a trusted source keyed by agentId.
|
|
276
|
+
const granted = await this.grantsForAgent(agentId)
|
|
277
|
+
const required = Array.isArray(params.permission) ? params.permission : [params.permission]
|
|
278
|
+
if (!required.some(permission => granted.includes(permission))) {
|
|
279
|
+
throw new FGADeniedError(null, params.resource, params.permission)
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
### Trust requirements
|
|
286
|
+
|
|
287
|
+
The actor signal is trusted input, so construct it server-side:
|
|
288
|
+
|
|
289
|
+
- Treat `actor` as a per-call signal. Durable workflows forward it when a run starts, but don't restore the initial actor on resume. Pass it explicitly on every trusted resume, or resolve a fresh actor through agent `defaultOptions`. Without a current actor, user authorization applies and a missing user fails closed.
|
|
290
|
+
- Mastra strips `actor` from execution options handled by its built-in agent HTTP routes. Set it in server-side code, for example a scheduled job or a workflow, never from client input.
|
|
291
|
+
- Establish tenant scope server-side. Built-in agent HTTP routes ignore a client-supplied `organizationId` in the request context, and the trusted-actor path requires an `organizationId` to be set.
|
|
292
|
+
- Durable resume keeps its existing request-context recovery and merge behavior. This doesn't make a persisted actor trusted for a later workflow segment.
|
|
293
|
+
- The tenant-scope check confirms that a trusted `organizationId` exists. It doesn't verify that `actor.agentId` belongs to that organization. When that relationship matters, verify it in `requireActor` using authoritative provider data.
|
|
294
|
+
- Treat `actor.permissions` as a claim, not a grant. A provider that enforces least privilege resolves the agent's authoritative permissions from a trusted source, for example a manifest or your FGA backend keyed by `agentId`, rather than trusting the inline values.
|
|
295
|
+
- Once a provider implements `requireActor`, errors from that method stop execution. Mastra doesn't fall back to organization-only authorization.
|
|
296
|
+
|
|
257
297
|
## Related
|
|
258
298
|
|
|
259
299
|
- [Authentication overview](https://mastra.ai/docs/server/auth)
|
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
# Mastra Quickstart
|
|
4
4
|
|
|
5
|
-
**For AI agents:**
|
|
5
|
+
**For AI agents:** Create a new Mastra project non-interactively with `npm create mastra@latest <project-name> -- --llm <provider>`, replacing `<provider>` with `openai`, `anthropic`, `google`, or `xai`. For a minimal project without an agent or model provider, use `npm create mastra@latest <project-name> -- --empty`. To build a Mastra project from scratch, see the [manual installation guide](https://mastra.ai/docs/getting-started/manual-install).
|
|
6
6
|
|
|
7
|
-
The `create
|
|
7
|
+
The `create-mastra` CLI is the quickest way to start a Mastra project. It creates an agent harness with workspace tools, memory, task tracking, web access, schedules, storage, and observability.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
For more control, see the [manual installation guide](https://mastra.ai/docs/getting-started/manual-install). To add Mastra to an existing project, use [`mastra init`](https://mastra.ai/reference/cli/mastra).
|
|
10
10
|
|
|
11
|
-
> **📹 Watch:** Watch [Mastra AI agent course](https://www.youtube.com/watch?v=lCmf_qrGfGA) for a guided introduction to building agents with Mastra.
|
|
11
|
+
> **📹 Watch:** Watch the [Mastra AI agent course](https://www.youtube.com/watch?v=lCmf_qrGfGA) for a guided introduction to building agents with Mastra.
|
|
12
12
|
|
|
13
13
|
## Before you begin
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
You'll need an API key from OpenAI, Anthropic, Google Gemini, or xAI. You can skip entering it during setup and add it to `.env` later.
|
|
16
16
|
|
|
17
|
-
##
|
|
17
|
+
## Create the project
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Run the interactive setup:
|
|
20
20
|
|
|
21
21
|
**npm**:
|
|
22
22
|
|
|
@@ -42,32 +42,47 @@ yarn create mastra
|
|
|
42
42
|
bunx create-mastra
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
The command asks for a project name, model provider, and optional API key. It then installs dependencies, installs Mastra skills for your coding assistants, and creates an initial Git commit when you aren't already inside a repository.
|
|
46
46
|
|
|
47
|
-
The
|
|
47
|
+
The generated `src/mastra` directory contains the Mastra entry point, agent, workspace tools, and supporting code. See the [project structure reference](https://mastra.ai/reference/project-structure) for the standard Mastra layout.
|
|
48
48
|
|
|
49
|
-
-
|
|
50
|
-
- `agents/weather-agent.ts`: A weather agent with a prompt that uses the tool
|
|
51
|
-
- `tools/weather-tool.ts`: A tool to fetch weather for a given location
|
|
52
|
-
- `workflows/weather-workflow.ts`: A workflow that runs the weather agent
|
|
53
|
-
- `scorers/weather-scorer.ts`: A scorer to evaluate the weather agent's responses
|
|
49
|
+
> **Tip:** Use `--template <template>` to start from a template, or `--empty` to create a minimal provider-free project. Use `--no-skills` or `--no-git` to skip automatic setup. See the [`create-mastra` reference](https://mastra.ai/reference/cli/create-mastra) for all flags.
|
|
54
50
|
|
|
55
|
-
|
|
51
|
+
## Test your agent
|
|
56
52
|
|
|
57
|
-
|
|
53
|
+
Follow the terminal instructions to enter the project directory and start the development server:
|
|
58
54
|
|
|
59
|
-
|
|
55
|
+
**npm**:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npm run dev
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**pnpm**:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
pnpm run dev
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**Yarn**:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
yarn dev
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Bun**:
|
|
60
74
|
|
|
61
|
-
|
|
75
|
+
```bash
|
|
76
|
+
bun run dev
|
|
77
|
+
```
|
|
62
78
|
|
|
63
|
-
|
|
79
|
+
Open [Studio at localhost:4111](http://localhost:4111), select the agent, and send a message. Add the provider API key named in `.env.example` to an `.env` file if you skipped it during setup.
|
|
64
80
|
|
|
65
|
-
[Studio](https://mastra.ai/docs/studio/overview) lets you
|
|
81
|
+
[Studio](https://mastra.ai/docs/studio/overview) lets you build and test agents without creating a separate UI.
|
|
66
82
|
|
|
67
83
|
## Next steps
|
|
68
84
|
|
|
69
|
-
- Integrate Mastra with
|
|
70
|
-
-
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
- Watch conceptual guides on our [YouTube channel](https://www.youtube.com/@mastra-ai) and [subscribe](https://www.youtube.com/@mastra-ai?sub_confirmation=1)
|
|
85
|
+
- Integrate Mastra with [Next.js](https://mastra.ai/guides/getting-started/next-js), [React](https://mastra.ai/guides/getting-started/vite-react), or [Astro](https://mastra.ai/guides/getting-started/astro)
|
|
86
|
+
- Learn how to [build Mastra with AI](https://mastra.ai/docs/getting-started/build-with-ai)
|
|
87
|
+
- Build an agent from scratch with a [guide](https://mastra.ai/guides)
|
|
88
|
+
- Watch the [Mastra YouTube channel](https://www.youtube.com/@mastra-ai)
|
package/.docs/guides/index.md
CHANGED
|
@@ -6,7 +6,7 @@ Mastra offers a variety of guides to help you build and work with Mastra, from b
|
|
|
6
6
|
|
|
7
7
|
## New project
|
|
8
8
|
|
|
9
|
-
The `create mastra` command is the fastest way to build your first agent. It
|
|
9
|
+
The `npm create mastra@latest` command is the fastest way to build your first agent. It creates a ready-to-run agent harness that you can explore and adapt in [Studio](https://mastra.ai/docs/studio/overview) right away. You can always integrate Mastra with your framework or UI when you’re ready.
|
|
10
10
|
|
|
11
11
|
- [Quickstart](https://mastra.ai/guides/getting-started/quickstart)
|
|
12
12
|
|
|
@@ -10,6 +10,7 @@ List of required environment variables for each model provider and gateway suppo
|
|
|
10
10
|
| [Abacus](https://mastra.ai/models/providers/abacus) | `abacus/*` | `ABACUS_API_KEY` |
|
|
11
11
|
| [abliteration.ai](https://mastra.ai/models/providers/abliteration-ai) | `abliteration-ai/*` | `ABLIT_KEY` |
|
|
12
12
|
| [AI-ROUTER](https://mastra.ai/models/providers/ai-router) | `ai-router/*` | `AI_ROUTER_API_KEY` |
|
|
13
|
+
| [AKI.IO](https://mastra.ai/models/providers/aki-io) | `aki-io/*` | `AKI_IO_API_KEY` |
|
|
13
14
|
| [Alibaba](https://mastra.ai/models/providers/alibaba) | `alibaba/*` | `DASHSCOPE_API_KEY` |
|
|
14
15
|
| [Alibaba (China)](https://mastra.ai/models/providers/alibaba-cn) | `alibaba-cn/*` | `DASHSCOPE_API_KEY` |
|
|
15
16
|
| [Alibaba Coding Plan](https://mastra.ai/models/providers/alibaba-coding-plan) | `alibaba-coding-plan/*` | `ALIBABA_CODING_PLAN_API_KEY` |
|
|
@@ -29,6 +30,7 @@ List of required environment variables for each model provider and gateway suppo
|
|
|
29
30
|
| [Chutes](https://mastra.ai/models/providers/chutes) | `chutes/*` | `CHUTES_API_KEY` |
|
|
30
31
|
| [Clarifai](https://mastra.ai/models/providers/clarifai) | `clarifai/*` | `CLARIFAI_PAT` |
|
|
31
32
|
| [Claudinio](https://mastra.ai/models/providers/claudinio) | `claudinio/*` | `CLAUDINIO_API_KEY` |
|
|
33
|
+
| [ClinePass](https://mastra.ai/models/providers/cline-pass) | `cline-pass/*` | `CLINE_API_KEY` |
|
|
32
34
|
| [CloudFerro Sherlock](https://mastra.ai/models/providers/cloudferro-sherlock) | `cloudferro-sherlock/*` | `CLOUDFERRO_SHERLOCK_API_KEY` |
|
|
33
35
|
| [Cloudflare Workers AI](https://mastra.ai/models/providers/cloudflare-workers-ai) | `cloudflare-workers-ai/*` | `CLOUDFLARE_ACCOUNT_ID`, `CLOUDFLARE_API_KEY` |
|
|
34
36
|
| [Cortecs](https://mastra.ai/models/providers/cortecs) | `cortecs/*` | `CORTECS_API_KEY` |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Netlify
|
|
4
4
|
|
|
5
|
-
Netlify AI Gateway provides unified access to multiple providers with built-in caching and observability. Access
|
|
5
|
+
Netlify AI Gateway provides unified access to multiple providers with built-in caching and observability. Access 72 models through Mastra's model router.
|
|
6
6
|
|
|
7
7
|
Learn more in the [Netlify documentation](https://docs.netlify.com/build/ai-gateway/overview/).
|
|
8
8
|
|
|
@@ -62,6 +62,8 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
62
62
|
| `gemini/gemini-3.1-pro-preview` |
|
|
63
63
|
| `gemini/gemini-3.1-pro-preview-customtools` |
|
|
64
64
|
| `gemini/gemini-3.5-flash` |
|
|
65
|
+
| `gemini/gemini-3.5-flash-lite` |
|
|
66
|
+
| `gemini/gemini-3.6-flash` |
|
|
65
67
|
| `gemini/gemini-flash-latest` |
|
|
66
68
|
| `gemini/gemini-flash-lite-latest` |
|
|
67
69
|
| `openai/chat-latest` |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# OpenRouter
|
|
4
4
|
|
|
5
|
-
OpenRouter aggregates models from multiple providers with enhanced features like rate limiting and failover. Access
|
|
5
|
+
OpenRouter aggregates models from multiple providers with enhanced features like rate limiting and failover. Access 340 models through Mastra's model router.
|
|
6
6
|
|
|
7
7
|
Learn more in the [OpenRouter documentation](https://openrouter.ai/models).
|
|
8
8
|
|
|
@@ -116,6 +116,8 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
116
116
|
| `google/gemini-3.1-pro-preview` |
|
|
117
117
|
| `google/gemini-3.1-pro-preview-customtools` |
|
|
118
118
|
| `google/gemini-3.5-flash` |
|
|
119
|
+
| `google/gemini-3.5-flash-lite` |
|
|
120
|
+
| `google/gemini-3.6-flash` |
|
|
119
121
|
| `google/gemma-2-27b-it` |
|
|
120
122
|
| `google/gemma-3-12b-it` |
|
|
121
123
|
| `google/gemma-3-27b-it` |
|
|
@@ -283,6 +285,8 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
283
285
|
| `perplexity/sonar-reasoning-pro` |
|
|
284
286
|
| `poolside/laguna-m.1` |
|
|
285
287
|
| `poolside/laguna-m.1:free` |
|
|
288
|
+
| `poolside/laguna-s-2.1` |
|
|
289
|
+
| `poolside/laguna-s-2.1:free` |
|
|
286
290
|
| `poolside/laguna-xs-2.1` |
|
|
287
291
|
| `poolside/laguna-xs-2.1:free` |
|
|
288
292
|
| `qwen/qwen-2.5-72b-instruct` |
|
|
@@ -345,7 +349,6 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
345
349
|
| `tencent/hunyuan-a13b-instruct` |
|
|
346
350
|
| `tencent/hy3` |
|
|
347
351
|
| `tencent/hy3-preview` |
|
|
348
|
-
| `tencent/hy3:free` |
|
|
349
352
|
| `thedrummer/cydonia-24b-v4.1` |
|
|
350
353
|
| `thedrummer/rocinante-12b` |
|
|
351
354
|
| `thedrummer/skyfall-36b-v2` |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Vercel
|
|
4
4
|
|
|
5
|
-
Vercel aggregates models from multiple providers with enhanced features like rate limiting and failover. Access
|
|
5
|
+
Vercel aggregates models from multiple providers with enhanced features like rate limiting and failover. Access 303 models through Mastra's model router.
|
|
6
6
|
|
|
7
7
|
Learn more in the [Vercel documentation](https://ai-sdk.dev/providers/ai-sdk-providers).
|
|
8
8
|
|
|
@@ -140,6 +140,8 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
140
140
|
| `google/gemini-3.1-flash-lite-preview` |
|
|
141
141
|
| `google/gemini-3.1-pro-preview` |
|
|
142
142
|
| `google/gemini-3.5-flash` |
|
|
143
|
+
| `google/gemini-3.5-flash-lite` |
|
|
144
|
+
| `google/gemini-3.6-flash` |
|
|
143
145
|
| `google/gemini-embedding-001` |
|
|
144
146
|
| `google/gemini-embedding-2` |
|
|
145
147
|
| `google/gemini-omni-flash-preview` |
|
package/.docs/models/index.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Model Providers
|
|
4
4
|
|
|
5
|
-
Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to
|
|
5
|
+
Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to 4882 models from 158 providers through a single API.
|
|
6
6
|
|
|
7
7
|
## Features
|
|
8
8
|
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
|
+
|
|
3
|
+
# AKI.IO
|
|
4
|
+
|
|
5
|
+
Access 6 AKI.IO models through Mastra's model router. Authentication is handled automatically using the `AKI_IO_API_KEY` environment variable.
|
|
6
|
+
|
|
7
|
+
Learn more in the [AKI.IO documentation](https://aki.io/docs/).
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
AKI_IO_API_KEY=your-api-key
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { Agent } from "@mastra/core/agent";
|
|
15
|
+
|
|
16
|
+
const agent = new Agent({
|
|
17
|
+
id: "my-agent",
|
|
18
|
+
name: "My Agent",
|
|
19
|
+
instructions: "You are a helpful assistant",
|
|
20
|
+
model: "aki-io/gemma4-26b"
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
// Generate a response
|
|
24
|
+
const response = await agent.generate("Hello!");
|
|
25
|
+
|
|
26
|
+
// Stream a response
|
|
27
|
+
const stream = await agent.stream("Tell me a story");
|
|
28
|
+
for await (const chunk of stream) {
|
|
29
|
+
console.log(chunk);
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
> **Info:** Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [AKI.IO documentation](https://aki.io/docs/) for details.
|
|
34
|
+
|
|
35
|
+
## Models
|
|
36
|
+
|
|
37
|
+
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
38
|
+
| ----------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
39
|
+
| `aki-io/gemma4-26b` | 256K | | | | | | $0.10 | $0.50 |
|
|
40
|
+
| `aki-io/gpt-oss-120b` | 128K | | | | | | $0.15 | $0.55 |
|
|
41
|
+
| `aki-io/kimi-k2.7-code-1100b` | 262K | | | | | | $0.86 | $3 |
|
|
42
|
+
| `aki-io/minimax-m2.5-230b` | 197K | | | | | | $0.25 | $1 |
|
|
43
|
+
| `aki-io/mistral4-119b` | 262K | | | | | | $0.20 | $0.60 |
|
|
44
|
+
| `aki-io/qwen3.6-35b` | 256K | | | | | | $0.15 | $0.50 |
|
|
45
|
+
|
|
46
|
+
## Advanced configuration
|
|
47
|
+
|
|
48
|
+
### Custom headers
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
const agent = new Agent({
|
|
52
|
+
id: "custom-agent",
|
|
53
|
+
name: "custom-agent",
|
|
54
|
+
model: {
|
|
55
|
+
url: "https://aki.io/v1",
|
|
56
|
+
id: "aki-io/gemma4-26b",
|
|
57
|
+
apiKey: process.env.AKI_IO_API_KEY,
|
|
58
|
+
headers: {
|
|
59
|
+
"X-Custom-Header": "value"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Dynamic model selection
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
const agent = new Agent({
|
|
69
|
+
id: "dynamic-agent",
|
|
70
|
+
name: "Dynamic Agent",
|
|
71
|
+
model: ({ requestContext }) => {
|
|
72
|
+
const useAdvanced = requestContext.task === "complex";
|
|
73
|
+
return useAdvanced
|
|
74
|
+
? "aki-io/qwen3.6-35b"
|
|
75
|
+
: "aki-io/gemma4-26b";
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
```
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
|
+
|
|
3
|
+
# ClinePass
|
|
4
|
+
|
|
5
|
+
Access 10 ClinePass models through Mastra's model router. Authentication is handled automatically using the `CLINE_API_KEY` environment variable.
|
|
6
|
+
|
|
7
|
+
Learn more in the [ClinePass documentation](https://docs.cline.bot/getting-started/clinepass).
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
CLINE_API_KEY=your-api-key
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { Agent } from "@mastra/core/agent";
|
|
15
|
+
|
|
16
|
+
const agent = new Agent({
|
|
17
|
+
id: "my-agent",
|
|
18
|
+
name: "My Agent",
|
|
19
|
+
instructions: "You are a helpful assistant",
|
|
20
|
+
model: "cline-pass/cline-pass/deepseek-v4-flash"
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
// Generate a response
|
|
24
|
+
const response = await agent.generate("Hello!");
|
|
25
|
+
|
|
26
|
+
// Stream a response
|
|
27
|
+
const stream = await agent.stream("Tell me a story");
|
|
28
|
+
for await (const chunk of stream) {
|
|
29
|
+
console.log(chunk);
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
> **Info:** Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [ClinePass documentation](https://docs.cline.bot/getting-started/clinepass) for details.
|
|
34
|
+
|
|
35
|
+
## Models
|
|
36
|
+
|
|
37
|
+
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
38
|
+
| ----------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
39
|
+
| `cline-pass/cline-pass/deepseek-v4-flash` | 1.0M | | | | | | $0.14 | $0.28 |
|
|
40
|
+
| `cline-pass/cline-pass/deepseek-v4-pro` | 1.0M | | | | | | $2 | $3 |
|
|
41
|
+
| `cline-pass/cline-pass/glm-5.2` | 1.0M | | | | | | $1 | $4 |
|
|
42
|
+
| `cline-pass/cline-pass/kimi-k2.6` | 262K | | | | | | $0.95 | $4 |
|
|
43
|
+
| `cline-pass/cline-pass/kimi-k2.7-code` | 262K | | | | | | $0.95 | $4 |
|
|
44
|
+
| `cline-pass/cline-pass/mimo-v2.5` | 1.0M | | | | | | $0.14 | $0.28 |
|
|
45
|
+
| `cline-pass/cline-pass/mimo-v2.5-pro` | 1.0M | | | | | | $2 | $3 |
|
|
46
|
+
| `cline-pass/cline-pass/minimax-m3` | 512K | | | | | | $0.30 | $1 |
|
|
47
|
+
| `cline-pass/cline-pass/qwen3.7-max` | 1.0M | | | | | | $3 | $8 |
|
|
48
|
+
| `cline-pass/cline-pass/qwen3.7-plus` | 1.0M | | | | | | $0.40 | $2 |
|
|
49
|
+
|
|
50
|
+
## Advanced configuration
|
|
51
|
+
|
|
52
|
+
### Custom headers
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
const agent = new Agent({
|
|
56
|
+
id: "custom-agent",
|
|
57
|
+
name: "custom-agent",
|
|
58
|
+
model: {
|
|
59
|
+
url: "https://api.cline.bot/api/v1",
|
|
60
|
+
id: "cline-pass/cline-pass/deepseek-v4-flash",
|
|
61
|
+
apiKey: process.env.CLINE_API_KEY,
|
|
62
|
+
headers: {
|
|
63
|
+
"X-Custom-Header": "value"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Dynamic model selection
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
const agent = new Agent({
|
|
73
|
+
id: "dynamic-agent",
|
|
74
|
+
name: "Dynamic Agent",
|
|
75
|
+
model: ({ requestContext }) => {
|
|
76
|
+
const useAdvanced = requestContext.task === "complex";
|
|
77
|
+
return useAdvanced
|
|
78
|
+
? "cline-pass/cline-pass/qwen3.7-plus"
|
|
79
|
+
: "cline-pass/cline-pass/deepseek-v4-flash";
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
```
|
|
@@ -91,4 +91,6 @@ const response = await agent.generate("Hello!", {
|
|
|
91
91
|
|
|
92
92
|
**thinking** (`{ type?: "adaptive" | "enabled" | "disabled" | undefined; } | undefined`)
|
|
93
93
|
|
|
94
|
-
**reasoningEffort** (`"low" | "medium" | "high" | "xhigh" | "max" | undefined`)
|
|
94
|
+
**reasoningEffort** (`"low" | "medium" | "high" | "xhigh" | "max" | undefined`)
|
|
95
|
+
|
|
96
|
+
**strictJsonSchema** (`boolean | undefined`)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Google
|
|
4
4
|
|
|
5
|
-
Access
|
|
5
|
+
Access 21 Google models through Mastra's model router. Authentication is handled automatically using one of the following environment variables: `GOOGLE_API_KEY`, `GOOGLE_GENERATIVE_AI_API_KEY`.
|
|
6
6
|
|
|
7
7
|
Learn more in the [Google documentation](https://ai.google.dev/gemini-api/docs/models).
|
|
8
8
|
|
|
@@ -48,6 +48,8 @@ for await (const chunk of stream) {
|
|
|
48
48
|
| `google/gemini-3.1-pro-preview` | 1.0M | | | | | | $2 | $12 |
|
|
49
49
|
| `google/gemini-3.1-pro-preview-customtools` | 1.0M | | | | | | $2 | $12 |
|
|
50
50
|
| `google/gemini-3.5-flash` | 1.0M | | | | | | $2 | $9 |
|
|
51
|
+
| `google/gemini-3.5-flash-lite` | 1.0M | | | | | | $0.30 | $3 |
|
|
52
|
+
| `google/gemini-3.6-flash` | 1.0M | | | | | | $2 | $8 |
|
|
51
53
|
| `google/gemini-embedding-001` | 2K | | | | | | $0.15 | — |
|
|
52
54
|
| `google/gemini-flash-latest` | 1.0M | | | | | | $2 | $9 |
|
|
53
55
|
| `google/gemini-flash-lite-latest` | 1.0M | | | | | | $0.25 | $2 |
|
|
@@ -122,7 +124,7 @@ const response = await agent.generate("Hello!", {
|
|
|
122
124
|
|
|
123
125
|
**mediaResolution** (`"MEDIA_RESOLUTION_UNSPECIFIED" | "MEDIA_RESOLUTION_LOW" | "MEDIA_RESOLUTION_MEDIUM" | "MEDIA_RESOLUTION_HIGH" | undefined`)
|
|
124
126
|
|
|
125
|
-
**imageConfig** (`{ aspectRatio?: "1:1" | "2:3" | "3:2" | "3:4" | "4:3" | "4:5" | "5:4" | "9:16" | "16:9" | "21:9" | "1:8" | "8:1" | "1:4" | "4:1" | undefined; imageSize?: "1K" | "2K" | "4K" | "512" | undefined;
|
|
127
|
+
**imageConfig** (`{ aspectRatio?: "1:1" | "2:3" | "3:2" | "3:4" | "4:3" | "4:5" | "5:4" | "9:16" | "16:9" | "21:9" | "1:8" | "8:1" | "1:4" | "4:1" | undefined; imageSize?: "1K" | "2K" | "4K" | "512" | undefined; personGeneration?: "PERSON_GENERATION_UNSPECIFIED" | ... 3 more ... | undefined; prominentPeople?: "PROMINENT_PEOPLE_UNSPEC...`)
|
|
126
128
|
|
|
127
129
|
**retrievalConfig** (`{ latLng?: { latitude: number; longitude: number; } | undefined; } | undefined`)
|
|
128
130
|
|
|
@@ -37,11 +37,11 @@ for await (const chunk of stream) {
|
|
|
37
37
|
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
38
38
|
| ------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
39
39
|
| `inferx/google/gemma-4-31b-it-fp8` | 262K | | | | | | — | — |
|
|
40
|
-
| `inferx/qwen/qwen3-coder-next-fp8` | 256K | | | | | | — | — |
|
|
41
|
-
| `inferx/qwen/qwen3-coder-next-fp8-1m` | 1.0M | | | | | | — | — |
|
|
42
40
|
| `inferx/qwen/qwen3.5-122b-a10b-nvfp4` | 256K | | | | | | — | — |
|
|
43
41
|
| `inferx/qwen/qwen3.6-27b-fp8` | 262K | | | | | | — | — |
|
|
44
42
|
| `inferx/qwen/qwen3.6-35b-a3b-fp8` | 262K | | | | | | — | — |
|
|
43
|
+
| `inferx/qwen3-coder-next-fp8` | 256K | | | | | | — | — |
|
|
44
|
+
| `inferx/qwen3-coder-next-fp8-1m` | 1.0M | | | | | | — | — |
|
|
45
45
|
|
|
46
46
|
## Advanced configuration
|
|
47
47
|
|
|
@@ -71,7 +71,7 @@ const agent = new Agent({
|
|
|
71
71
|
model: ({ requestContext }) => {
|
|
72
72
|
const useAdvanced = requestContext.task === "complex";
|
|
73
73
|
return useAdvanced
|
|
74
|
-
? "inferx/
|
|
74
|
+
? "inferx/qwen3-coder-next-fp8-1m"
|
|
75
75
|
: "inferx/google/gemma-4-31b-it-fp8";
|
|
76
76
|
}
|
|
77
77
|
});
|