@dbx-tools/appkit-mastra 0.1.58 → 0.1.68

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 (51) 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 -30
  5. package/dist/src/agents.d.ts +0 -316
  6. package/dist/src/agents.js +0 -470
  7. package/dist/src/chart.d.ts +0 -153
  8. package/dist/src/chart.js +0 -570
  9. package/dist/src/config.d.ts +0 -295
  10. package/dist/src/config.js +0 -55
  11. package/dist/src/genie.d.ts +0 -161
  12. package/dist/src/genie.js +0 -973
  13. package/dist/src/history.d.ts +0 -95
  14. package/dist/src/history.js +0 -278
  15. package/dist/src/memory.d.ts +0 -109
  16. package/dist/src/memory.js +0 -253
  17. package/dist/src/model.d.ts +0 -52
  18. package/dist/src/model.js +0 -198
  19. package/dist/src/observability.d.ts +0 -64
  20. package/dist/src/observability.js +0 -83
  21. package/dist/src/plugin.d.ts +0 -177
  22. package/dist/src/plugin.js +0 -554
  23. package/dist/src/processor.d.ts +0 -8
  24. package/dist/src/processor.js +0 -40
  25. package/dist/src/processors/strip-stale-charts.d.ts +0 -32
  26. package/dist/src/processors/strip-stale-charts.js +0 -98
  27. package/dist/src/server.d.ts +0 -51
  28. package/dist/src/server.js +0 -152
  29. package/dist/src/serving.d.ts +0 -65
  30. package/dist/src/serving.js +0 -79
  31. package/dist/src/statement.d.ts +0 -66
  32. package/dist/src/statement.js +0 -111
  33. package/dist/src/writer.d.ts +0 -23
  34. package/dist/src/writer.js +0 -37
  35. package/dist/tsconfig.build.tsbuildinfo +0 -1
  36. package/index.ts +0 -27
  37. package/src/agents.ts +0 -772
  38. package/src/chart.ts +0 -716
  39. package/src/config.ts +0 -320
  40. package/src/genie.ts +0 -1123
  41. package/src/history.ts +0 -322
  42. package/src/memory.ts +0 -293
  43. package/src/model.ts +0 -257
  44. package/src/observability.ts +0 -114
  45. package/src/plugin.ts +0 -623
  46. package/src/processor.ts +0 -46
  47. package/src/processors/strip-stale-charts.ts +0 -102
  48. package/src/server.ts +0 -195
  49. package/src/serving.ts +0 -104
  50. package/src/statement.ts +0 -120
  51. package/src/writer.ts +0 -44
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