@mastra/mcp-docs-server 1.1.45 → 1.1.46-alpha.0
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/docs/agents/code-mode.md +2 -0
- package/.docs/docs/agents/signal-providers.md +222 -0
- package/.docs/docs/agents/signals.md +63 -189
- package/.docs/docs/getting-started/build-with-ai.md +2 -2
- package/.docs/docs/mastra-platform/configuration.md +1 -1
- package/.docs/docs/mastra-platform/overview.md +1 -1
- package/.docs/docs/observability/config.md +139 -0
- package/.docs/docs/observability/{tracing → integrations}/bridges/datadog.md +7 -7
- package/.docs/docs/observability/{tracing → integrations}/bridges/otel.md +3 -3
- package/.docs/docs/observability/{tracing → integrations}/exporters/datadog.md +1 -1
- package/.docs/docs/observability/{tracing → integrations}/exporters/mastra-platform.md +1 -1
- package/.docs/docs/observability/{tracing → integrations}/exporters/mastra-storage.md +1 -1
- package/.docs/docs/observability/{tracing → integrations}/exporters/otel.md +4 -4
- package/.docs/docs/observability/{tracing → integrations}/exporters/posthog.md +16 -0
- package/.docs/docs/observability/integrations/overview.md +45 -0
- package/.docs/docs/observability/metrics/overview.md +1 -1
- package/.docs/docs/observability/metrics/querying.md +18 -0
- package/.docs/docs/observability/overview.md +8 -4
- package/.docs/docs/observability/storage.md +79 -0
- package/.docs/docs/observability/tracing/overview.md +98 -390
- package/.docs/guides/guide/signal-provider.md +217 -0
- package/.docs/guides/migrations/upgrade-to-v1/tracing.md +11 -11
- package/.docs/reference/agents/agent.md +150 -2
- package/.docs/reference/client-js/agents.md +4 -0
- package/.docs/reference/core/mastra-class.md +28 -0
- package/.docs/reference/harness/harness-class.md +1 -1
- package/.docs/reference/index.md +3 -0
- package/.docs/reference/observability/tracing/bridges/datadog.md +2 -2
- package/.docs/reference/observability/tracing/bridges/otel.md +2 -2
- package/.docs/reference/observability/tracing/configuration.md +1 -1
- package/.docs/reference/observability/tracing/exporters/arize.md +1 -1
- package/.docs/reference/observability/tracing/exporters/arthur.md +1 -1
- package/.docs/reference/observability/tracing/exporters/cloud-exporter.md +1 -1
- package/.docs/reference/observability/tracing/exporters/console-exporter.md +1 -1
- package/.docs/reference/observability/tracing/exporters/default-exporter.md +1 -1
- package/.docs/reference/observability/tracing/exporters/mastra-platform-exporter.md +1 -1
- package/.docs/reference/observability/tracing/exporters/mastra-storage-exporter.md +1 -1
- package/.docs/reference/observability/tracing/exporters/otel.md +2 -2
- package/.docs/reference/observability/tracing/span-filtering.md +1 -1
- package/.docs/reference/pubsub/base.md +24 -0
- package/.docs/reference/pubsub/caching-pubsub.md +6 -0
- package/.docs/reference/pubsub/event-emitter.md +36 -1
- package/.docs/reference/signals/create-notification-inbox-tool.md +67 -0
- package/.docs/reference/signals/signal-provider.md +406 -0
- package/.docs/reference/signals/webhook-signal-provider.md +137 -0
- package/.docs/reference/storage/clickhouse.md +3 -3
- package/.docs/reference/storage/composite.md +1 -1
- package/.docs/reference/storage/duckdb.md +1 -1
- package/.docs/reference/storage/libsql.md +1 -1
- package/.docs/reference/storage/postgresql.md +1 -1
- package/CHANGELOG.md +8 -0
- package/package.json +7 -7
- /package/.docs/docs/observability/{tracing → integrations}/exporters/arize.md +0 -0
- /package/.docs/docs/observability/{tracing → integrations}/exporters/arthur.md +0 -0
- /package/.docs/docs/observability/{tracing → integrations}/exporters/braintrust.md +0 -0
- /package/.docs/docs/observability/{tracing → integrations}/exporters/laminar.md +0 -0
- /package/.docs/docs/observability/{tracing → integrations}/exporters/langfuse.md +0 -0
- /package/.docs/docs/observability/{tracing → integrations}/exporters/langsmith.md +0 -0
- /package/.docs/docs/observability/{tracing → integrations}/exporters/sentry.md +0 -0
- /package/.docs/docs/observability/{tracing → integrations}/processors/sensitive-data-filter.md +0 -0
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# WebhookSignalProvider
|
|
2
|
+
|
|
3
|
+
**Added in:** `@mastra/core@1.39.0`
|
|
4
|
+
|
|
5
|
+
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.
|
|
6
|
+
|
|
7
|
+
Extends [`SignalProvider`](https://mastra.ai/reference/signals/signal-provider) with public subscription management and a built-in `handleWebhook()` implementation.
|
|
8
|
+
|
|
9
|
+
## Usage example
|
|
10
|
+
|
|
11
|
+
Route GitHub webhook events to subscribed threads:
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { WebhookSignalProvider } from '@mastra/core/signals'
|
|
15
|
+
|
|
16
|
+
const webhookProvider = new WebhookSignalProvider({
|
|
17
|
+
extractResourceId: payload => `${payload.repository?.full_name}`,
|
|
18
|
+
buildNotification: (payload, subscription) => ({
|
|
19
|
+
source: 'github-webhook',
|
|
20
|
+
kind: payload.action ?? 'event',
|
|
21
|
+
summary: `${payload.action} on ${subscription.externalResourceId}`,
|
|
22
|
+
payload,
|
|
23
|
+
}),
|
|
24
|
+
})
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Register with an agent and subscribe a thread:
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
import { Agent } from '@mastra/core/agent'
|
|
31
|
+
|
|
32
|
+
const agent = new Agent({
|
|
33
|
+
signals: [webhookProvider],
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
// subscribe a thread to a specific repo
|
|
37
|
+
webhookProvider.subscribeThread({ threadId: 'thread-1', resourceId: 'user-1' }, 'mastra-ai/mastra')
|
|
38
|
+
|
|
39
|
+
// handle an incoming webhook
|
|
40
|
+
const result = await webhookProvider.handleWebhook({
|
|
41
|
+
body: { repository: { full_name: 'mastra-ai/mastra' }, action: 'push' },
|
|
42
|
+
headers: {},
|
|
43
|
+
})
|
|
44
|
+
// result.matched === 1
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Constructor parameters
|
|
48
|
+
|
|
49
|
+
**id** (`string`): Unique identifier for the provider instance. (Default: `'webhook-signals'`)
|
|
50
|
+
|
|
51
|
+
**name** (`string`): Human-readable name. (Default: `'Webhook Signals'`)
|
|
52
|
+
|
|
53
|
+
**extractResourceId** (`(payload: unknown) => string | string[] | undefined`): Extract the external resource ID from a webhook payload. Return \`undefined\` to skip the event. Can return an array to match multiple resources. (Default: ``Returns `payload.resource` or `payload.externalResourceId` if present``)
|
|
54
|
+
|
|
55
|
+
**buildNotification** (`(payload: unknown, subscription: SignalSubscription) => SendNotificationSignalInput`): Build the notification object from a webhook payload and the matched subscription. (Default: `` Returns `{ source: id, kind: 'webhook-event', summary, payload }` ``)
|
|
56
|
+
|
|
57
|
+
## Methods
|
|
58
|
+
|
|
59
|
+
### Subscription management
|
|
60
|
+
|
|
61
|
+
#### `subscribeThread(target, externalResourceId, metadata?)`
|
|
62
|
+
|
|
63
|
+
Subscribe a thread to receive webhook events for a specific external resource.
|
|
64
|
+
|
|
65
|
+
```typescript
|
|
66
|
+
webhookProvider.subscribeThread(
|
|
67
|
+
{ threadId: 'thread-1', resourceId: 'user-1' },
|
|
68
|
+
'mastra-ai/mastra',
|
|
69
|
+
{ watchType: 'push' },
|
|
70
|
+
)
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Returns: `SignalSubscription`
|
|
74
|
+
|
|
75
|
+
**target** (`SignalProviderTarget`): The thread to subscribe. Must include \`threadId\` and \`resourceId\`.
|
|
76
|
+
|
|
77
|
+
**externalResourceId** (`string`): The external resource to monitor (for example, a repository full name).
|
|
78
|
+
|
|
79
|
+
**metadata** (`Record<string, unknown>`): Additional data to store with the subscription.
|
|
80
|
+
|
|
81
|
+
#### `unsubscribeThread(target, externalResourceId)`
|
|
82
|
+
|
|
83
|
+
Unsubscribe a thread from a specific external resource.
|
|
84
|
+
|
|
85
|
+
```typescript
|
|
86
|
+
const removed = webhookProvider.unsubscribeThread(
|
|
87
|
+
{ threadId: 'thread-1', resourceId: 'user-1' },
|
|
88
|
+
'mastra-ai/mastra',
|
|
89
|
+
)
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Returns: `boolean`
|
|
93
|
+
|
|
94
|
+
### Webhook handling
|
|
95
|
+
|
|
96
|
+
#### `handleWebhook(request)`
|
|
97
|
+
|
|
98
|
+
Process an incoming webhook request. Extracts the resource ID from the payload, finds matching subscriptions, builds a notification for each, and calls `notify()`.
|
|
99
|
+
|
|
100
|
+
```typescript
|
|
101
|
+
const result = await webhookProvider.handleWebhook({
|
|
102
|
+
body: { repository: { full_name: 'mastra-ai/mastra' }, action: 'push' },
|
|
103
|
+
headers: { 'x-github-event': 'push' },
|
|
104
|
+
})
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Returns: `Promise<{ status: number; body: { matched: number } }>`
|
|
108
|
+
|
|
109
|
+
Returns `{ status: 200, body: { matched: N } }` where `N` is the number of subscriptions that received notifications. Returns `matched: 0` when no resource ID could be extracted or no subscriptions match.
|
|
110
|
+
|
|
111
|
+
**request** (`object`): The incoming webhook request.
|
|
112
|
+
|
|
113
|
+
**request.body** (`unknown`): The parsed webhook payload.
|
|
114
|
+
|
|
115
|
+
**request.headers** (`Record<string, string>`): HTTP headers from the webhook request.
|
|
116
|
+
|
|
117
|
+
### Static signal factories
|
|
118
|
+
|
|
119
|
+
#### `WebhookSignalProvider.signals.subscribe(externalResourceId)`
|
|
120
|
+
|
|
121
|
+
Create a reactive signal input that subscribes the current thread to an external resource.
|
|
122
|
+
|
|
123
|
+
```typescript
|
|
124
|
+
const signal = WebhookSignalProvider.signals.subscribe('mastra-ai/mastra')
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Returns: `{ type: 'reactive'; tagName: string; contents: string; attributes: { resource: string } }`
|
|
128
|
+
|
|
129
|
+
#### `WebhookSignalProvider.signals.unsubscribe(externalResourceId)`
|
|
130
|
+
|
|
131
|
+
Create a reactive signal input that unsubscribes the current thread from an external resource.
|
|
132
|
+
|
|
133
|
+
```typescript
|
|
134
|
+
const signal = WebhookSignalProvider.signals.unsubscribe('mastra-ai/mastra')
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Returns: `{ type: 'reactive'; tagName: string; contents: string; attributes: { resource: string } }`
|
|
@@ -81,7 +81,7 @@ export const mastra = new Mastra({
|
|
|
81
81
|
})
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
-
`MastraStorageExporter` automatically selects the `insert-only` strategy when ClickHouse is the observability backend, which gives the highest write throughput. See [tracing strategies](https://mastra.ai/docs/observability/
|
|
84
|
+
`MastraStorageExporter` automatically selects the `insert-only` strategy when ClickHouse is the observability backend, which gives the highest write throughput. See [tracing strategies](https://mastra.ai/docs/observability/integrations/exporters/mastra-storage) for details.
|
|
85
85
|
|
|
86
86
|
### Observability with the legacy domain
|
|
87
87
|
|
|
@@ -290,11 +290,11 @@ ClickHouse is the recommended backend for production observability:
|
|
|
290
290
|
- **Insert-only strategy**: `MastraStorageExporter` writes completed spans in batches without per-span updates, which is the highest-throughput strategy available.
|
|
291
291
|
- **Columnar compression**: Span attributes and log payloads compress well compared to the same data in row-oriented databases.
|
|
292
292
|
|
|
293
|
-
For the full strategy matrix and production guidance, see the [`MastraStorageExporter` reference](https://mastra.ai/docs/observability/
|
|
293
|
+
For the full strategy matrix and production guidance, see the [`MastraStorageExporter` reference](https://mastra.ai/docs/observability/integrations/exporters/mastra-storage).
|
|
294
294
|
|
|
295
295
|
## Related
|
|
296
296
|
|
|
297
297
|
- [Storage overview](https://mastra.ai/reference/storage/overview)
|
|
298
298
|
- [Composite storage](https://mastra.ai/reference/storage/composite)
|
|
299
|
-
- [`MastraStorageExporter`](https://mastra.ai/docs/observability/
|
|
299
|
+
- [`MastraStorageExporter`](https://mastra.ai/docs/observability/integrations/exporters/mastra-storage)
|
|
300
300
|
- [Observability overview](https://mastra.ai/docs/observability/overview)
|
|
@@ -242,4 +242,4 @@ const storage = new MastraCompositeStore({
|
|
|
242
242
|
|
|
243
243
|
> **Note:** `ObservabilityStorageClickhouseVNext` is the current observability domain implementation. The legacy `ObservabilityStorageClickhouse` class is also exported and remains supported for projects that have not migrated. See the [ClickHouse storage reference](https://mastra.ai/reference/storage/clickhouse) for details.
|
|
244
244
|
|
|
245
|
-
> **Info:** This approach is also required when using storage providers that don't support observability (like Convex, DynamoDB, or Cloudflare). See the [MastraStorageExporter documentation](https://mastra.ai/docs/observability/
|
|
245
|
+
> **Info:** This approach is also required when using storage providers that don't support observability (like Convex, DynamoDB, or Cloudflare). See the [MastraStorageExporter documentation](https://mastra.ai/docs/observability/integrations/exporters/mastra-storage) for the full list of supported providers.
|
|
@@ -139,7 +139,7 @@ await duckdb.observability.init()
|
|
|
139
139
|
|
|
140
140
|
## Observability strategy
|
|
141
141
|
|
|
142
|
-
DuckDB supports the `event-sourced` strategy used by `MastraStorageExporter`, which buffers spans in memory and writes completed events in batches. This is appropriate for development-scale traffic. For high-volume production workloads, see [`MastraStorageExporter` storage provider support](https://mastra.ai/docs/observability/
|
|
142
|
+
DuckDB supports the `event-sourced` strategy used by `MastraStorageExporter`, which buffers spans in memory and writes completed events in batches. This is appropriate for development-scale traffic. For high-volume production workloads, see [`MastraStorageExporter` storage provider support](https://mastra.ai/docs/observability/integrations/exporters/mastra-storage).
|
|
143
143
|
|
|
144
144
|
## Related
|
|
145
145
|
|
|
@@ -136,6 +136,6 @@ const thread = await memoryStore?.getThreadById({ threadId: '...' })
|
|
|
136
136
|
|
|
137
137
|
## Observability
|
|
138
138
|
|
|
139
|
-
libSQL supports observability and is ideal for local development. Use the `realtime` [tracing strategy](https://mastra.ai/docs/observability/
|
|
139
|
+
libSQL supports observability and is ideal for local development. Use the `realtime` [tracing strategy](https://mastra.ai/docs/observability/integrations/exporters/mastra-storage) for immediate visibility while debugging.
|
|
140
140
|
|
|
141
141
|
For production environments with higher trace volumes, consider using [PostgreSQL](https://mastra.ai/reference/storage/postgresql) or [ClickHouse via composite storage](https://mastra.ai/reference/storage/composite).
|
|
@@ -140,7 +140,7 @@ The storage implementation handles schema creation and updates automatically. It
|
|
|
140
140
|
|
|
141
141
|
PostgreSQL supports observability and can handle low trace volumes. Throughput capacity depends on deployment factors such as hardware, schema design, indexing, and retention policies, and should be validated for your specific environment. For high-volume production environments, consider:
|
|
142
142
|
|
|
143
|
-
- Using the `insert-only` [tracing strategy](https://mastra.ai/docs/observability/
|
|
143
|
+
- Using the `insert-only` [tracing strategy](https://mastra.ai/docs/observability/integrations/exporters/mastra-storage) to reduce database write operations
|
|
144
144
|
- Setting up table partitioning for efficient data retention
|
|
145
145
|
- Migrating observability to [ClickHouse via composite storage](https://mastra.ai/reference/storage/composite) if you need to scale further
|
|
146
146
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @mastra/mcp-docs-server
|
|
2
2
|
|
|
3
|
+
## 1.1.46-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`d468acb`](https://github.com/mastra-ai/mastra/commit/d468acb07aec1bb19a2cb0ada8042b05b46746b2), [`e9be4e7`](https://github.com/mastra-ai/mastra/commit/e9be4e747ec3d8b65548bff92f9377db06105376), [`d53cfc2`](https://github.com/mastra-ai/mastra/commit/d53cfc2c7f8d78343a4aa84ec4e129ba25f3325e), [`65799d4`](https://github.com/mastra-ai/mastra/commit/65799d4d549e5ebb9c848fbe3f51ac090f64becf), [`c268c89`](https://github.com/mastra-ai/mastra/commit/c268c89f4c63a93ee474d3cffdf3ea60bf00d4f2), [`d468acb`](https://github.com/mastra-ai/mastra/commit/d468acb07aec1bb19a2cb0ada8042b05b46746b2), [`7ef9ebf`](https://github.com/mastra-ai/mastra/commit/7ef9ebf79ec3c90536643ef169c7a306f105fb9d), [`0c72f03`](https://github.com/mastra-ai/mastra/commit/0c72f032abb13254df5a7856d64be2f207b8006d), [`75adfb8`](https://github.com/mastra-ai/mastra/commit/75adfb81e3fca1fe8dc9ab382bed7b714854ba4f), [`3b45ea9`](https://github.com/mastra-ai/mastra/commit/3b45ea95015557a6cb9d70dc5252af54ab1b78ac), [`f084be1`](https://github.com/mastra-ai/mastra/commit/f084be1fcbe33ad7480913e44d6130c421c0976f)]:
|
|
8
|
+
- @mastra/core@1.42.0-alpha.0
|
|
9
|
+
- @mastra/mcp@1.9.2-alpha.0
|
|
10
|
+
|
|
3
11
|
## 1.1.45
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/mcp-docs-server",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.46-alpha.0",
|
|
4
4
|
"description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"jsdom": "^26.1.0",
|
|
29
29
|
"local-pkg": "^1.1.2",
|
|
30
30
|
"zod": "^4.4.3",
|
|
31
|
-
"@mastra/core": "1.
|
|
32
|
-
"@mastra/mcp": "^1.9.
|
|
31
|
+
"@mastra/core": "1.42.0-alpha.0",
|
|
32
|
+
"@mastra/mcp": "^1.9.2-alpha.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@hono/node-server": "^1.19.11",
|
|
@@ -39,15 +39,15 @@
|
|
|
39
39
|
"@vitest/ui": "4.1.5",
|
|
40
40
|
"@wong2/mcp-cli": "^1.13.0",
|
|
41
41
|
"cross-env": "^10.1.0",
|
|
42
|
-
"eslint": "^10.
|
|
42
|
+
"eslint": "^10.4.1",
|
|
43
43
|
"hono": "^4.12.8",
|
|
44
44
|
"tsup": "^8.5.1",
|
|
45
|
-
"tsx": "^4.
|
|
45
|
+
"tsx": "^4.22.4",
|
|
46
46
|
"typescript": "^6.0.3",
|
|
47
47
|
"vitest": "4.1.5",
|
|
48
|
-
"@internal/types-builder": "0.0.78",
|
|
49
48
|
"@internal/lint": "0.0.103",
|
|
50
|
-
"@
|
|
49
|
+
"@internal/types-builder": "0.0.78",
|
|
50
|
+
"@mastra/core": "1.42.0-alpha.0"
|
|
51
51
|
},
|
|
52
52
|
"homepage": "https://mastra.ai",
|
|
53
53
|
"repository": {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/.docs/docs/observability/{tracing → integrations}/processors/sensitive-data-filter.md
RENAMED
|
File without changes
|