Variable: mastra
constmastra:ToPlugin<typeofMastraPlugin,MastraPluginConfig,"mastra">
Register the Mastra plugin on an AppKit app. Mounts the agents, the
/route/* chat surface, and (unless disabled) the MCP transport under
/api/mastra.
Examples
Section titled “Examples”Minimal app
import { createApp } from "@databricks/appkit";import { mastra } from "@dbx-tools/appkit-mastra";
// No `agents`: a single built-in `default` analyst is registered, so the// chat endpoint works out of the box.const app = await createApp({ plugins: [mastra()] });Two agents, a pinned model, and Genie
import { createApp, lakebase } from "@databricks/appkit";import { createAgent, mastra } from "@dbx-tools/appkit-mastra";
const app = await createApp({ plugins: [ lakebase(), mastra({ defaultModel: "databricks-claude-sonnet-4-6", defaultAgent: "analyst", genieSpaces: { sales: { spaceId: "01ef...", hint: "orders, returns" } }, agents: { analyst: createAgent({ instructions: "You answer questions about sales.", tools(plugins) { return { ...plugins.genie?.toolkit() }; }, }), helper: createAgent({ instructions: "You explain the analyst's answers." }), }, }), ],});