@dbx-tools/appkit-mastra 0.1.58 → 0.1.67

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.
Files changed (44) hide show
  1. package/README.md +41 -1
  2. package/dist/index.d.ts +1229 -17
  3. package/dist/index.js +3348 -19
  4. package/package.json +17 -28
  5. package/src/agents.ts +7 -1
  6. package/src/config.ts +64 -0
  7. package/src/genie.ts +9 -21
  8. package/{index.ts → src/index.ts} +7 -9
  9. package/src/mcp.ts +89 -0
  10. package/src/model.ts +9 -3
  11. package/src/plugin.ts +51 -8
  12. package/src/serving.ts +5 -9
  13. package/src/statement.ts +8 -36
  14. package/dist/src/agents.d.ts +0 -316
  15. package/dist/src/agents.js +0 -470
  16. package/dist/src/chart.d.ts +0 -153
  17. package/dist/src/chart.js +0 -570
  18. package/dist/src/config.d.ts +0 -295
  19. package/dist/src/config.js +0 -55
  20. package/dist/src/genie.d.ts +0 -161
  21. package/dist/src/genie.js +0 -973
  22. package/dist/src/history.d.ts +0 -95
  23. package/dist/src/history.js +0 -278
  24. package/dist/src/memory.d.ts +0 -109
  25. package/dist/src/memory.js +0 -253
  26. package/dist/src/model.d.ts +0 -52
  27. package/dist/src/model.js +0 -198
  28. package/dist/src/observability.d.ts +0 -64
  29. package/dist/src/observability.js +0 -83
  30. package/dist/src/plugin.d.ts +0 -177
  31. package/dist/src/plugin.js +0 -554
  32. package/dist/src/processor.d.ts +0 -8
  33. package/dist/src/processor.js +0 -40
  34. package/dist/src/processors/strip-stale-charts.d.ts +0 -32
  35. package/dist/src/processors/strip-stale-charts.js +0 -98
  36. package/dist/src/server.d.ts +0 -51
  37. package/dist/src/server.js +0 -152
  38. package/dist/src/serving.d.ts +0 -65
  39. package/dist/src/serving.js +0 -79
  40. package/dist/src/statement.d.ts +0 -66
  41. package/dist/src/statement.js +0 -111
  42. package/dist/src/writer.d.ts +0 -23
  43. package/dist/src/writer.js +0 -37
  44. package/dist/tsconfig.build.tsbuildinfo +0 -1
package/README.md CHANGED
@@ -189,7 +189,7 @@ fallbacks). Its exports are re-exported here, so `ModelClass` /
189
189
  `modelForClass` and friends are available straight off
190
190
  `@dbx-tools/appkit-mastra`.
191
191
 
192
- The plugin layers on the config sources for *which* model an agent asks
192
+ The plugin layers on the config sources for _which_ model an agent asks
193
193
  for, in priority order: a per-request override, the per-agent `model`,
194
194
  the plugin `defaultModel`, then `DATABRICKS_SERVING_ENDPOINT_NAME`. With
195
195
  none set, resolution falls through to the dynamic class picker.
@@ -210,6 +210,46 @@ exposed at `GET ${basePath}/models` for model pickers; the same data is
210
210
  available in-process from a sibling plugin via
211
211
  `appkitUtils.require(this.context, mastra).exports()`.
212
212
 
213
+ ## MCP server
214
+
215
+ Set `mcp` to expose the plugin's agents (and, opt-in, its tools) as a
216
+ Mastra [`MCPServer`](https://mastra.ai/docs/tools-mcp/mcp-overview) so
217
+ external MCP clients - Claude Desktop, Cursor, the Mastra playground, or
218
+ another agent - can call them over the standard MCP transports. The
219
+ server is registered on the Mastra instance via `mcpServers`, so
220
+ `@mastra/express` serves the stock MCP routes under the plugin mount; no
221
+ bespoke route is added.
222
+
223
+ ```ts
224
+ import { mastra } from "@dbx-tools/appkit-mastra";
225
+
226
+ // Expose every registered agent as an `ask_<agentId>` MCP tool.
227
+ mastra({ mcp: true });
228
+
229
+ // Or tune the server id / metadata and expose extra tools.
230
+ mastra({
231
+ mcp: {
232
+ serverId: "analytics",
233
+ name: "Analytics MCP",
234
+ version: "2.1.0",
235
+ tools: true, // also expose ambient tools (off by default)
236
+ },
237
+ });
238
+ ```
239
+
240
+ With `mcp` enabled the transports mount under the plugin base path
241
+ (`/api/<plugin>`):
242
+
243
+ - Streamable HTTP: `POST /api/<plugin>/mcp/<serverId>/mcp`
244
+ - SSE (legacy): `GET /api/<plugin>/mcp/<serverId>/sse` +
245
+ `POST /api/<plugin>/mcp/<serverId>/messages`
246
+
247
+ `serverId` defaults to the plugin name. Requests run under the same
248
+ AppKit OBO scope as the chat routes, so an agent invoked over MCP
249
+ resolves its model and tools as the calling user. The resolved endpoint
250
+ paths are available in-process via
251
+ `appkitUtils.require(this.context, mastra).exports().getMcp()`.
252
+
213
253
  ## License
214
254
 
215
255
  Apache-2.0