@mastra/mcp-docs-server 1.0.0-beta.1 → 1.0.0-beta.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/organized/changelogs/%40mastra%2Fagent-builder.md +9 -9
- package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +35 -35
- package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fcodemod.md +14 -0
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +172 -172
- package/.docs/organized/changelogs/%40mastra%2Fcouchbase.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +14 -14
- package/.docs/organized/changelogs/%40mastra%2Fevals.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Flance.md +14 -14
- package/.docs/organized/changelogs/%40mastra%2Flibsql.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Floggers.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +27 -27
- package/.docs/organized/changelogs/%40mastra%2Fmcp.md +23 -23
- package/.docs/organized/changelogs/%40mastra%2Fmemory.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fmssql.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fpg.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fpinecone.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +48 -48
- package/.docs/organized/changelogs/%40mastra%2Frag.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Freact.md +15 -15
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fupstash.md +14 -14
- package/.docs/organized/changelogs/%40mastra%2Fvoice-google-gemini-live.md +12 -12
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai.md +10 -10
- package/.docs/organized/changelogs/create-mastra.md +15 -15
- package/.docs/organized/changelogs/mastra.md +37 -37
- package/.docs/organized/code-examples/ai-elements.md +1 -1
- package/.docs/organized/code-examples/ai-sdk-useChat.md +1 -1
- package/.docs/organized/code-examples/ai-sdk-v5.md +1 -1
- package/.docs/organized/code-examples/assistant-ui.md +1 -1
- package/.docs/organized/code-examples/bird-checker-with-express.md +1 -1
- package/.docs/organized/code-examples/bird-checker-with-nextjs-and-eval.md +1 -1
- package/.docs/organized/code-examples/bird-checker-with-nextjs.md +1 -1
- package/.docs/organized/code-examples/client-side-tools.md +1 -1
- package/.docs/organized/code-examples/crypto-chatbot.md +1 -1
- package/.docs/organized/code-examples/fireworks-r1.md +1 -1
- package/.docs/organized/code-examples/heads-up-game.md +1 -1
- package/.docs/organized/code-examples/mcp-configuration.md +0 -3
- package/.docs/organized/code-examples/memory-per-resource-example.md +1 -1
- package/.docs/organized/code-examples/openapi-spec-writer.md +1 -1
- package/.docs/organized/code-examples/quick-start.md +1 -1
- package/.docs/organized/code-examples/stock-price-tool.md +1 -21
- package/.docs/organized/code-examples/workflow-ai-recruiter.md +1 -1
- package/.docs/organized/code-examples/workflow-with-inline-steps.md +1 -1
- package/.docs/organized/code-examples/workflow-with-memory.md +1 -1
- package/.docs/organized/code-examples/workflow-with-separate-steps.md +1 -1
- package/.docs/organized/code-examples/workflow-with-suspend-resume.md +1 -1
- package/.docs/raw/agents/adding-voice.mdx +1 -1
- package/.docs/raw/agents/agent-memory.mdx +1 -1
- package/.docs/raw/agents/guardrails.mdx +1 -1
- package/.docs/raw/agents/human-in-the-loop-with-tools.mdx +90 -0
- package/.docs/raw/agents/networks.mdx +1 -1
- package/.docs/raw/agents/overview.mdx +8 -13
- package/.docs/raw/agents/using-tools.mdx +10 -9
- package/.docs/raw/auth/auth0.mdx +1 -1
- package/.docs/raw/auth/clerk.mdx +1 -1
- package/.docs/raw/auth/firebase.mdx +1 -1
- package/.docs/raw/auth/index.mdx +1 -1
- package/.docs/raw/auth/jwt.mdx +1 -1
- package/.docs/raw/auth/supabase.mdx +1 -1
- package/.docs/raw/auth/workos.mdx +1 -1
- package/.docs/raw/community/contributing-templates.mdx +1 -1
- package/.docs/raw/community/discord.mdx +2 -2
- package/.docs/raw/community/licensing.mdx +1 -1
- package/.docs/raw/deployment/{server-deployment.mdx → building-mastra.mdx} +4 -4
- package/.docs/raw/deployment/cloud-providers/amazon-ec2.mdx +2 -2
- package/.docs/raw/deployment/cloud-providers/aws-lambda.mdx +3 -3
- package/.docs/raw/deployment/cloud-providers/azure-app-services.mdx +2 -2
- package/.docs/raw/deployment/{serverless-platforms → cloud-providers}/cloudflare-deployer.mdx +1 -1
- package/.docs/raw/deployment/cloud-providers/digital-ocean.mdx +2 -2
- package/.docs/raw/deployment/cloud-providers/index.mdx +8 -4
- package/.docs/raw/deployment/{serverless-platforms → cloud-providers}/netlify-deployer.mdx +1 -1
- package/.docs/raw/deployment/{serverless-platforms → cloud-providers}/vercel-deployer.mdx +1 -1
- package/.docs/raw/{mastra-cloud → deployment/mastra-cloud}/dashboard.mdx +3 -3
- package/.docs/raw/{mastra-cloud → deployment/mastra-cloud}/observability.mdx +2 -2
- package/.docs/raw/{mastra-cloud → deployment/mastra-cloud}/overview.mdx +3 -3
- package/.docs/raw/{mastra-cloud → deployment/mastra-cloud}/setting-up.mdx +4 -4
- package/.docs/raw/deployment/monorepo.mdx +3 -3
- package/.docs/raw/deployment/overview.mdx +5 -5
- package/.docs/raw/deployment/web-framework.mdx +1 -1
- package/.docs/raw/evals/{off-the-shelf-scorers.mdx → built-in-scorers.mdx} +17 -15
- package/.docs/raw/evals/custom-scorers.mdx +1 -1
- package/.docs/raw/evals/overview.mdx +3 -3
- package/.docs/raw/evals/running-in-ci.mdx +2 -2
- package/.docs/raw/frameworks/agentic-uis/ai-sdk.mdx +15 -128
- package/.docs/raw/frameworks/agentic-uis/assistant-ui.mdx +71 -19
- package/.docs/raw/frameworks/agentic-uis/cedar-os.mdx +8 -29
- package/.docs/raw/frameworks/agentic-uis/copilotkit.mdx +91 -267
- package/.docs/raw/frameworks/agentic-uis/openrouter.mdx +3 -3
- package/.docs/raw/frameworks/servers/express.mdx +1 -1
- package/.docs/raw/frameworks/web-frameworks/astro.mdx +1 -1
- package/.docs/raw/frameworks/web-frameworks/next-js.mdx +1 -1
- package/.docs/raw/frameworks/web-frameworks/sveltekit.mdx +1 -1
- package/.docs/raw/frameworks/web-frameworks/vite-react.mdx +1 -1
- package/.docs/raw/getting-started/mcp-docs-server.mdx +6 -6
- package/.docs/raw/getting-started/project-structure.mdx +1 -1
- package/.docs/raw/getting-started/quickstart.mdx +27 -0
- package/.docs/raw/getting-started/studio.mdx +3 -3
- package/.docs/raw/getting-started/templates.mdx +1 -1
- package/.docs/raw/guides/guide/ai-recruiter.mdx +1 -1
- package/.docs/raw/guides/guide/chef-michel.mdx +1 -1
- package/.docs/raw/{getting-started/installation.mdx → guides/guide/manual-install.mdx} +6 -80
- package/.docs/raw/guides/guide/notes-mcp-server.mdx +2 -2
- package/.docs/raw/guides/guide/research-assistant.mdx +2 -2
- package/.docs/raw/guides/guide/stock-agent.mdx +1 -1
- package/.docs/raw/guides/guide/web-search.mdx +1 -1
- package/.docs/raw/guides/migrations/ai-sdk-v4-to-v5.mdx +119 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/agent.mdx +11 -1
- package/.docs/raw/guides/migrations/upgrade-to-v1/client.mdx +42 -2
- package/.docs/raw/guides/migrations/upgrade-to-v1/evals.mdx +31 -1
- package/.docs/raw/guides/migrations/upgrade-to-v1/mastra.mdx +27 -3
- package/.docs/raw/guides/migrations/upgrade-to-v1/mcp.mdx +1 -1
- package/.docs/raw/guides/migrations/upgrade-to-v1/memory.mdx +28 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/overview.mdx +25 -3
- package/.docs/raw/guides/migrations/upgrade-to-v1/storage.mdx +80 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/tools.mdx +60 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/vectors.mdx +25 -1
- package/.docs/raw/guides/migrations/upgrade-to-v1/workflows.mdx +43 -1
- package/.docs/raw/guides/quickstarts/nextjs.mdx +18 -17
- package/.docs/raw/guides/quickstarts/standalone-server.mdx +86 -0
- package/.docs/raw/index.mdx +3 -3
- package/.docs/raw/logging.mdx +7 -7
- package/.docs/raw/mcp/overview.mdx +360 -0
- package/.docs/raw/mcp/publishing-mcp-server.mdx +139 -0
- package/.docs/raw/memory/conversation-history.mdx +1 -1
- package/.docs/raw/memory/memory-processors.mdx +1 -1
- package/.docs/raw/memory/overview.mdx +2 -2
- package/.docs/raw/memory/semantic-recall.mdx +2 -2
- package/.docs/raw/memory/storage/memory-with-libsql.mdx +1 -4
- package/.docs/raw/memory/storage/memory-with-mongodb.mdx +152 -0
- package/.docs/raw/memory/storage/memory-with-pg.mdx +1 -4
- package/.docs/raw/memory/storage/memory-with-upstash.mdx +1 -4
- package/.docs/raw/memory/threads-and-resources.mdx +1 -1
- package/.docs/raw/memory/working-memory.mdx +1 -1
- package/.docs/raw/observability/overview.mdx +2 -2
- package/.docs/raw/observability/tracing/exporters/arize.mdx +1 -1
- package/.docs/raw/observability/tracing/exporters/braintrust.mdx +1 -1
- package/.docs/raw/observability/tracing/exporters/cloud.mdx +2 -2
- package/.docs/raw/observability/tracing/exporters/default.mdx +1 -1
- package/.docs/raw/observability/tracing/exporters/langfuse.mdx +1 -1
- package/.docs/raw/observability/tracing/exporters/langsmith.mdx +1 -1
- package/.docs/raw/observability/tracing/exporters/otel.mdx +1 -1
- package/.docs/raw/observability/tracing/overview.mdx +2 -2
- package/.docs/raw/observability/tracing/processors/sensitive-data-filter.mdx +2 -2
- package/.docs/raw/rag/overview.mdx +1 -1
- package/.docs/raw/rag/retrieval.mdx +1 -1
- package/.docs/raw/rag/vector-databases.mdx +1 -1
- package/.docs/raw/reference/agents/agent.mdx +1 -2
- package/.docs/raw/reference/agents/generate.mdx +1 -1
- package/.docs/raw/reference/agents/generateLegacy.mdx +1 -1
- package/.docs/raw/reference/agents/getDefaultGenerateOptions.mdx +1 -1
- package/.docs/raw/reference/agents/getDefaultOptions.mdx +1 -1
- package/.docs/raw/reference/agents/getDefaultStreamOptions.mdx +1 -1
- package/.docs/raw/reference/agents/getDescription.mdx +1 -1
- package/.docs/raw/reference/agents/getInstructions.mdx +1 -1
- package/.docs/raw/reference/agents/getLLM.mdx +1 -1
- package/.docs/raw/reference/agents/getMemory.mdx +1 -1
- package/.docs/raw/reference/agents/getModel.mdx +1 -1
- package/.docs/raw/reference/agents/getTools.mdx +69 -0
- package/.docs/raw/reference/agents/getVoice.mdx +1 -1
- package/.docs/raw/reference/agents/listAgents.mdx +1 -1
- package/.docs/raw/reference/agents/listScorers.mdx +1 -1
- package/.docs/raw/reference/agents/listTools.mdx +2 -2
- package/.docs/raw/reference/agents/listWorkflows.mdx +1 -1
- package/.docs/raw/reference/agents/network.mdx +1 -1
- package/.docs/raw/reference/auth/auth0.mdx +1 -1
- package/.docs/raw/reference/auth/clerk.mdx +1 -1
- package/.docs/raw/reference/auth/firebase.mdx +1 -1
- package/.docs/raw/reference/auth/jwt.mdx +1 -1
- package/.docs/raw/reference/auth/supabase.mdx +1 -1
- package/.docs/raw/reference/auth/workos.mdx +1 -1
- package/.docs/raw/reference/cli/create-mastra.mdx +1 -1
- package/.docs/raw/reference/cli/mastra.mdx +4 -4
- package/.docs/raw/reference/client-js/agents.mdx +1 -1
- package/.docs/raw/reference/client-js/error-handling.mdx +1 -1
- package/.docs/raw/reference/client-js/logs.mdx +1 -1
- package/.docs/raw/reference/client-js/mastra-client.mdx +2 -2
- package/.docs/raw/reference/client-js/memory.mdx +1 -1
- package/.docs/raw/reference/client-js/observability.mdx +1 -1
- package/.docs/raw/reference/client-js/telemetry.mdx +1 -1
- package/.docs/raw/reference/client-js/tools.mdx +1 -1
- package/.docs/raw/reference/client-js/vectors.mdx +1 -1
- package/.docs/raw/reference/client-js/workflows.mdx +1 -1
- package/.docs/raw/reference/core/addGateway.mdx +59 -0
- package/.docs/raw/reference/core/getAgent.mdx +1 -1
- package/.docs/raw/reference/core/getAgentById.mdx +1 -1
- package/.docs/raw/reference/core/getDeployer.mdx +1 -1
- package/.docs/raw/reference/core/getGateway.mdx +59 -0
- package/.docs/raw/reference/core/getGatewayById.mdx +62 -0
- package/.docs/raw/reference/core/getLogger.mdx +1 -1
- package/.docs/raw/reference/core/getMCPServer.mdx +2 -2
- package/.docs/raw/reference/core/getMCPServerById.mdx +2 -2
- package/.docs/raw/reference/core/getScorer.mdx +1 -1
- package/.docs/raw/reference/core/getScorerById.mdx +1 -1
- package/.docs/raw/reference/core/getServer.mdx +2 -2
- package/.docs/raw/reference/core/getStorage.mdx +1 -1
- package/.docs/raw/reference/core/getTelemetry.mdx +1 -1
- package/.docs/raw/reference/core/getVector.mdx +1 -1
- package/.docs/raw/reference/core/getWorkflow.mdx +1 -1
- package/.docs/raw/reference/core/listAgents.mdx +1 -1
- package/.docs/raw/reference/core/listGateways.mdx +53 -0
- package/.docs/raw/reference/core/listLogs.mdx +1 -1
- package/.docs/raw/reference/core/listLogsByRunId.mdx +1 -1
- package/.docs/raw/reference/core/listMCPServers.mdx +2 -2
- package/.docs/raw/reference/core/listScorers.mdx +1 -1
- package/.docs/raw/reference/core/listVectors.mdx +1 -1
- package/.docs/raw/reference/core/listWorkflows.mdx +1 -1
- package/.docs/raw/reference/core/mastra-class.mdx +9 -1
- package/.docs/raw/reference/core/mastra-model-gateway.mdx +241 -0
- package/.docs/raw/reference/core/setLogger.mdx +1 -1
- package/.docs/raw/reference/core/setStorage.mdx +1 -1
- package/.docs/raw/reference/core/setTelemetry.mdx +1 -1
- package/.docs/raw/reference/deployer/cloudflare.mdx +1 -1
- package/.docs/raw/reference/deployer/deployer.mdx +1 -1
- package/.docs/raw/reference/deployer/netlify.mdx +1 -1
- package/.docs/raw/reference/deployer/vercel.mdx +1 -1
- package/.docs/raw/reference/evals/answer-relevancy.mdx +1 -1
- package/.docs/raw/reference/evals/answer-similarity.mdx +1 -1
- package/.docs/raw/reference/evals/bias.mdx +1 -1
- package/.docs/raw/reference/evals/completeness.mdx +1 -1
- package/.docs/raw/reference/evals/content-similarity.mdx +1 -1
- package/.docs/raw/reference/evals/context-precision.mdx +1 -1
- package/.docs/raw/reference/evals/context-relevance.mdx +1 -1
- package/.docs/raw/reference/evals/create-scorer.mdx +1 -1
- package/.docs/raw/reference/evals/faithfulness.mdx +1 -1
- package/.docs/raw/reference/evals/hallucination.mdx +1 -1
- package/.docs/raw/reference/evals/keyword-coverage.mdx +1 -1
- package/.docs/raw/reference/evals/mastra-scorer.mdx +1 -1
- package/.docs/raw/reference/evals/noise-sensitivity.mdx +1 -1
- package/.docs/raw/reference/evals/prompt-alignment.mdx +1 -1
- package/.docs/raw/reference/evals/run-evals.mdx +1 -1
- package/.docs/raw/reference/evals/textual-difference.mdx +1 -1
- package/.docs/raw/reference/evals/tone-consistency.mdx +1 -1
- package/.docs/raw/reference/evals/tool-call-accuracy.mdx +1 -1
- package/.docs/raw/reference/evals/toxicity.mdx +1 -1
- package/.docs/raw/reference/logging/pino-logger.mdx +2 -2
- package/.docs/raw/reference/memory/createThread.mdx +1 -1
- package/.docs/raw/reference/memory/deleteMessages.mdx +1 -1
- package/.docs/raw/reference/memory/getThreadById.mdx +1 -1
- package/.docs/raw/reference/memory/listThreadsByResourceId.mdx +1 -1
- package/.docs/raw/reference/memory/memory-class.mdx +1 -1
- package/.docs/raw/reference/memory/query.mdx +1 -1
- package/.docs/raw/reference/memory/recall.mdx +1 -1
- package/.docs/raw/reference/observability/tracing/configuration.mdx +2 -2
- package/.docs/raw/reference/observability/tracing/exporters/arize.mdx +1 -1
- package/.docs/raw/reference/observability/tracing/exporters/braintrust.mdx +1 -1
- package/.docs/raw/reference/observability/tracing/exporters/cloud-exporter.mdx +1 -1
- package/.docs/raw/reference/observability/tracing/exporters/console-exporter.mdx +1 -1
- package/.docs/raw/reference/observability/tracing/exporters/default-exporter.mdx +1 -1
- package/.docs/raw/reference/observability/tracing/exporters/langfuse.mdx +1 -1
- package/.docs/raw/reference/observability/tracing/exporters/langsmith.mdx +1 -1
- package/.docs/raw/reference/observability/tracing/exporters/otel.mdx +1 -1
- package/.docs/raw/reference/observability/tracing/instances.mdx +2 -2
- package/.docs/raw/reference/observability/tracing/interfaces.mdx +2 -2
- package/.docs/raw/reference/observability/tracing/processors/sensitive-data-filter.mdx +1 -1
- package/.docs/raw/reference/observability/tracing/spans.mdx +2 -2
- package/.docs/raw/reference/processors/batch-parts-processor.mdx +1 -1
- package/.docs/raw/reference/processors/language-detector.mdx +1 -1
- package/.docs/raw/reference/processors/moderation-processor.mdx +1 -1
- package/.docs/raw/reference/processors/pii-detector.mdx +1 -1
- package/.docs/raw/reference/processors/prompt-injection-detector.mdx +1 -1
- package/.docs/raw/reference/processors/system-prompt-scrubber.mdx +1 -1
- package/.docs/raw/reference/processors/token-limiter-processor.mdx +1 -1
- package/.docs/raw/reference/processors/unicode-normalizer.mdx +1 -1
- package/.docs/raw/reference/rag/chunk.mdx +1 -1
- package/.docs/raw/reference/rag/database-config.mdx +1 -1
- package/.docs/raw/reference/rag/document.mdx +1 -1
- package/.docs/raw/reference/rag/embeddings.mdx +1 -1
- package/.docs/raw/reference/rag/extract-params.mdx +1 -1
- package/.docs/raw/reference/rag/graph-rag.mdx +1 -1
- package/.docs/raw/reference/rag/metadata-filters.mdx +1 -1
- package/.docs/raw/reference/rag/rerank.mdx +1 -1
- package/.docs/raw/reference/rag/rerankWithScorer.mdx +1 -1
- package/.docs/raw/reference/storage/cloudflare-d1.mdx +1 -1
- package/.docs/raw/reference/storage/cloudflare.mdx +1 -1
- package/.docs/raw/reference/storage/dynamodb.mdx +1 -1
- package/.docs/raw/reference/storage/lance.mdx +1 -1
- package/.docs/raw/reference/storage/libsql.mdx +1 -1
- package/.docs/raw/reference/storage/mongodb.mdx +1 -1
- package/.docs/raw/reference/storage/mssql.mdx +1 -1
- package/.docs/raw/reference/storage/postgresql.mdx +1 -1
- package/.docs/raw/reference/storage/upstash.mdx +1 -1
- package/.docs/raw/reference/streaming/ChunkType.mdx +1 -1
- package/.docs/raw/reference/streaming/agents/MastraModelOutput.mdx +1 -1
- package/.docs/raw/reference/streaming/agents/stream.mdx +1 -1
- package/.docs/raw/reference/streaming/agents/streamLegacy.mdx +1 -1
- package/.docs/raw/reference/streaming/workflows/observeStream.mdx +1 -1
- package/.docs/raw/reference/streaming/workflows/observeStreamVNext.mdx +1 -1
- package/.docs/raw/reference/streaming/workflows/resumeStreamVNext.mdx +1 -1
- package/.docs/raw/reference/streaming/workflows/stream.mdx +1 -1
- package/.docs/raw/reference/streaming/workflows/streamVNext.mdx +1 -1
- package/.docs/raw/reference/templates/overview.mdx +1 -1
- package/.docs/raw/reference/tools/client.mdx +1 -1
- package/.docs/raw/reference/tools/create-tool.mdx +3 -4
- package/.docs/raw/reference/tools/document-chunker-tool.mdx +1 -1
- package/.docs/raw/reference/tools/graph-rag-tool.mdx +2 -2
- package/.docs/raw/reference/tools/mcp-client.mdx +1 -1
- package/.docs/raw/reference/tools/mcp-server.mdx +55 -6
- package/.docs/raw/reference/tools/vector-query-tool.mdx +2 -2
- package/.docs/raw/reference/vectors/astra.mdx +1 -1
- package/.docs/raw/reference/vectors/chroma.mdx +1 -1
- package/.docs/raw/reference/vectors/couchbase.mdx +1 -1
- package/.docs/raw/reference/vectors/lance.mdx +1 -1
- package/.docs/raw/reference/vectors/libsql.mdx +1 -1
- package/.docs/raw/reference/vectors/mongodb.mdx +1 -1
- package/.docs/raw/reference/vectors/opensearch.mdx +1 -1
- package/.docs/raw/reference/vectors/pg.mdx +1 -1
- package/.docs/raw/reference/vectors/pinecone.mdx +22 -2
- package/.docs/raw/reference/vectors/qdrant.mdx +1 -1
- package/.docs/raw/reference/vectors/s3vectors.mdx +1 -1
- package/.docs/raw/reference/vectors/turbopuffer.mdx +1 -1
- package/.docs/raw/reference/vectors/upstash.mdx +1 -1
- package/.docs/raw/reference/vectors/vectorize.mdx +1 -1
- package/.docs/raw/reference/voice/azure.mdx +96 -81
- package/.docs/raw/reference/voice/cloudflare.mdx +1 -1
- package/.docs/raw/reference/voice/composite-voice.mdx +1 -1
- package/.docs/raw/reference/voice/deepgram.mdx +1 -1
- package/.docs/raw/reference/voice/elevenlabs.mdx +1 -1
- package/.docs/raw/reference/voice/google-gemini-live.mdx +1 -1
- package/.docs/raw/reference/voice/google.mdx +1 -1
- package/.docs/raw/reference/voice/mastra-voice.mdx +1 -1
- package/.docs/raw/reference/voice/murf.mdx +1 -1
- package/.docs/raw/reference/voice/openai-realtime.mdx +1 -1
- package/.docs/raw/reference/voice/openai.mdx +1 -1
- package/.docs/raw/reference/voice/playai.mdx +1 -1
- package/.docs/raw/reference/voice/sarvam.mdx +1 -1
- package/.docs/raw/reference/voice/speechify.mdx +1 -1
- package/.docs/raw/reference/voice/voice.addInstructions.mdx +1 -1
- package/.docs/raw/reference/voice/voice.addTools.mdx +1 -1
- package/.docs/raw/reference/voice/voice.answer.mdx +1 -1
- package/.docs/raw/reference/voice/voice.close.mdx +1 -1
- package/.docs/raw/reference/voice/voice.connect.mdx +1 -1
- package/.docs/raw/reference/voice/voice.events.mdx +1 -1
- package/.docs/raw/reference/voice/voice.getSpeakers.mdx +1 -1
- package/.docs/raw/reference/voice/voice.listen.mdx +1 -1
- package/.docs/raw/reference/voice/voice.off.mdx +1 -1
- package/.docs/raw/reference/voice/voice.on.mdx +1 -1
- package/.docs/raw/reference/voice/voice.send.mdx +1 -1
- package/.docs/raw/reference/voice/voice.speak.mdx +1 -1
- package/.docs/raw/reference/voice/voice.updateConfig.mdx +1 -1
- package/.docs/raw/reference/workflows/run-methods/cancel.mdx +1 -1
- package/.docs/raw/reference/workflows/run-methods/resume.mdx +1 -1
- package/.docs/raw/reference/workflows/run-methods/start.mdx +1 -1
- package/.docs/raw/reference/workflows/run.mdx +1 -1
- package/.docs/raw/reference/workflows/step.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/branch.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/commit.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/create-run.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/dountil.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/dowhile.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/foreach.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/map.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/parallel.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/sendEvent.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/sleep.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/sleepUntil.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/then.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/waitForEvent.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow.mdx +2 -2
- package/.docs/raw/server-db/custom-api-routes.mdx +1 -1
- package/.docs/raw/server-db/mastra-client.mdx +2 -2
- package/.docs/raw/server-db/{production-server.mdx → mastra-server.mdx} +2 -2
- package/.docs/raw/server-db/middleware.mdx +31 -31
- package/.docs/raw/server-db/request-context.mdx +3 -3
- package/.docs/raw/server-db/storage.mdx +1 -1
- package/.docs/raw/streaming/events.mdx +1 -1
- package/.docs/raw/streaming/overview.mdx +1 -1
- package/.docs/raw/streaming/tool-streaming.mdx +1 -1
- package/.docs/raw/streaming/workflow-streaming.mdx +1 -1
- package/.docs/raw/tools-mcp/advanced-usage.mdx +1 -1
- package/.docs/raw/tools-mcp/mcp-overview.mdx +1 -1
- package/.docs/raw/tools-mcp/overview.mdx +1 -1
- package/.docs/raw/voice/overview.mdx +1 -1
- package/.docs/raw/voice/speech-to-speech.mdx +1 -1
- package/.docs/raw/voice/speech-to-text.mdx +1 -1
- package/.docs/raw/voice/text-to-speech.mdx +1 -1
- package/.docs/raw/workflows/agents-and-tools.mdx +2 -4
- package/.docs/raw/workflows/control-flow.mdx +6 -1
- package/.docs/raw/workflows/error-handling.mdx +4 -4
- package/.docs/raw/workflows/human-in-the-loop.mdx +160 -213
- package/.docs/raw/workflows/inngest-workflow.mdx +1 -1
- package/.docs/raw/workflows/input-data-mapping.mdx +1 -1
- package/.docs/raw/workflows/overview.mdx +10 -2
- package/.docs/raw/workflows/snapshots.mdx +4 -3
- package/.docs/raw/workflows/suspend-and-resume.mdx +72 -224
- package/CHANGELOG.md +26 -0
- package/dist/stdio.js +16 -18
- package/package.json +10 -14
- package/.docs/raw/deployment/serverless-platforms/index.mdx +0 -58
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "
|
|
3
|
-
description: "Learn how
|
|
2
|
+
title: "Using CopilotKit | Frameworks"
|
|
3
|
+
description: "Learn how to integrate CopilotKit with Mastra"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
import Tabs from "@theme/Tabs";
|
|
@@ -8,125 +8,99 @@ import TabItem from "@theme/TabItem";
|
|
|
8
8
|
import Steps from "@site/src/components/Steps";
|
|
9
9
|
import StepItem from "@site/src/components/StepItem";
|
|
10
10
|
|
|
11
|
-
#
|
|
11
|
+
# Using CopilotKit
|
|
12
12
|
|
|
13
|
-
CopilotKit 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.
|
|
13
|
+
[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.
|
|
14
14
|
|
|
15
15
|
Visit the [CopilotKit documentation](https://docs.copilotkit.ai/) to learn more about CopilotKit concepts, components, and advanced usage patterns.
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
:::info
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
2. Integrate CopilotKit in your Next.js app
|
|
19
|
+
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.
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
<TabItem value="mastra-server" label="Mastra Server">
|
|
21
|
+
:::
|
|
24
22
|
|
|
25
|
-
|
|
23
|
+
:::tip
|
|
26
24
|
|
|
27
|
-
|
|
25
|
+
Visit Mastra's [**"UI Dojo"**](https://ui-dojo.mastra.ai/) to see real-world examples of CopilotKit integrated with Mastra.
|
|
28
26
|
|
|
29
|
-
|
|
27
|
+
:::
|
|
30
28
|
|
|
31
|
-
|
|
32
|
-
<TabItem value="npm" label="npm">
|
|
29
|
+
## Integration Guide
|
|
33
30
|
|
|
34
|
-
|
|
35
|
-
npm install @copilotkit/react-core @copilotkit/react-ui
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
</TabItem>
|
|
39
|
-
<TabItem value="yarn" label="yarn">
|
|
40
|
-
|
|
41
|
-
```bash copy
|
|
42
|
-
yarn add @copilotkit/react-core @copilotkit/react-ui
|
|
43
|
-
```
|
|
31
|
+
Run Mastra as a standalone server and connect your Next.js frontend (with CopilotKit) to its API endpoints.
|
|
44
32
|
|
|
45
|
-
|
|
46
|
-
<TabItem value="pnpm" label="pnpm">
|
|
47
|
-
|
|
48
|
-
```bash copy
|
|
49
|
-
pnpm add @copilotkit/react-core @copilotkit/react-ui
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
</TabItem>
|
|
53
|
-
</Tabs>
|
|
54
|
-
|
|
55
|
-
</StepItem>
|
|
33
|
+
<Steps>
|
|
56
34
|
|
|
57
35
|
<StepItem>
|
|
58
36
|
|
|
59
|
-
|
|
37
|
+
Set up your directory structure. A possible directory structure could look like this:
|
|
60
38
|
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
<CopilotChat
|
|
70
|
-
labels={{
|
|
71
|
-
title: "Your Assistant",
|
|
72
|
-
initial: "Hi! 👋 How can I assist you today?",
|
|
73
|
-
}}
|
|
74
|
-
/>
|
|
75
|
-
</CopilotKit>
|
|
76
|
-
);
|
|
77
|
-
}
|
|
39
|
+
```shell
|
|
40
|
+
project-root
|
|
41
|
+
├── mastra-server
|
|
42
|
+
│ ├── src
|
|
43
|
+
│ │ └── mastra
|
|
44
|
+
│ └── package.json
|
|
45
|
+
└── my-copilot-app
|
|
46
|
+
└── package.json
|
|
78
47
|
```
|
|
79
48
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
<StepItem>
|
|
49
|
+
Bootstrap your Mastra server:
|
|
83
50
|
|
|
84
|
-
|
|
51
|
+
```bash copy
|
|
52
|
+
npx create-mastra@latest
|
|
53
|
+
```
|
|
85
54
|
|
|
86
|
-
|
|
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.
|
|
87
56
|
|
|
88
|
-
|
|
89
|
-
<TabItem value="npm" label="npm">
|
|
57
|
+
Navigate to your newly created Mastra server directory:
|
|
90
58
|
|
|
91
59
|
```bash copy
|
|
92
|
-
|
|
60
|
+
cd mastra-server # Replace with the actual directory name you provided
|
|
93
61
|
```
|
|
94
62
|
|
|
95
|
-
|
|
96
|
-
<TabItem value="yarn" label="yarn">
|
|
63
|
+
You now have a basic Mastra server project ready. You should have the following files and folders:
|
|
97
64
|
|
|
98
|
-
```
|
|
99
|
-
|
|
65
|
+
```shell
|
|
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
|
|
100
77
|
```
|
|
101
78
|
|
|
102
|
-
|
|
103
|
-
<TabItem value="pnpm" label="pnpm">
|
|
79
|
+
:::note
|
|
104
80
|
|
|
105
|
-
|
|
106
|
-
pnpm add @copilotkit/runtime @ag-ui/mastra@beta
|
|
107
|
-
```
|
|
81
|
+
Ensure that you have set the appropriate environment variables for your LLM provider in the `.env` file.
|
|
108
82
|
|
|
109
|
-
|
|
110
|
-
</Tabs>
|
|
83
|
+
:::
|
|
111
84
|
|
|
112
85
|
</StepItem>
|
|
113
86
|
|
|
114
87
|
<StepItem>
|
|
115
88
|
|
|
116
|
-
|
|
89
|
+
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):
|
|
90
|
+
|
|
91
|
+
```bash copy
|
|
92
|
+
npm install --legacy-peer-deps @ag-ui/mastra @copilotkit/runtime @ag-ui/core @ag-ui/client @ag-ui/encoder @ag-ui/langgraph @ag-ui/proto
|
|
93
|
+
```
|
|
117
94
|
|
|
118
|
-
|
|
119
|
-
import { Mastra } from "@mastra/core";
|
|
120
|
-
import { registerCopilotKit } from "@ag-ui/mastra/copilotkit";
|
|
121
|
-
import { weatherAgent } from "./agents/weather-agent";
|
|
95
|
+
In your `src/mastra/index.ts` file, register the chat route:
|
|
122
96
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
97
|
+
```typescript copy title="src/mastra/index.ts" {2,7-19}
|
|
98
|
+
import { Mastra } from '@mastra/core/mastra';
|
|
99
|
+
import { registerCopilotKit } from '@ag-ui/mastra/copilotkit';
|
|
100
|
+
// Rest of the imports...
|
|
127
101
|
|
|
128
102
|
export const mastra = new Mastra({
|
|
129
|
-
|
|
103
|
+
// Rest of the configuration...
|
|
130
104
|
server: {
|
|
131
105
|
cors: {
|
|
132
106
|
origin: "*",
|
|
@@ -134,99 +108,78 @@ export const mastra = new Mastra({
|
|
|
134
108
|
allowHeaders: ["*"],
|
|
135
109
|
},
|
|
136
110
|
apiRoutes: [
|
|
137
|
-
registerCopilotKit
|
|
138
|
-
path:
|
|
139
|
-
resourceId:
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
c.req.header("X-User-ID") || "anonymous",
|
|
144
|
-
);
|
|
145
|
-
requestContext.set("temperature-scale", "celsius");
|
|
146
|
-
},
|
|
147
|
-
}),
|
|
148
|
-
],
|
|
149
|
-
},
|
|
111
|
+
registerCopilotKit({
|
|
112
|
+
path: '/chat',
|
|
113
|
+
resourceId: 'weatherAgent'
|
|
114
|
+
})
|
|
115
|
+
]
|
|
116
|
+
}
|
|
150
117
|
});
|
|
151
118
|
```
|
|
152
119
|
|
|
120
|
+
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.
|
|
121
|
+
|
|
153
122
|
</StepItem>
|
|
154
123
|
|
|
155
124
|
<StepItem>
|
|
156
125
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
```tsx title="App.tsx" copy {5}
|
|
160
|
-
import { CopilotKitComponent } from "./components/copilotkit-component";
|
|
161
|
-
|
|
162
|
-
function App() {
|
|
163
|
-
return <CopilotKitComponent runtimeUrl="http://localhost:4111/copilotkit" />;
|
|
164
|
-
}
|
|
126
|
+
Run the Mastra server using the following command:
|
|
165
127
|
|
|
166
|
-
|
|
128
|
+
```bash copy
|
|
129
|
+
npm run dev
|
|
167
130
|
```
|
|
168
131
|
|
|
169
|
-
|
|
132
|
+
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.
|
|
170
133
|
|
|
171
134
|
</StepItem>
|
|
172
135
|
|
|
173
|
-
</Steps>
|
|
174
|
-
</TabItem>
|
|
175
|
-
|
|
176
|
-
<TabItem value="nextjs" label="Next.js">
|
|
177
|
-
|
|
178
|
-
<Steps>
|
|
179
|
-
|
|
180
136
|
<StepItem>
|
|
181
137
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
<Tabs>
|
|
185
|
-
<TabItem value="npm" label="npm">
|
|
138
|
+
Go up one directory to your project root.
|
|
186
139
|
|
|
187
140
|
```bash copy
|
|
188
|
-
|
|
141
|
+
cd ..
|
|
189
142
|
```
|
|
190
143
|
|
|
191
|
-
|
|
192
|
-
<TabItem value="yarn" label="yarn">
|
|
144
|
+
Create a new Next.js project with the name `my-copilot-app`:
|
|
193
145
|
|
|
194
146
|
```bash copy
|
|
195
|
-
|
|
147
|
+
npx create-next-app@latest my-copilot-app
|
|
196
148
|
```
|
|
197
149
|
|
|
198
|
-
|
|
199
|
-
<TabItem value="pnpm" label="pnpm">
|
|
150
|
+
Navigate to your newly created Next.js project directory:
|
|
200
151
|
|
|
201
152
|
```bash copy
|
|
202
|
-
|
|
153
|
+
cd my-copilot-app
|
|
203
154
|
```
|
|
204
155
|
|
|
205
|
-
</TabItem>
|
|
206
|
-
</Tabs>
|
|
207
|
-
|
|
208
156
|
</StepItem>
|
|
209
157
|
|
|
210
158
|
<StepItem>
|
|
211
159
|
|
|
212
|
-
|
|
160
|
+
Install the CopilotKit UI packages which you'll use to display a chat interface:
|
|
161
|
+
|
|
162
|
+
```bash copy
|
|
163
|
+
npm install @copilotkit/react-ui @copilotkit/react-core
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
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:
|
|
213
167
|
|
|
214
|
-
```
|
|
215
|
-
'use client';
|
|
168
|
+
```typescript copy title="app/page.tsx"
|
|
216
169
|
import { CopilotChat } from "@copilotkit/react-ui";
|
|
217
170
|
import { CopilotKit } from "@copilotkit/react-core";
|
|
218
171
|
import "@copilotkit/react-ui/styles.css";
|
|
219
172
|
|
|
220
|
-
export function
|
|
173
|
+
export default function Home() {
|
|
221
174
|
return (
|
|
222
175
|
<CopilotKit
|
|
223
|
-
runtimeUrl=
|
|
176
|
+
runtimeUrl="http://localhost:4111/chat"
|
|
224
177
|
agent="weatherAgent"
|
|
225
178
|
>
|
|
226
179
|
<CopilotChat
|
|
227
180
|
labels={{
|
|
228
|
-
title: "
|
|
229
|
-
initial: "Hi! 👋
|
|
181
|
+
title: "Weather Agent",
|
|
182
|
+
initial: "Hi! 👋 Ask me about the weather, forecasts, and climate.",
|
|
230
183
|
}}
|
|
231
184
|
/>
|
|
232
185
|
</CopilotKit>
|
|
@@ -238,145 +191,16 @@ export function CopilotKitComponent({ runtimeUrl }: { runtimeUrl: string}) {
|
|
|
238
191
|
|
|
239
192
|
<StepItem>
|
|
240
193
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
1. For a full-stack Next.js app with an instance of Mastra integrated into the app.
|
|
244
|
-
2. For a Next.js app with a separate Mastra server and the Mastra Client SDK.
|
|
245
|
-
|
|
246
|
-
<Tabs>
|
|
247
|
-
<TabItem value="mastra-instance" label="With a Mastra instance">
|
|
248
|
-
|
|
249
|
-
Create an API route that connects to local Mastra agents.
|
|
250
|
-
|
|
251
|
-
```typescript title="app/api/copilotkit/route.ts" copy {1-7,11-26}
|
|
252
|
-
import { mastra } from "../../mastra";
|
|
253
|
-
import {
|
|
254
|
-
CopilotRuntime,
|
|
255
|
-
ExperimentalEmptyAdapter,
|
|
256
|
-
copilotRuntimeNextJSAppRouterEndpoint,
|
|
257
|
-
} from "@copilotkit/runtime";
|
|
258
|
-
import { MastraAgent } from "@ag-ui/mastra";
|
|
259
|
-
import { NextRequest } from "next/server";
|
|
260
|
-
|
|
261
|
-
export const POST = async (req: NextRequest) => {
|
|
262
|
-
const mastraAgents = MastraAgent.getLocalAgents({
|
|
263
|
-
mastra,
|
|
264
|
-
agentId: "weatherAgent",
|
|
265
|
-
});
|
|
266
|
-
|
|
267
|
-
const runtime = new CopilotRuntime({
|
|
268
|
-
agents: mastraAgents,
|
|
269
|
-
});
|
|
270
|
-
|
|
271
|
-
const { handleRequest } = copilotRuntimeNextJSAppRouterEndpoint({
|
|
272
|
-
runtime,
|
|
273
|
-
serviceAdapter: new ExperimentalEmptyAdapter(),
|
|
274
|
-
endpoint: "/api/copilotkit",
|
|
275
|
-
});
|
|
276
|
-
|
|
277
|
-
return handleRequest(req);
|
|
278
|
-
};
|
|
279
|
-
```
|
|
280
|
-
|
|
281
|
-
</TabItem>
|
|
282
|
-
<TabItem value="mastra-client" label="With the Mastra Client SDK">
|
|
283
|
-
|
|
284
|
-
Install the Mastra Client SDK.
|
|
285
|
-
|
|
286
|
-
<Tabs>
|
|
287
|
-
<TabItem value="npm" label="npm">
|
|
288
|
-
|
|
289
|
-
```bash copy
|
|
290
|
-
npm install @mastra/client-js@beta
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
</TabItem>
|
|
294
|
-
<TabItem value="yarn" label="yarn">
|
|
295
|
-
|
|
296
|
-
```bash copy
|
|
297
|
-
yarn add @mastra/client-js@beta
|
|
298
|
-
```
|
|
299
|
-
|
|
300
|
-
</TabItem>
|
|
301
|
-
<TabItem value="pnpm" label="pnpm">
|
|
194
|
+
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:
|
|
302
195
|
|
|
303
196
|
```bash copy
|
|
304
|
-
|
|
197
|
+
npm run dev
|
|
305
198
|
```
|
|
306
199
|
|
|
307
|
-
|
|
308
|
-
</Tabs>
|
|
309
|
-
|
|
310
|
-
Create an API route that connects to remote Mastra agents:
|
|
311
|
-
|
|
312
|
-
```typescript title="app/api/copilotkit/route.ts" copy {1-7,12-26}
|
|
313
|
-
import { MastraClient } from "@mastra/client-js";
|
|
314
|
-
import {
|
|
315
|
-
CopilotRuntime,
|
|
316
|
-
ExperimentalEmptyAdapter,
|
|
317
|
-
copilotRuntimeNextJSAppRouterEndpoint,
|
|
318
|
-
} from "@copilotkit/runtime";
|
|
319
|
-
import { MastraAgent } from "@ag-ui/mastra";
|
|
320
|
-
import { NextRequest } from "next/server";
|
|
321
|
-
|
|
322
|
-
export const POST = async (req: NextRequest) => {
|
|
323
|
-
const baseUrl = process.env.MASTRA_BASE_URL || "http://localhost:4111";
|
|
324
|
-
const mastraClient = new MastraClient({ baseUrl });
|
|
325
|
-
|
|
326
|
-
const mastraAgents = await MastraAgent.getRemoteAgents({ mastraClient });
|
|
327
|
-
|
|
328
|
-
const runtime = new CopilotRuntime({
|
|
329
|
-
agents: mastraAgents,
|
|
330
|
-
});
|
|
331
|
-
|
|
332
|
-
const { handleRequest } = copilotRuntimeNextJSAppRouterEndpoint({
|
|
333
|
-
runtime,
|
|
334
|
-
serviceAdapter: new ExperimentalEmptyAdapter(),
|
|
335
|
-
endpoint: "/api/copilotkit",
|
|
336
|
-
});
|
|
337
|
-
|
|
338
|
-
return handleRequest(req);
|
|
339
|
-
};
|
|
340
|
-
```
|
|
341
|
-
|
|
342
|
-
</TabItem>
|
|
343
|
-
</Tabs>
|
|
200
|
+
You should now be able to chat with your agent in the browser.
|
|
344
201
|
|
|
345
202
|
</StepItem>
|
|
346
203
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
Use the component with the local API endpoint:
|
|
350
|
-
|
|
351
|
-
```tsx title="App.tsx" copy {5}
|
|
352
|
-
import { CopilotKitComponent } from "./components/copilotkit-component";
|
|
353
|
-
|
|
354
|
-
function App() {
|
|
355
|
-
return <CopilotKitComponent runtimeUrl="/api/copilotkit" />;
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
export default App;
|
|
359
|
-
```
|
|
360
|
-
|
|
361
|
-
</StepItem>
|
|
362
|
-
|
|
363
|
-
</Steps>
|
|
364
|
-
</TabItem>
|
|
365
|
-
</Tabs>
|
|
366
|
-
|
|
367
|
-
Start building the future!
|
|
368
|
-
|
|
369
|
-
<br />
|
|
370
|
-
|
|
371
|
-
<img
|
|
372
|
-
className="rounded-lg"
|
|
373
|
-
src="/img/copilotkit/cpkoutput.jpg"
|
|
374
|
-
alt="CopilotKit output"
|
|
375
|
-
style={{ maxWidth: "700px", width: "100%" }}
|
|
376
|
-
/>
|
|
377
|
-
|
|
378
|
-
## Next Steps
|
|
204
|
+
</Steps>
|
|
379
205
|
|
|
380
|
-
|
|
381
|
-
- [React Hooks with CopilotKit](https://docs.copilotkit.ai/reference/hooks/useCoAgent) - Advanced React integration patterns
|
|
382
|
-
- [Next.js Integration with Mastra](/docs/v1/frameworks/web-frameworks/next-js) - Full-stack Next.js setup guide
|
|
206
|
+
Congratulations! You have successfully integrated Mastra with CopilotKit using a separate server approach. Your CopilotKit frontend now communicates with a standalone Mastra agent server.
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "
|
|
2
|
+
title: "Using OpenRouter | Frameworks"
|
|
3
3
|
description: "Learn how to integrate OpenRouter with Mastra"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
import Steps from "@site/src/components/Steps";
|
|
7
7
|
import StepItem from "@site/src/components/StepItem";
|
|
8
8
|
|
|
9
|
-
#
|
|
9
|
+
# Using OpenRouter
|
|
10
10
|
|
|
11
|
-
Integrate OpenRouter with Mastra to leverage the numerous models available on OpenRouter.
|
|
11
|
+
Integrate [OpenRouter](https://openrouter.ai/) with Mastra to leverage the numerous models available on OpenRouter.
|
|
12
12
|
|
|
13
13
|
<Steps>
|
|
14
14
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Mastra Docs Server | Getting Started
|
|
2
|
+
title: "Mastra Docs Server | Getting Started"
|
|
3
3
|
description: "Learn how to use the Mastra MCP documentation server in your IDE to turn it into an agentic Mastra expert."
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -31,7 +31,7 @@ If there are no specific instructions for your tool below, you may be able to ad
|
|
|
31
31
|
"mastra": {
|
|
32
32
|
"type": "stdio",
|
|
33
33
|
"command": "npx",
|
|
34
|
-
"args": ["-y", "@mastra/mcp-docs-server"]
|
|
34
|
+
"args": ["-y", "@mastra/mcp-docs-server@beta"]
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -42,7 +42,7 @@ If there are no specific instructions for your tool below, you may be able to ad
|
|
|
42
42
|
Install using the terminal command:
|
|
43
43
|
|
|
44
44
|
```bash copy
|
|
45
|
-
claude mcp add mastra -- npx -y @mastra/mcp-docs-server
|
|
45
|
+
claude mcp add mastra -- npx -y @mastra/mcp-docs-server@beta
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
[More info on using MCP servers with Claude Code](https://docs.claude.com/en/docs/claude-code/mcp)
|
|
@@ -52,7 +52,7 @@ claude mcp add mastra -- npx -y @mastra/mcp-docs-server
|
|
|
52
52
|
1. Register it from the terminal:
|
|
53
53
|
|
|
54
54
|
```bash copy
|
|
55
|
-
codex mcp add mastra-docs -- npx -y @mastra/mcp-docs-server
|
|
55
|
+
codex mcp add mastra-docs -- npx -y @mastra/mcp-docs-server@beta
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
2. Run `codex mcp list` to confirm the server shows as `enabled`.
|
|
@@ -86,7 +86,7 @@ If you followed the automatic installation, you'll see a popup when you open cur
|
|
|
86
86
|
"mastra": {
|
|
87
87
|
"type": "stdio",
|
|
88
88
|
"command": "npx",
|
|
89
|
-
"args": ["-y", "@mastra/mcp-docs-server"]
|
|
89
|
+
"args": ["-y", "@mastra/mcp-docs-server@beta"]
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
}
|
|
@@ -135,7 +135,7 @@ After starting the MCP server, click the tools button in the Copilot pane to see
|
|
|
135
135
|
"mcpServers": {
|
|
136
136
|
"mastra": {
|
|
137
137
|
"command": "npx",
|
|
138
|
-
"args": ["-y", "@mastra/mcp-docs-server"]
|
|
138
|
+
"args": ["-y", "@mastra/mcp-docs-server@beta"]
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Quickstart | Getting Started"
|
|
3
|
+
description: Choose how to get started with Mastra - standalone server or Next.js integration.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import { CardGrid, CardGridItem } from "@site/src/components/cards/card-grid";
|
|
7
|
+
|
|
8
|
+
# Quickstart
|
|
9
|
+
|
|
10
|
+
Choose how you want to get started with Mastra:
|
|
11
|
+
|
|
12
|
+
<CardGrid columns={2}>
|
|
13
|
+
<CardGridItem
|
|
14
|
+
title="Standalone Server (Recommended)"
|
|
15
|
+
href="/guides/v1/quickstarts/standalone-server"
|
|
16
|
+
>
|
|
17
|
+
The fastest way to get started - spin up a standalone Mastra server and interact with your agents in Studio
|
|
18
|
+
</CardGridItem>
|
|
19
|
+
<CardGridItem
|
|
20
|
+
title="Next.js"
|
|
21
|
+
href="/guides/v1/quickstarts/nextjs"
|
|
22
|
+
>
|
|
23
|
+
Integrate Mastra into a Next.js app and use the AI SDK UI to build an in-app chat interface for your agents
|
|
24
|
+
</CardGridItem>
|
|
25
|
+
</CardGrid>
|
|
26
|
+
|
|
27
|
+
For more control over setup, or to add Mastra to an existing project, see the [manual installation guide](/guides/v1/guide/manual-install). You can also use [`mastra init`](/reference/v1/cli/mastra#mastra-init) for existing projects.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Studio | Getting Started
|
|
2
|
+
title: "Studio | Getting Started"
|
|
3
3
|
description: Guide on installing Mastra and setting up the necessary prerequisites for running it with various LLM providers.
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -73,7 +73,7 @@ Visualize your workflow as a graph and run it step by step with a custom input.
|
|
|
73
73
|
|
|
74
74
|
<VideoPlayer src="https://res.cloudinary.com/mastra-assets/video/upload/v1751406027/local-dev-workflows-playground_100_rbc466.mp4" />
|
|
75
75
|
|
|
76
|
-
When running a workflow, you can also view detailed traces showing tool calls, raw JSON outputs, and any errors that might have
|
|
76
|
+
When running a workflow, you can also view detailed traces showing tool calls, raw JSON outputs, and any errors that might have occurred along the way.
|
|
77
77
|
|
|
78
78
|
### Tools
|
|
79
79
|
|
|
@@ -99,7 +99,7 @@ The Scorers tab displays the results of your agent's scorers as they run. When m
|
|
|
99
99
|
|
|
100
100
|
## REST API
|
|
101
101
|
|
|
102
|
-
The local development server exposes a complete set of REST API routes, allowing you to programmatically interact with your agents, workflows, and tools during development. This is particularly helpful if you plan to deploy the Mastra server, since the local development server uses the exact same API routes as the [
|
|
102
|
+
The local development server exposes a complete set of REST API routes, allowing you to programmatically interact with your agents, workflows, and tools during development. This is particularly helpful if you plan to deploy the Mastra server, since the local development server uses the exact same API routes as the [Mastra Server](/docs/v1/server-db/mastra-server), allowing you to develop and test against it with full parity.
|
|
103
103
|
|
|
104
104
|
You can explore all available endpoints in the OpenAPI specification at http://localhost:4111/openapi.json, which details every endpoint and its request and response schemas.
|
|
105
105
|
|
|
@@ -16,7 +16,7 @@ You'll create a workflow that gathers information from a candidate's resume, the
|
|
|
16
16
|
|
|
17
17
|
- Node.js `v22.13.0` or later installed
|
|
18
18
|
- An API key from a supported [Model Provider](/models/v1)
|
|
19
|
-
- An existing Mastra project (Follow the [installation guide](/
|
|
19
|
+
- An existing Mastra project (Follow the [installation guide](/guides/v1/quickstarts/standalone-server) to set up a new project)
|
|
20
20
|
|
|
21
21
|
## Building the Workflow
|
|
22
22
|
|
|
@@ -19,7 +19,7 @@ You'll learn how to create the agent and register it with Mastra. Next, you'll i
|
|
|
19
19
|
|
|
20
20
|
- Node.js `v22.13.0` or later installed
|
|
21
21
|
- An API key from a supported [Model Provider](/models/v1)
|
|
22
|
-
- An existing Mastra project (Follow the [installation guide](/
|
|
22
|
+
- An existing Mastra project (Follow the [installation guide](/guides/v1/quickstarts/standalone-server) to set up a new project)
|
|
23
23
|
|
|
24
24
|
## Creating the Agent
|
|
25
25
|
|