@mastra/mcp-docs-server 1.2.5-alpha.1 → 1.2.5-alpha.3
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/agent-builder/deploying.md +1 -1
- package/.docs/docs/agent-controller/overview.md +1 -1
- package/.docs/docs/agent-controller/session.md +1 -1
- package/.docs/docs/agents/overview.md +1 -1
- package/.docs/docs/agents/processors.md +1 -1
- package/.docs/docs/agents/supervisor-agents.md +3 -3
- package/.docs/docs/agents/using-tools.md +1 -1
- package/.docs/docs/{agents → long-running-agents}/background-tasks.md +2 -2
- package/.docs/docs/{agents → long-running-agents}/durable-agents.md +2 -2
- package/.docs/docs/{agents → long-running-agents}/goals.md +1 -1
- package/.docs/docs/{agents → long-running-agents}/heartbeats.md +5 -5
- package/.docs/docs/{agents → long-running-agents}/signal-providers.md +4 -4
- package/.docs/docs/memory/working-memory.md +1 -1
- package/.docs/docs/observability/config.md +1 -2
- package/.docs/docs/server/pubsub.md +2 -2
- package/.docs/docs/voice/overview.md +3 -3
- package/.docs/docs/voice/speech-to-speech.md +81 -1
- package/.docs/docs/voice/speech-to-text.md +19 -1
- package/.docs/docs/voice/text-to-speech.md +21 -1
- package/.docs/docs/workflows/control-flow.md +1 -1
- package/.docs/docs/workflows/error-handling.md +1 -1
- package/.docs/docs/workflows/human-in-the-loop.md +1 -1
- package/.docs/docs/workflows/overview.md +1 -1
- package/.docs/docs/workflows/snapshots.md +1 -1
- package/.docs/docs/workflows/suspend-and-resume.md +1 -1
- package/.docs/docs/workflows/time-travel.md +1 -1
- package/.docs/docs/workflows/workflow-state.md +1 -1
- package/.docs/guides/build-your-ui/copilotkit/channels.md +76 -0
- package/.docs/guides/build-your-ui/copilotkit/generative-ui.md +174 -0
- package/.docs/guides/build-your-ui/copilotkit/overview.md +411 -0
- package/.docs/guides/concepts/streaming.md +1 -1
- package/.docs/guides/deployment/vercel.md +1 -2
- package/.docs/guides/guide/signal-provider.md +5 -5
- package/.docs/models/environment-variables.md +1 -0
- package/.docs/models/index.md +1 -1
- package/.docs/models/providers/alibaba-cn.md +2 -1
- package/.docs/models/providers/friendli.md +1 -2
- package/.docs/models/providers/tencent-token-plan.md +7 -7
- package/.docs/models/providers/tencent-tokenhub.md +5 -4
- package/.docs/models/providers.md +1 -0
- package/.docs/reference/acp/acp-agent.md +5 -5
- package/.docs/reference/acp/create-acp-tool.md +5 -5
- package/.docs/reference/agent-controller/agent-controller-class.md +27 -27
- package/.docs/reference/agents/agent.md +34 -34
- package/.docs/reference/agents/channels.md +19 -19
- package/.docs/reference/agents/createSkill.md +2 -2
- package/.docs/reference/agents/durable-agent.md +22 -22
- package/.docs/reference/agents/generate.md +10 -10
- package/.docs/reference/agents/generateLegacy.md +12 -12
- package/.docs/reference/agents/getMetadata.md +1 -1
- package/.docs/reference/agents/getVoice.md +1 -1
- package/.docs/reference/agents/inngest-agent.md +9 -9
- package/.docs/reference/agents/network.md +1 -1
- package/.docs/reference/ai-sdk/chat-route.md +4 -4
- package/.docs/reference/ai-sdk/handle-chat-stream.md +6 -6
- package/.docs/reference/ai-sdk/handle-network-stream.md +3 -3
- package/.docs/reference/ai-sdk/handle-workflow-stream.md +1 -1
- package/.docs/reference/ai-sdk/network-route.md +4 -4
- package/.docs/reference/ai-sdk/to-ai-sdk-messages.md +1 -1
- package/.docs/reference/ai-sdk/to-ai-sdk-stream.md +1 -1
- package/.docs/reference/ai-sdk/with-mastra.md +2 -2
- package/.docs/reference/ai-sdk/workflow-route.md +2 -2
- package/.docs/reference/ai-sdk/workflow-snapshot-to-stream.md +1 -1
- package/.docs/reference/auth/google.md +10 -10
- package/.docs/reference/auth/okta.md +11 -11
- package/.docs/reference/auth/workos.md +3 -3
- package/.docs/reference/channels/slack-provider.md +15 -15
- package/.docs/reference/cli/mastra.md +145 -0
- package/.docs/reference/client-js/agents.md +9 -9
- package/.docs/reference/client-js/mastra-client.md +5 -5
- package/.docs/reference/client-js/responses.md +3 -3
- package/.docs/reference/configuration.md +1 -1
- package/.docs/reference/core/getAgentById.md +3 -3
- package/.docs/reference/core/getWorkflow.md +1 -1
- package/.docs/reference/core/listWorkflows.md +1 -1
- package/.docs/reference/core/mastra-class.md +3 -3
- package/.docs/reference/core/removeWorkspace.md +2 -2
- package/.docs/reference/datasets/compareExperiments.md +1 -1
- package/.docs/reference/datasets/getItemHistory.md +1 -1
- package/.docs/reference/datasets/list.md +5 -5
- package/.docs/reference/datasets/listExperimentResults.md +4 -4
- package/.docs/reference/datasets/listExperiments.md +4 -4
- package/.docs/reference/datasets/listItems.md +5 -5
- package/.docs/reference/datasets/listVersions.md +3 -3
- package/.docs/reference/datasets/startExperiment.md +8 -8
- package/.docs/reference/datasets/startExperimentAsync.md +1 -1
- package/.docs/reference/editor/agent-builder/agent-builder-options.md +4 -4
- package/.docs/reference/editor/agent-builder/builder-agent-defaults.md +7 -7
- package/.docs/reference/editor/agent-builder/builder-models.md +4 -4
- package/.docs/reference/editor/blob-store-provider.md +2 -2
- package/.docs/reference/editor/browser-provider.md +2 -2
- package/.docs/reference/editor/filesystem-provider.md +2 -2
- package/.docs/reference/editor/mastra-editor.md +2 -2
- package/.docs/reference/editor/processor-provider.md +4 -4
- package/.docs/reference/editor/sandbox-provider.md +2 -2
- package/.docs/reference/editor/storage-browser-ref.md +2 -2
- package/.docs/reference/editor/storage-workspace-ref.md +7 -7
- package/.docs/reference/evals/create-scorer.md +8 -8
- package/.docs/reference/evals/rubric.md +1 -1
- package/.docs/reference/evals/run-evals.md +7 -7
- package/.docs/reference/evals/trajectory-accuracy.md +1 -1
- package/.docs/reference/index.md +2 -2
- package/.docs/reference/logging/pino-logger.md +4 -4
- package/.docs/reference/memory/cloneThread.md +35 -4
- package/.docs/reference/memory/memory-class.md +5 -5
- package/.docs/reference/memory/observational-memory.md +43 -43
- package/.docs/reference/memory/recall.md +4 -4
- package/.docs/reference/memory/serialized-memory-config.md +6 -6
- package/.docs/reference/observability/tracing/configuration.md +4 -4
- package/.docs/reference/processors/language-detector.md +1 -1
- package/.docs/reference/processors/moderation-processor.md +1 -1
- package/.docs/reference/processors/pii-detector.md +1 -1
- package/.docs/reference/processors/processor-interface.md +20 -20
- package/.docs/reference/processors/prompt-injection-detector.md +1 -1
- package/.docs/reference/processors/response-cache.md +6 -6
- package/.docs/reference/processors/unicode-normalizer.md +1 -1
- package/.docs/reference/pubsub/base.md +7 -7
- package/.docs/reference/pubsub/caching-pubsub.md +1 -1
- package/.docs/reference/pubsub/event-emitter.md +2 -2
- package/.docs/reference/pubsub/google-cloud-pubsub.md +1 -1
- package/.docs/reference/pubsub/lease-provider.md +3 -3
- package/.docs/reference/pubsub/redis-streams.md +6 -6
- package/.docs/reference/pubsub/unix-socket-pubsub.md +1 -1
- package/.docs/reference/rag/chunk.md +2 -2
- package/.docs/reference/server/create-route.md +3 -3
- package/.docs/reference/server/express-adapter.md +4 -4
- package/.docs/reference/server/fastify-adapter.md +4 -4
- package/.docs/reference/server/hono-adapter.md +4 -4
- package/.docs/reference/server/koa-adapter.md +4 -4
- package/.docs/reference/server/mastra-server.md +1 -1
- package/.docs/reference/server/nestjs-adapter.md +3 -3
- package/.docs/reference/server/register-api-route.md +3 -3
- package/.docs/reference/signals/create-notification-inbox-tool.md +3 -3
- package/.docs/reference/signals/signal-provider.md +7 -7
- package/.docs/reference/signals/webhook-signal-provider.md +2 -2
- package/.docs/reference/storage/clickhouse.md +7 -7
- package/.docs/reference/storage/composite.md +2 -2
- package/.docs/reference/storage/duckdb.md +1 -1
- package/.docs/reference/storage/dynamodb.md +1 -1
- package/.docs/reference/storage/libsql.md +1 -1
- package/.docs/reference/storage/postgresql.md +2 -2
- package/.docs/reference/storage/redis.md +2 -2
- package/.docs/reference/storage/retention.md +5 -5
- package/.docs/reference/storage/spanner.md +6 -6
- package/.docs/reference/streaming/ChunkType.md +3 -3
- package/.docs/reference/streaming/agents/stream.md +14 -14
- package/.docs/reference/streaming/agents/streamLegacy.md +10 -10
- package/.docs/reference/streaming/agents/streamUntilIdle.md +1 -1
- package/.docs/reference/streaming/workflows/resumeStream.md +1 -1
- package/.docs/reference/templates/overview.md +1 -140
- package/.docs/reference/tools/brightdata.md +4 -4
- package/.docs/reference/tools/create-code-mode.md +5 -5
- package/.docs/reference/tools/create-tool.md +15 -15
- package/.docs/reference/tools/graph-rag-tool.md +1 -1
- package/.docs/reference/tools/mcp-client.md +2 -2
- package/.docs/reference/tools/mcp-server.md +12 -12
- package/.docs/reference/tools/perplexity.md +3 -3
- package/.docs/reference/tools/tavily.md +1 -1
- package/.docs/reference/tools/vector-query-tool.md +1 -1
- package/.docs/reference/vectors/chroma.md +1 -1
- package/.docs/reference/vectors/mongodb.md +1 -1
- package/.docs/reference/vectors/pg.md +1 -1
- package/.docs/reference/vectors/s3vectors.md +4 -4
- package/.docs/reference/voice/google-gemini-live.md +3 -3
- package/.docs/reference/voice/inworld-realtime.md +12 -12
- package/.docs/reference/voice/inworld.md +2 -2
- package/.docs/reference/voice/voice.on.md +1 -1
- package/.docs/reference/workflows/run-methods/resume.md +1 -1
- package/.docs/reference/workflows/run-methods/timeTravel.md +1 -1
- package/.docs/reference/workspace/agentcore-runtime-sandbox.md +4 -4
- package/.docs/reference/workspace/agentfs-filesystem.md +1 -1
- package/.docs/reference/workspace/apple-container-sandbox.md +5 -5
- package/.docs/reference/workspace/archil-filesystem.md +5 -5
- package/.docs/reference/workspace/blaxel-sandbox.md +1 -1
- package/.docs/reference/workspace/daytona-sandbox.md +1 -1
- package/.docs/reference/workspace/docker-sandbox.md +2 -2
- package/.docs/reference/workspace/e2b-sandbox.md +2 -2
- package/.docs/reference/workspace/files-sdk-filesystem.md +1 -1
- package/.docs/reference/workspace/filesystem.md +1 -1
- package/.docs/reference/workspace/local-filesystem.md +3 -3
- package/.docs/reference/workspace/local-sandbox.md +1 -1
- package/.docs/reference/workspace/mesa-filesystem.md +3 -3
- package/.docs/reference/workspace/modal-sandbox.md +1 -1
- package/.docs/reference/workspace/railway-sandbox.md +1 -1
- package/.docs/reference/workspace/s3-filesystem.md +4 -4
- package/.docs/reference/workspace/sandbox.md +1 -1
- package/.docs/reference/workspace/{vercel-microvm-sandbox.md → vercel-sandbox.md} +21 -15
- package/.docs/reference/workspace/{vercel.md → vercel-serverless.md} +21 -14
- package/.docs/reference/workspace/workspace-class.md +15 -15
- package/CHANGELOG.md +8 -0
- package/package.json +5 -5
- package/.docs/docs/agents/adding-voice.md +0 -383
- package/.docs/docs/community/contributing-templates.md +0 -5
- package/.docs/docs/community/discord.md +0 -11
- package/.docs/guides/build-your-ui/copilotkit.md +0 -291
- package/LICENSE.md +0 -30
- /package/.docs/docs/{community/licensing.md → license.md} +0 -0
- /package/.docs/docs/{agents → long-running-agents}/signals.md +0 -0
|
@@ -1,291 +0,0 @@
|
|
|
1
|
-
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
|
-
|
|
3
|
-
# Using CopilotKit
|
|
4
|
-
|
|
5
|
-
[CopilotKit](https://www.copilotkit.ai/) provides React components to quickly integrate customizable AI copilots into your application. Combined with Mastra, you can build sophisticated AI apps featuring bidirectional state synchronization and interactive UIs.
|
|
6
|
-
|
|
7
|
-
Visit the [CopilotKit documentation](https://docs.copilotkit.ai/) to learn more about CopilotKit concepts, components, and advanced usage patterns.
|
|
8
|
-
|
|
9
|
-
> **Info:** For a full-stack integration approach where Mastra runs directly in your Next.js API routes, see the [CopilotKit Quickstart](https://docs.copilotkit.ai/mastra/quickstart) guide.
|
|
10
|
-
|
|
11
|
-
> **Tip:** Visit Mastra's [**"UI Dojo"**](https://ui-dojo.mastra.ai/) to see real-world examples of CopilotKit integrated with Mastra.
|
|
12
|
-
|
|
13
|
-
## Integration guide
|
|
14
|
-
|
|
15
|
-
Run Mastra as a standalone server and connect your Next.js frontend (with CopilotKit) to its API endpoints.
|
|
16
|
-
|
|
17
|
-
1. Set up your directory structure. A possible directory structure could look like this:
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
project-root
|
|
21
|
-
├── mastra-server
|
|
22
|
-
│ ├── src
|
|
23
|
-
│ │ └── mastra
|
|
24
|
-
│ └── package.json
|
|
25
|
-
└── my-copilot-app
|
|
26
|
-
└── package.json
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
Bootstrap your Mastra server:
|
|
30
|
-
|
|
31
|
-
**npm**:
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
npx create-mastra@latest
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
**pnpm**:
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
pnpm dlx create-mastra@latest
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
**Yarn**:
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
yarn dlx create-mastra@latest
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
**Bun**:
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
bun x create-mastra@latest
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
This command will launch an interactive wizard to help you scaffold a new Mastra project, including prompting you for a project name and setting up basic configurations. Follow the prompts to create your server project.
|
|
56
|
-
|
|
57
|
-
Navigate to your newly created Mastra server directory:
|
|
58
|
-
|
|
59
|
-
```bash
|
|
60
|
-
cd mastra-server # Replace with the actual directory name you provided
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
You now have a basic Mastra server project ready. You should have the following files and folders:
|
|
64
|
-
|
|
65
|
-
```bash
|
|
66
|
-
src
|
|
67
|
-
└── mastra
|
|
68
|
-
├── agents
|
|
69
|
-
│ └── weather-agent.ts
|
|
70
|
-
├── scorers
|
|
71
|
-
│ └── weather-scorer.ts
|
|
72
|
-
├── tools
|
|
73
|
-
│ └── weather-tool.ts
|
|
74
|
-
├── workflows
|
|
75
|
-
│ └── weather-workflow.ts
|
|
76
|
-
└── index.ts
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
> **Note:** Ensure that you have set the appropriate environment variables for your LLM provider in the `.env` file.
|
|
80
|
-
|
|
81
|
-
2. Create a chat route for the CopilotKit frontend by using the `registerCopilotKit()` helper from `@ag-ui/mastra`. Add it to your Mastra project (and its peer dependencies):
|
|
82
|
-
|
|
83
|
-
**npm**:
|
|
84
|
-
|
|
85
|
-
```bash
|
|
86
|
-
npm install @ag-ui/mastra @mastra/client-js @mastra/core @ag-ui/core @ag-ui/client @copilotkit/runtime
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
**pnpm**:
|
|
90
|
-
|
|
91
|
-
```bash
|
|
92
|
-
pnpm add @ag-ui/mastra @mastra/client-js @mastra/core @ag-ui/core @ag-ui/client @copilotkit/runtime
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
**Yarn**:
|
|
96
|
-
|
|
97
|
-
```bash
|
|
98
|
-
yarn add @ag-ui/mastra @mastra/client-js @mastra/core @ag-ui/core @ag-ui/client @copilotkit/runtime
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
**Bun**:
|
|
102
|
-
|
|
103
|
-
```bash
|
|
104
|
-
bun add @ag-ui/mastra @mastra/client-js @mastra/core @ag-ui/core @ag-ui/client @copilotkit/runtime
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
In your `src/mastra/index.ts` file, register the chat route:
|
|
108
|
-
|
|
109
|
-
```typescript
|
|
110
|
-
import { Mastra } from '@mastra/core/mastra'
|
|
111
|
-
import { registerCopilotKit } from '@ag-ui/mastra/copilotkit'
|
|
112
|
-
// Rest of the imports...
|
|
113
|
-
|
|
114
|
-
export const mastra = new Mastra({
|
|
115
|
-
// Rest of the configuration...
|
|
116
|
-
server: {
|
|
117
|
-
cors: {
|
|
118
|
-
origin: '*',
|
|
119
|
-
allowMethods: ['*'],
|
|
120
|
-
allowHeaders: ['*'],
|
|
121
|
-
},
|
|
122
|
-
apiRoutes: [
|
|
123
|
-
registerCopilotKit({
|
|
124
|
-
path: '/chat',
|
|
125
|
-
resourceId: 'weatherAgent',
|
|
126
|
-
}),
|
|
127
|
-
],
|
|
128
|
-
},
|
|
129
|
-
})
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
This will make the `weatherAgent` available at `/chat` in a CopilotKit-compatible format. You have to add the CORS configuration to allow the CopilotKit frontend to access the Mastra server. For production deployments, make sure to restrict the CORS origins to only your frontend domain.
|
|
133
|
-
|
|
134
|
-
3. Run the Mastra server using the following command:
|
|
135
|
-
|
|
136
|
-
**npm**:
|
|
137
|
-
|
|
138
|
-
```bash
|
|
139
|
-
npm run dev
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
**pnpm**:
|
|
143
|
-
|
|
144
|
-
```bash
|
|
145
|
-
pnpm run dev
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
**Yarn**:
|
|
149
|
-
|
|
150
|
-
```bash
|
|
151
|
-
yarn dev
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
**Bun**:
|
|
155
|
-
|
|
156
|
-
```bash
|
|
157
|
-
bun run dev
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
By default, the Mastra server will run on `http://localhost:4111`. Keep this server running for the next steps where we'll set up the CopilotKit frontend to connect to it.
|
|
161
|
-
|
|
162
|
-
4. Go up one directory to your project root.
|
|
163
|
-
|
|
164
|
-
```bash
|
|
165
|
-
cd ..
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
Create a new Next.js project with the name `my-copilot-app`:
|
|
169
|
-
|
|
170
|
-
**npm**:
|
|
171
|
-
|
|
172
|
-
```bash
|
|
173
|
-
npx create-next-app@latest my-copilot-app
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
**pnpm**:
|
|
177
|
-
|
|
178
|
-
```bash
|
|
179
|
-
pnpm dlx create-next-app@latest my-copilot-app
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
**Yarn**:
|
|
183
|
-
|
|
184
|
-
```bash
|
|
185
|
-
yarn dlx create-next-app@latest my-copilot-app
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
**Bun**:
|
|
189
|
-
|
|
190
|
-
```bash
|
|
191
|
-
bun x create-next-app@latest my-copilot-app
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
Navigate to your newly created Next.js project directory:
|
|
195
|
-
|
|
196
|
-
```bash
|
|
197
|
-
cd my-copilot-app
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
5. Install the CopilotKit UI packages which you'll use to display a chat interface:
|
|
201
|
-
|
|
202
|
-
**npm**:
|
|
203
|
-
|
|
204
|
-
```bash
|
|
205
|
-
npm install @copilotkit/react-ui @copilotkit/react-core
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
**pnpm**:
|
|
209
|
-
|
|
210
|
-
```bash
|
|
211
|
-
pnpm add @copilotkit/react-ui @copilotkit/react-core
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
**Yarn**:
|
|
215
|
-
|
|
216
|
-
```bash
|
|
217
|
-
yarn add @copilotkit/react-ui @copilotkit/react-core
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
**Bun**:
|
|
221
|
-
|
|
222
|
-
```bash
|
|
223
|
-
bun add @copilotkit/react-ui @copilotkit/react-core
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
Open the home route of the Next.js app (usually `app/page.tsx` or `src/app/page.tsx`) and replace the existing contents with the following code to set up a basic CopilotKit chat interface:
|
|
227
|
-
|
|
228
|
-
```typescript
|
|
229
|
-
import { CopilotChat } from '@copilotkit/react-ui'
|
|
230
|
-
import { CopilotKit } from '@copilotkit/react-core'
|
|
231
|
-
import '@copilotkit/react-ui/styles.css'
|
|
232
|
-
|
|
233
|
-
export default function Home() {
|
|
234
|
-
return (
|
|
235
|
-
<CopilotKit runtimeUrl="http://localhost:4111/chat" agent="weatherAgent">
|
|
236
|
-
<CopilotChat
|
|
237
|
-
labels={{
|
|
238
|
-
title: 'Weather Agent',
|
|
239
|
-
initial: 'Hi! 👋 Ask me about the weather, forecasts, and climate.',
|
|
240
|
-
}}
|
|
241
|
-
/>
|
|
242
|
-
</CopilotKit>
|
|
243
|
-
)
|
|
244
|
-
}
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
6. You're ready to connect the pieces! Make sure both the Mastra server and the CopilotKit frontend are running. Start the Next.js development server:
|
|
248
|
-
|
|
249
|
-
**npm**:
|
|
250
|
-
|
|
251
|
-
```bash
|
|
252
|
-
npm run dev
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
**pnpm**:
|
|
256
|
-
|
|
257
|
-
```bash
|
|
258
|
-
pnpm run dev
|
|
259
|
-
```
|
|
260
|
-
|
|
261
|
-
**Yarn**:
|
|
262
|
-
|
|
263
|
-
```bash
|
|
264
|
-
yarn dev
|
|
265
|
-
```
|
|
266
|
-
|
|
267
|
-
**Bun**:
|
|
268
|
-
|
|
269
|
-
```bash
|
|
270
|
-
bun run dev
|
|
271
|
-
```
|
|
272
|
-
|
|
273
|
-
You should now be able to chat with your agent in the browser.
|
|
274
|
-
|
|
275
|
-
Congratulations! You have successfully integrated Mastra with CopilotKit using a separate server approach. Your CopilotKit frontend now communicates with a standalone Mastra agent server.
|
|
276
|
-
|
|
277
|
-
## Deployment
|
|
278
|
-
|
|
279
|
-
When deploying your Mastra server with CopilotKit, you must exclude `@copilotkit/runtime` from the bundle. This package contains dependencies that aren't compatible with bundling and will cause 500 errors if included.
|
|
280
|
-
|
|
281
|
-
> **Note:** This issue doesn't occur during development with `mastra dev` since it doesn't require bundling. However, anyone running `mastra build` for deployment will encounter this issue.
|
|
282
|
-
|
|
283
|
-
Add the `@copilotkit/runtime` package to your bundler externals configuration:
|
|
284
|
-
|
|
285
|
-
```typescript
|
|
286
|
-
export const mastra = new Mastra({
|
|
287
|
-
bundler: {
|
|
288
|
-
externals: ['@copilotkit/runtime'],
|
|
289
|
-
},
|
|
290
|
-
})
|
|
291
|
-
```
|
package/LICENSE.md
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
Portions of this software are licensed as follows:
|
|
2
|
-
|
|
3
|
-
- All content that resides under any directory named "ee/" within this
|
|
4
|
-
repository, including but not limited to:
|
|
5
|
-
- `packages/core/src/auth/ee/`
|
|
6
|
-
- `packages/server/src/server/auth/ee/`
|
|
7
|
-
is licensed under the license defined in `ee/LICENSE`.
|
|
8
|
-
|
|
9
|
-
- All third-party components incorporated into the Mastra Software are
|
|
10
|
-
licensed under the original license provided by the owner of the
|
|
11
|
-
applicable component.
|
|
12
|
-
|
|
13
|
-
- Content outside of the above-mentioned directories or restrictions is
|
|
14
|
-
available under the "Apache License 2.0" as defined below.
|
|
15
|
-
|
|
16
|
-
# Apache License 2.0
|
|
17
|
-
|
|
18
|
-
Copyright (c) 2025 Kepler Software, Inc.
|
|
19
|
-
|
|
20
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
21
|
-
you may not use this file except in compliance with the License.
|
|
22
|
-
You may obtain a copy of the License at
|
|
23
|
-
|
|
24
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
25
|
-
|
|
26
|
-
Unless required by applicable law or agreed to in writing, software
|
|
27
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
28
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
29
|
-
See the License for the specific language governing permissions and
|
|
30
|
-
limitations under the License.
|
|
File without changes
|
|
File without changes
|