@mastra/mcp-docs-server 1.3.5-alpha.1 → 1.3.5-alpha.12

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 (96) hide show
  1. package/.docs/docs/agents/code-mode.md +0 -2
  2. package/.docs/docs/agents/processors.md +8 -0
  3. package/.docs/docs/agents/tools.md +17 -0
  4. package/.docs/docs/channels.md +5 -1
  5. package/.docs/docs/develop.md +1 -3
  6. package/.docs/docs/guides/context-engineering.md +0 -2
  7. package/.docs/docs/harness/agent-controller.md +0 -2
  8. package/.docs/docs/harness/durable-agents.md +2 -0
  9. package/.docs/docs/harness/goals.md +1 -3
  10. package/.docs/docs/harness/schedules.md +0 -2
  11. package/.docs/docs/harness/signal-providers.md +1 -3
  12. package/.docs/docs/harness/signals.md +15 -3
  13. package/.docs/docs/mastra-platform/environments.md +1 -1
  14. package/.docs/docs/mastra-platform/observability.md +1 -1
  15. package/.docs/docs/memory/observational-memory.md +3 -1
  16. package/.docs/docs/memory/semantic-recall.md +35 -1
  17. package/.docs/docs/storage.md +1 -0
  18. package/.docs/docs/workflows/error-handling.md +2 -0
  19. package/.docs/docs/workflows/scheduled-workflows.md +2 -2
  20. package/.docs/integrations/databases/clickhouse-managed-postgres.md +82 -0
  21. package/.docs/integrations.md +1 -0
  22. package/.docs/models/environment-variables.md +1 -0
  23. package/.docs/models/gateways/merge-gateway.md +3 -1
  24. package/.docs/models/gateways/neon.md +2 -1
  25. package/.docs/models/gateways/netlify.md +3 -2
  26. package/.docs/models/gateways/openrouter.md +2 -3
  27. package/.docs/models/gateways/vercel.md +1 -1
  28. package/.docs/models/index.md +2 -1
  29. package/.docs/models/providers/aiand.md +17 -15
  30. package/.docs/models/providers/blueclaw.md +8 -9
  31. package/.docs/models/providers/coralbricks.md +6 -4
  32. package/.docs/models/providers/cortecs.md +5 -11
  33. package/.docs/models/providers/crossmodel.md +2 -1
  34. package/.docs/models/providers/deepinfra.md +57 -60
  35. package/.docs/models/providers/deepseek.md +1 -1
  36. package/.docs/models/providers/edenai.md +6 -3
  37. package/.docs/models/providers/engy.md +84 -0
  38. package/.docs/models/providers/kilo.md +15 -16
  39. package/.docs/models/providers/llmgateway-providers.md +12 -3
  40. package/.docs/models/providers/llmgateway.md +2 -2
  41. package/.docs/models/providers/nano-gpt.md +15 -5
  42. package/.docs/models/providers/opencode.md +2 -1
  43. package/.docs/models/providers/privatemode-ai.md +5 -5
  44. package/.docs/models/providers/requesty.md +2 -1
  45. package/.docs/models/providers/subconscious.md +8 -8
  46. package/.docs/models/providers/synthetic.md +2 -1
  47. package/.docs/models/providers/togetherai.md +21 -28
  48. package/.docs/models/providers/umans-ai-coding-plan.md +2 -1
  49. package/.docs/models/providers/umans-ai.md +2 -1
  50. package/.docs/models/providers/xai.md +3 -2
  51. package/.docs/models/providers.md +1 -0
  52. package/.docs/reference/agent-controller/agent-controller-class.md +2 -2
  53. package/.docs/reference/agent-controller/session.md +8 -2
  54. package/.docs/reference/agents/channels.md +2 -1
  55. package/.docs/reference/agents/durable-agent.md +12 -7
  56. package/.docs/reference/agents/generate.md +2 -0
  57. package/.docs/reference/cli/mastra.md +43 -5
  58. package/.docs/reference/client-js/agents.md +1 -1
  59. package/.docs/reference/client-js/observability.md +28 -0
  60. package/.docs/reference/code-sdk/acp-server.md +19 -2
  61. package/.docs/reference/code-sdk/mount-agent-controller.md +0 -2
  62. package/.docs/reference/configuration.md +1 -1
  63. package/.docs/reference/editor/mastra-editor.md +28 -0
  64. package/.docs/reference/editor/prompt-blocks.md +41 -0
  65. package/.docs/reference/editor/tool-provider.md +19 -0
  66. package/.docs/reference/file-based-agents/config.md +0 -2
  67. package/.docs/reference/file-based-agents/instructions.md +0 -2
  68. package/.docs/reference/file-based-agents/logger.md +0 -2
  69. package/.docs/reference/file-based-agents/memory.md +0 -2
  70. package/.docs/reference/file-based-agents/observability.md +0 -2
  71. package/.docs/reference/file-based-agents/processors.md +0 -2
  72. package/.docs/reference/file-based-agents/schedules.md +2 -4
  73. package/.docs/reference/file-based-agents/scorers.md +0 -2
  74. package/.docs/reference/file-based-agents/server.md +0 -2
  75. package/.docs/reference/file-based-agents/skills.md +0 -2
  76. package/.docs/reference/file-based-agents/storage.md +0 -2
  77. package/.docs/reference/file-based-agents/studio.md +0 -2
  78. package/.docs/reference/file-based-agents/subagents.md +0 -2
  79. package/.docs/reference/file-based-agents/tools.md +0 -2
  80. package/.docs/reference/file-based-agents/workflows.md +0 -2
  81. package/.docs/reference/file-based-agents/workspace.md +0 -2
  82. package/.docs/reference/memory/observational-memory.md +2 -2
  83. package/.docs/reference/observability/tracing/interfaces.md +62 -2
  84. package/.docs/reference/observability/tracing/trace-query.md +113 -2
  85. package/.docs/reference/schedules/overview.md +3 -5
  86. package/.docs/reference/server/elysia-adapter.md +18 -0
  87. package/.docs/reference/signals/create-notification-inbox-tool.md +0 -2
  88. package/.docs/reference/signals/signal-provider.md +1 -3
  89. package/.docs/reference/signals/task-signal-provider.md +1 -1
  90. package/.docs/reference/signals/webhook-signal-provider.md +1 -3
  91. package/.docs/reference/streaming/ChunkType.md +2 -0
  92. package/.docs/reference/tools/create-code-mode.md +0 -2
  93. package/.docs/reference/tools/create-tool.md +2 -0
  94. package/.docs/reference/tools/mcp-client.md +17 -0
  95. package/.docs/reference/tools/mcp-server.md +7 -1
  96. package/package.json +5 -5
@@ -557,8 +557,8 @@ interface ModelGenerationAttributes {
557
557
  /**
558
558
  * Definitions of the tools made available to the model for this generation
559
559
  * (name, description, and JSON-schema parameters), captured once per
560
- * generation. Per-step tool names live on MODEL_INFERENCE spans as
561
- * `availableTools`.
560
+ * generation. The definitions sent on each provider call live on
561
+ * MODEL_INFERENCE spans as `tools`.
562
562
  */
563
563
  tools?: ModelToolDefinition[]
564
564
 
@@ -639,6 +639,66 @@ interface ModelStepAttributes {
639
639
  }
640
640
  ```
641
641
 
642
+ ### `ModelInferenceAttributes`
643
+
644
+ Model Inference attributes - for a single call to the model provider within a step. The span covers only the provider call, so it doesn't include processors or tool executions.
645
+
646
+ ```typescript
647
+ interface ModelInferenceAttributes {
648
+ /** Model name (e.g., 'gpt-5.4', 'claude-opus-4-6') */
649
+ model?: string
650
+
651
+ /** Model provider (e.g., 'openai', 'anthropic') */
652
+ provider?: string
653
+
654
+ /** Index of the parent step in the generation (0, 1, 2, ...) */
655
+ stepIndex?: number
656
+
657
+ /** Token usage statistics */
658
+ usage?: UsageStats
659
+
660
+ /** Reason this inference finished (stop, tool-calls, length, etc.) */
661
+ finishReason?: string
662
+
663
+ /** Whether this was a streaming response */
664
+ streaming?: boolean
665
+
666
+ /** When the first token/chunk of the completion was received */
667
+ completionStartTime?: Date
668
+
669
+ /** Result warnings */
670
+ warnings?: Record<string, any>
671
+
672
+ /** Actual model used in the response (may differ from request model) */
673
+ responseModel?: string
674
+
675
+ /** Unique identifier for the response */
676
+ responseId?: string
677
+
678
+ /** Model parameters sent on the request (temperature, maxOutputTokens, topP, etc.) */
679
+ parameters?: Record<string, unknown>
680
+
681
+ /** Provider-specific options forwarded on the request */
682
+ providerOptions?: Record<string, unknown>
683
+
684
+ /** Names of tools made available to the model on this inference call */
685
+ availableTools?: string[]
686
+
687
+ /**
688
+ * Definitions of the tools sent to the provider on this inference call
689
+ * (name, description, and JSON-schema parameters), after per-step changes
690
+ * from processors, `prepareStep`, `activeTools`, and `toolChoice`.
691
+ */
692
+ tools?: ModelToolDefinition[]
693
+
694
+ /** How the model was instructed to choose tools */
695
+ toolChoice?: 'auto' | 'none' | 'required' | { type: 'tool'; toolName: string }
696
+
697
+ /** Requested response format */
698
+ responseFormat?: 'text' | 'json' | 'json_schema' | { type: string; name?: string }
699
+ }
700
+ ```
701
+
642
702
  ### `ModelChunkAttributes`
643
703
 
644
704
  Model Chunk attributes - for individual streaming chunks/events.
@@ -6,10 +6,121 @@
6
6
 
7
7
  Use `queryTraces()` or `POST /api/observability/traces/query` to find completed logical traces that match trace fields and related span, score, or feedback records. Use `queryTraceThreads()` or `POST /api/observability/threads/query` to find thread identities that qualify across multiple eligible traces.
8
8
 
9
- Both endpoints use the same authentication as other observability routes and require the `observability:read` permission. The configured observability store must support the requested trace-query or thread-query operation.
9
+ Use `querySpans()` or `POST /api/observability/spans/query` to list the individual completed spans that match a span predicate.
10
+
11
+ All three endpoints use the same authentication as other observability routes and require the `observability:read` permission. The configured observability store must support the requested trace-query, thread-query, or span-query operation.
10
12
 
11
13
  > **Thread grouping is deprecated:** The `group` option remains supported until the next major release. Use [`queryTraceThreads()`](https://mastra.ai/reference/client-js/observability) to retrieve matching thread identities in new code.
12
14
 
15
+ ## Query individual spans
16
+
17
+ `querySpans()` returns one row per matching completed span across traces, including matching child spans. Use it to list the spans themselves, for example every failed tool call in the last day.
18
+
19
+ `queryTraces()` with a `spans.some` predicate answers a different question. It returns the traces that contain at least one matching span, and it doesn't identify which spans matched. Both use the same span fields and operators.
20
+
21
+ ```typescript
22
+ const timeRange = {
23
+ from: '2026-10-01T00:00:00.000Z',
24
+ to: '2026-10-02T00:00:00.000Z',
25
+ }
26
+ const where = {
27
+ op: 'and',
28
+ args: [
29
+ { op: 'eq', left: { path: 'spanType' }, right: { literal: 'tool_call' } },
30
+ { op: 'eq', left: { path: 'status' }, right: { literal: 'error' } },
31
+ ],
32
+ } as const
33
+
34
+ const firstPage = await mastraClient.querySpans({
35
+ timeRange,
36
+ where,
37
+ orderBy: [{ field: 'startedAt', direction: 'desc' }],
38
+ page: { limit: 50 },
39
+ })
40
+
41
+ if (firstPage.page.next) {
42
+ const secondPage = await mastraClient.querySpans({
43
+ timeRange,
44
+ where,
45
+ orderBy: [{ field: 'startedAt', direction: 'desc' }],
46
+ page: { limit: 50, after: firstPage.page.next },
47
+ })
48
+ }
49
+ ```
50
+
51
+ The HTTP route accepts the same body:
52
+
53
+ ```bash
54
+ curl --request POST \
55
+ --url http://localhost:4111/api/observability/spans/query \
56
+ --header 'Authorization: Bearer <token>' \
57
+ --header 'Content-Type: application/json' \
58
+ --data '{
59
+ "timeRange": {
60
+ "from": "2026-10-01T00:00:00.000Z",
61
+ "to": "2026-10-02T00:00:00.000Z"
62
+ },
63
+ "where": { "op": "eq", "left": { "path": "spanType" }, "right": { "literal": "tool_call" } },
64
+ "page": { "limit": 50 }
65
+ }'
66
+ ```
67
+
68
+ Span queries are optional for observability stores. Call `mastraClient.getObservabilityCapabilities()` and check `capabilities.spanQuery` before showing a span list. Treat a missing `spanQuery` value as unsupported, because older servers don't report it. A server whose store or `@mastra/core` version doesn't support span queries returns `501` with code `SPAN_QUERY_UNSUPPORTED`.
69
+
70
+ The other statuses match trace queries: `400` for malformed JSON or a malformed cursor, `409` for a cursor that doesn't match the query, `413` for a body over 256 KiB, `422` with code `TRACE_QUERY_INVALID` and structured `issues` for an invalid query, `503` with code `TRACE_QUERY_RESOURCE_LIMIT` when a page exceeds a resource limit, and `504` with code `TRACE_QUERY_EXECUTION_TIMEOUT` when the database deadline is exceeded.
71
+
72
+ The server applies [trusted tenant scope](#trusted-tenant-scope) to span queries the same way it does for trace queries. A cursor created under one scope and reused under another returns `409`.
73
+
74
+ ### Query individual spans through storage
75
+
76
+ The observability domain in DuckDB and the PostgreSQL and ClickHouse v-next stores supports `querySpans(plan)`. Check `storage.getFeatures()?.includes('span-query')` before using this optional storage method.
77
+
78
+ Build the plan in trusted backend code:
79
+
80
+ ```typescript
81
+ import { planSpanQuery } from '@mastra/core/storage'
82
+
83
+ const storage = await mastra.getStorage()?.getStore('observability')
84
+ if (!storage?.getFeatures()?.includes('span-query')) {
85
+ throw new Error('This store does not support span queries')
86
+ }
87
+
88
+ const plan = planSpanQuery({
89
+ timeRange: {
90
+ from: '2026-10-01T00:00:00.000Z',
91
+ to: '2026-10-02T00:00:00.000Z',
92
+ },
93
+ where: {
94
+ op: 'eq',
95
+ left: { path: 'spanType' },
96
+ right: { literal: 'tool_call' },
97
+ },
98
+ page: { limit: 50 },
99
+ })
100
+
101
+ const { spans, page } = await storage.querySpans(plan)
102
+ ```
103
+
104
+ This example uses local, unscoped storage. For a shared database, pass `{ scope: { organizationId, resourceId } }` as the second argument to `planSpanQuery()`, using identifiers resolved by your backend's authorization. The request body can't supply trusted scope. Apply the same authorization when loading full span details with `getSpan({ traceId, spanId })`.
105
+
106
+ Span queries use the scalar fields and operators available inside `queryTraces()`'s `spans.some` predicate. They don't accept related-record clauses. Nested attributes require support in the shared predicate contract and each store.
107
+
108
+ The `timeRange` applies to each span's `startedAt`, includes `from`, excludes `to`, and can cover at most 31 days. Sort by `startedAt` or `endedAt`, in either direction. The default is `startedAt` descending. A page contains up to 1,000 rows, with a default of 100. Pass `page.next` back as `page.after` with the same filters, time range, scope, and ordering. Cursors use scope and span identifiers to break timestamp ties. They aren't a snapshot across requests. New completions can appear when the view is refreshed.
109
+
110
+ Each row contains span and trace identifiers, display fields, duration, status, and input/output previews of at most 256 Unicode characters. Truncation flags indicate when a preview is incomplete. Stores select the page before loading previews and cost. Full payloads remain available through the existing span detail method.
111
+
112
+ The `cost` field describes only that span's model-token cost:
113
+
114
+ - `available` includes `amount` and `currency`. Zero is a valid amount.
115
+ - `missing` means no matching model metrics were found.
116
+ - `unavailable` means metrics exist but a complete, unambiguous cost can't be established.
117
+
118
+ Directional token totals supply the cost. Overlapping detail metrics aren't added again. A provider-supplied `query_total` cost is counted once. Partial pricing, conflicting currencies, and ambiguous totals produce `unavailable`.
119
+
120
+ Current-record selection runs before mutable filters. PostgreSQL and ClickHouse select the greatest completed `endedAt`. PostgreSQL breaks ties with its ingestion cursor. DuckDB reconstructs the earliest start event and selects the latest ingested completed event, matching its existing span-predicate behavior. Time bounds are checked again after reconstruction. ClickHouse uses its existing completion-only, insert-only model, where equal-version retries must contain identical records. Querying spans doesn't add a table or materialized view.
121
+
122
+ Queries have a 15-second default execution deadline. PostgreSQL and ClickHouse use their existing `traceQuery.timeoutMs` setting. ClickHouse also caps each query at 512 MiB. A page with more than 50,000 matching model metrics fails with a resource-limit error instead of returning partial cost. A small page size limits returned rows, but doesn't limit the number of records the database must examine.
123
+
13
124
  ## Query traces with the client SDK
14
125
 
15
126
  Pass the query to `queryTraces()`:
@@ -718,7 +829,7 @@ PostgreSQL and ClickHouse stop advanced trace and thread queries after 15 second
718
829
 
719
830
  ## Limitations
720
831
 
721
- Both operations consider completed traces only. They don't support running traces, custom projections, embedded evidence, summaries, aggregations, measures, or custom grouping. Numbered trace pages include a total count.
832
+ Trace and thread queries consider completed traces only, and span queries consider completed spans only. They don't support running traces, custom projections, embedded evidence, summaries, aggregations, measures, or custom grouping. Numbered trace pages include a total count.
722
833
 
723
834
  ## Related
724
835
 
@@ -6,8 +6,6 @@
6
6
 
7
7
  **Added in:** `@mastra/core@1.50.0`
8
8
 
9
- > **Beta:** Breaking changes may occur without a major version bump until the API is stable.
10
-
11
9
  `mastra.schedules` is the CRUD service for persisted cron schedules. Use it to create, list, update, pause, resume, manually run, and delete schedules for agents or workflows.
12
10
 
13
11
  For usage patterns and concepts, see [Schedules](https://mastra.ai/docs/harness/schedules).
@@ -139,13 +137,13 @@ const schedules = await mastra.schedules.list({
139
137
 
140
138
  **filter.name** (`string`): Return only agent schedules with this label.
141
139
 
142
- **filter.status** (`'active' | 'paused'`): Return only schedules with this status.
140
+ **filter.status** (`'active' | 'paused' | 'completed'`): Return only schedules with this status. The default listing omits completed schedules.
143
141
 
144
142
  ### Update schedules
145
143
 
146
144
  #### `update(id, patch)`
147
145
 
148
- Updates a schedule. Changing `cron` or `timezone` recomputes the next fire time. Updating `status` from `paused` to `active` also recomputes the next fire time.
146
+ Updates a schedule. Changing `cron` or `timezone` recomputes the next fire time. Updating `status` from `paused` to `active` also recomputes the next fire time. A schedule becomes `completed` once its cron has no future occurrence. A cadence edit that leaves no future occurrence completes the row even when it was `paused`. Editing the cadence of a completed schedule reactivates it when the new cadence can still fire, and leaves it completed when it can't.
149
147
 
150
148
  ```typescript
151
149
  const updated = await mastra.schedules.update('pinger', {
@@ -170,7 +168,7 @@ const paused = await mastra.schedules.pause('pinger')
170
168
 
171
169
  #### `resume(id)`
172
170
 
173
- Resumes a paused schedule and recomputes the next fire time from the current time.
171
+ Resumes a paused schedule and recomputes the next fire time from the current time. A paused schedule whose cron has no future occurrence is completed instead of resumed.
174
172
 
175
173
  ```typescript
176
174
  const active = await mastra.schedules.resume('pinger')
@@ -130,6 +130,24 @@ app.get('/custom/public', async ctx => {
130
130
  })
131
131
  ```
132
132
 
133
+ When the auth provider refreshes an expired session, `createAuthMiddleware()` forwards the refreshed session headers (such as `Set-Cookie`) to the response, including error responses. `MastraServer` registers the `applyAuthRefreshHeaders` hook during `init()`, so routes added after `init()` get these headers alongside any cookies your route sets.
134
+
135
+ If you use `createAuthMiddleware()` without `MastraServer`, register the hook yourself before defining routes:
136
+
137
+ ```typescript
138
+ import { Elysia } from 'elysia'
139
+ import { applyAuthRefreshHeaders, createAuthMiddleware } from '@mastra/elysia'
140
+ import { mastra } from './mastra'
141
+
142
+ const app = new Elysia()
143
+ .onAfterHandle({ as: 'global' }, applyAuthRefreshHeaders)
144
+ .onError({ as: 'global' }, applyAuthRefreshHeaders)
145
+
146
+ app.get('/custom/protected', () => ({ ok: true }), {
147
+ beforeHandle: createAuthMiddleware({ mastra }),
148
+ })
149
+ ```
150
+
133
151
  ## Accessing context
134
152
 
135
153
  In Elysia handlers registered after `init()`, access Mastra context from the handler context:
@@ -6,8 +6,6 @@
6
6
 
7
7
  **Added in:** `@mastra/core@1.39.0`
8
8
 
9
- > **Beta:** Breaking changes may occur without a major version bump until the API is stable.
10
-
11
9
  `createNotificationInboxTool()` creates a Mastra tool that lets an agent inspect and manage notification inbox records for the current thread.
12
10
 
13
11
  Use this tool with durable notification signals. For sending notification records, see [`Agent.sendNotificationSignal()`](https://mastra.ai/reference/agents/agent).
@@ -4,9 +4,7 @@
4
4
 
5
5
  # SignalProvider
6
6
 
7
- **Added in:** `@mastra/core@1.39.0`
8
-
9
- > **Beta:** Breaking changes may occur without a major version bump until the API is stable.
7
+ **Added in:** `@mastra/core@1.42.0`
10
8
 
11
9
  Abstract base class for building signal providers. A signal provider monitors external sources (APIs, webhooks, event streams) and pushes notification signals into agent threads through a built-in subscription registry.
12
10
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  # TaskSignalProvider
6
6
 
7
- > **Beta:** Breaking changes may occur without a major version bump until the API is stable.
7
+ **Added in:** `@mastra/core@1.42.0`
8
8
 
9
9
  Bundles the built-in task tools (`task_write`, `task_update`, `task_complete`, `task_check`) and the `TaskStateProcessor` behind a single agent registration. Use it to add a structured, durable task list to an agent without wiring the tools and processor separately.
10
10
 
@@ -4,9 +4,7 @@
4
4
 
5
5
  # WebhookSignalProvider
6
6
 
7
- **Added in:** `@mastra/core@1.39.0`
8
-
9
- > **Beta:** Breaking changes may occur without a major version bump until the API is stable.
7
+ **Added in:** `@mastra/core@1.42.0`
10
8
 
11
9
  Concrete signal provider for push-based event delivery. Routes incoming webhook payloads to subscribed agent threads by matching the payload against a configurable resource ID extractor.
12
10
 
@@ -14,6 +14,8 @@ All chunks include these base properties:
14
14
 
15
15
  **runId** (`string`): Unique identifier for this execution run
16
16
 
17
+ **traceId** (`string`): Trace ID of the run that produced this chunk, when tracing is enabled. Not set on custom data-\* chunks.
18
+
17
19
  **from** (`ChunkFrom`): Source of the chunk
18
20
 
19
21
  **from.AGENT** (`'AGENT'`): Chunk from agent execution
@@ -6,8 +6,6 @@
6
6
 
7
7
  **Added in:** `@mastra/core@1.38.0`
8
8
 
9
- > **Beta:** Breaking changes may occur without a major version bump until the API is stable.
10
-
11
9
  The `createCodeMode()` function returns a tool and generated instructions that let an agent run multi-tool computations as one TypeScript function. The generated code runs in a workspace sandbox, and each `external_*` call runs the real tool on the host with validation, request context, and tracing.
12
10
 
13
11
  For a conceptual overview, see [Code mode](https://mastra.ai/docs/agents/code-mode).
@@ -49,6 +49,8 @@ The first `execute` parameter is the validated value from `inputSchema`. Destruc
49
49
 
50
50
  **strict** (`boolean`): When true, Mastra enables strict tool input generation on model adapters that support it. This helps supported providers return arguments that match the tool schema more closely.
51
51
 
52
+ **outputValidation** (`'strict' | 'warn'`): How a result that fails outputSchema validation is handled. Both modes log a warning. 'strict' replaces the result with a validation error object. 'warn' returns the tool's actual result unchanged, for tools whose side effects have already happened. (Default: `'strict'`)
53
+
52
54
  **toModelOutput** (`(output: TSchemaOut) => unknown`): Optional function that transforms the tool's execute output before it is sent back to the model. Use this to return text, json, or content-shaped outputs (including multimodal parts like images/files) to the model while still keeping the full raw output in your application code.
53
55
 
54
56
  **transform** (`ToolPayloadTransform`): Optional target-aware transform for tool payloads before they leave runtime for display streams or user-visible transcript messages. Configure display and transcript transforms for phases such as input, inputDelta, output, error, approval, suspend, and resume.
@@ -367,6 +367,23 @@ const instructionsByServer = mcp.getServerInstructions()
367
367
  console.log(instructionsByServer.db)
368
368
  ```
369
369
 
370
+ ### `getServerInfo()`
371
+
372
+ Returns the identity each configured MCP server announced when it connected (its `serverInfo`, from the `server/discover` result or, for servers on an older revision, the `initialize` handshake): `name` and `version`, plus `title`, `description`, `websiteUrl`, and `icons` when the server provides them. A server's entry is `undefined` if it hasn't connected yet, or if it connected over the `2026-07-28` revision without announcing an identity, which that revision allows. Don't use it to check whether a server is connected. The values come from the remote server and aren't validated, so treat icon and website URLs as untrusted.
373
+
374
+ ```typescript
375
+ getServerInfo(): Record<string, MCPServerImplementation | undefined>
376
+ ```
377
+
378
+ Example:
379
+
380
+ ```typescript
381
+ await mcp.listTools()
382
+
383
+ const info = mcp.getServerInfo()
384
+ console.log(info.myServer?.title, info.myServer?.version)
385
+ ```
386
+
370
387
  ### `authenticate()`
371
388
 
372
389
  Runs the interactive OAuth authorization-code flow for a server whose `MCPOAuthClientProvider` uses a loopback redirect URL. A local callback server passes the authorization URL to the provider's `onRedirectToAuthorization` callback and waits for the browser to return the code. It then exchanges the code for tokens and reconnects. See [Interactive browser authentication](#interactive-browser-authentication).
@@ -75,7 +75,13 @@ The constructor accepts an `MCPServerConfig` object with the following propertie
75
75
 
76
76
  **workflows** (`Record<string, Workflow>`): An object where keys are workflow identifiers and values are Mastra Workflow instances. Each workflow is converted into a tool named run\_\<workflowKey>. The workflow's inputSchema becomes the tool's input schema. The workflow \*\*must\*\* have a non-empty description string property, which is used for the tool's description. If a workflow's description is missing or empty, an error will be thrown. The tool executes the workflow by calling workflow\.createRun() followed by run.start({ inputData: \<tool\_input> }). If a tool name derived from an agent or workflow (e.g., ask\_myAgent or run\_myWorkflow) collides with an explicitly defined tool name or another derived name, the explicitly defined tool takes precedence, and a warning is logged. Agents/workflows leading to subsequent collisions are skipped.
77
77
 
78
- **description** (`string`): Optional description of what the MCP server does.
78
+ **description** (`string`): Optional description of what the MCP server does. Announced to MCP clients as part of the server's identity and returned in the registry server info.
79
+
80
+ **title** (`string`): Optional human-readable display title announced to MCP clients (e.g., 'Weather Server'). Clients fall back to name when it isn't set.
81
+
82
+ **websiteUrl** (`string`): Optional URL of the server's website, announced to MCP clients.
83
+
84
+ **icons** (`{ src: string; mimeType?: string; sizes?: string[]; theme?: 'light' | 'dark' }[]`): Optional icons clients can display for the server. src is an https: URL or a data: URI; sizes takes values like '48x48' or 'any'.
79
85
 
80
86
  **instructions** (`string`): Optional instructions describing how to use the server and its features.
81
87
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/mcp-docs-server",
3
- "version": "1.3.5-alpha.1",
3
+ "version": "1.3.5-alpha.12",
4
4
  "description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -26,8 +26,8 @@
26
26
  "@mastra/mcp-legacy": "npm:@mastra/mcp@^1.18.0",
27
27
  "local-pkg": "^1.1.2",
28
28
  "zod": "^4.6.4",
29
- "@mastra/core": "1.75.0-alpha.0",
30
- "@mastra/mcp": "^2.1.2"
29
+ "@mastra/core": "1.75.0-alpha.5",
30
+ "@mastra/mcp": "^2.2.0-alpha.1"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@hono/node-server": "^2.0.0",
@@ -44,8 +44,8 @@
44
44
  "typescript": "^7.0.2",
45
45
  "vitest": "4.1.11",
46
46
  "@internal/lint": "0.0.140",
47
- "@mastra/core": "1.75.0-alpha.0",
48
- "@internal/types-builder": "0.0.115"
47
+ "@internal/types-builder": "0.0.115",
48
+ "@mastra/core": "1.75.0-alpha.5"
49
49
  },
50
50
  "homepage": "https://mastra.ai",
51
51
  "repository": {