@mastra/mcp-docs-server 1.2.26-alpha.8 → 1.2.26

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 (59) hide show
  1. package/.docs/docs/agents/guardrails.md +3 -0
  2. package/.docs/docs/connections/connect-mcp-client.md +211 -0
  3. package/.docs/docs/guides/context-engineering.md +1 -1
  4. package/.docs/docs/harness/durable-agents.md +1 -1
  5. package/.docs/docs/memory/observational-memory.md +2 -2
  6. package/.docs/docs/studio/overview.md +4 -0
  7. package/.docs/integrations/observability/langfuse.md +11 -1
  8. package/.docs/integrations/sandboxes/cloudflare-sandbox.md +26 -1
  9. package/.docs/integrations/voice/openai.md +19 -7
  10. package/.docs/models/environment-variables.md +4 -0
  11. package/.docs/models/gateways/netlify.md +3 -1
  12. package/.docs/models/gateways/openrouter.md +2 -2
  13. package/.docs/models/gateways/vercel.md +6 -2
  14. package/.docs/models/index.md +1 -1
  15. package/.docs/models/providers/302ai.md +2 -1
  16. package/.docs/models/providers/agentrouter.md +8 -6
  17. package/.docs/models/providers/aki-io.md +1 -1
  18. package/.docs/models/providers/alibaba-token-plan-cn.md +2 -1
  19. package/.docs/models/providers/amd.md +4 -2
  20. package/.docs/models/providers/coralbricks.md +10 -9
  21. package/.docs/models/providers/cortecs.md +10 -9
  22. package/.docs/models/providers/deepinfra.md +3 -2
  23. package/.docs/models/providers/digitalocean.md +2 -1
  24. package/.docs/models/providers/edenai.md +12 -9
  25. package/.docs/models/providers/empiriolabs.md +2 -1
  26. package/.docs/models/providers/friendli.md +3 -2
  27. package/.docs/models/providers/hyper.md +7 -7
  28. package/.docs/models/providers/infer.md +78 -0
  29. package/.docs/models/providers/kilo.md +13 -13
  30. package/.docs/models/providers/kimi-for-coding.md +1 -1
  31. package/.docs/models/providers/llmgateway-providers.md +26 -4
  32. package/.docs/models/providers/llmgateway.md +2 -1
  33. package/.docs/models/providers/melious.md +91 -0
  34. package/.docs/models/providers/nano-gpt.md +83 -97
  35. package/.docs/models/providers/nvidia.md +3 -2
  36. package/.docs/models/providers/ollama-cloud.md +23 -22
  37. package/.docs/models/providers/requesty.md +4 -5
  38. package/.docs/models/providers/tinfoil.md +5 -4
  39. package/.docs/models/providers/togetherai.md +2 -1
  40. package/.docs/models/providers/vancine.md +11 -13
  41. package/.docs/models/providers/vispark.md +79 -0
  42. package/.docs/models/providers/wallaby.md +77 -0
  43. package/.docs/models/providers/wandb.md +2 -2
  44. package/.docs/models/providers.md +4 -0
  45. package/.docs/reference/agents/agent.md +31 -1
  46. package/.docs/reference/agents/inngest-agent.md +1 -1
  47. package/.docs/reference/ai-sdk/to-ai-sdk-messages.md +16 -0
  48. package/.docs/reference/cli/mastra.md +52 -0
  49. package/.docs/reference/memory/observational-memory.md +3 -2
  50. package/.docs/reference/observability/tracing/interfaces.md +27 -5
  51. package/.docs/reference/processors/language-detector.md +2 -0
  52. package/.docs/reference/processors/moderation-processor.md +2 -0
  53. package/.docs/reference/processors/pii-detector.md +2 -0
  54. package/.docs/reference/processors/processor-interface.md +2 -0
  55. package/.docs/reference/processors/prompt-injection-detector.md +2 -0
  56. package/.docs/reference/processors/provider-history-compat.md +7 -6
  57. package/.docs/reference/processors/system-prompt-scrubber.md +2 -0
  58. package/.docs/reference/tools/mcp-server.md +28 -0
  59. package/package.json +6 -6
@@ -26,6 +26,8 @@ const processor = new LanguageDetector({
26
26
 
27
27
  **options.model** (`MastraModelConfig`): Model configuration for the detection/translation agent
28
28
 
29
+ **options.errorStrategy** (`'warn' | 'strict'`): How to handle failures from the internal model call. 'warn' is fail-open: it logs the failure and assumes the content uses a target language. 'strict' is fail-closed: it stops processing with a tripwire.
30
+
29
31
  **options.targetLanguages** (`string[]`): Target language(s) for the project. If content is detected in a different language, it may be translated. Can be language name ('English') or ISO code ('en')
30
32
 
31
33
  **options.threshold** (`number`): Confidence threshold for language detection (0-1). Only process when detection confidence exceeds this threshold
@@ -26,6 +26,8 @@ const processor = new ModerationProcessor({
26
26
 
27
27
  **options.model** (`MastraModelConfig`): Model configuration for the moderation agent
28
28
 
29
+ **options.errorStrategy** (`'warn' | 'strict'`): How to handle failures from the internal model call. 'warn' is fail-open: it logs the failure and allows the content through unchanged. 'strict' is fail-closed: it stops processing with a tripwire.
30
+
29
31
  **options.categories** (`string[]`): Categories to check for moderation. If not specified, uses default OpenAI categories
30
32
 
31
33
  **options.threshold** (`number`): Confidence threshold for flagging (0-1). Content is flagged if any category score exceeds this threshold
@@ -26,6 +26,8 @@ const processor = new PIIDetector({
26
26
 
27
27
  **options.model** (`MastraModelConfig`): Model configuration for the detection agent
28
28
 
29
+ **options.errorStrategy** (`'warn' | 'strict'`): How to handle failures from the internal model call. 'warn' is fail-open: it logs the failure and allows the content through unchanged. 'strict' is fail-closed: it stops processing with a tripwire. This option doesn't affect regex-only streaming detection.
30
+
29
31
  **options.detectionTypes** (`string[]`): PII types to detect. If not specified, uses default types
30
32
 
31
33
  **options.threshold** (`number`): Confidence threshold for flagging (0-1). PII is flagged if any category score exceeds this threshold
@@ -387,6 +387,8 @@ processLLMRequest?(
387
387
 
388
388
  **model** (`MastraLanguageModel`): The resolved model that will receive the prompt. Use this to scope provider-specific rewrites.
389
389
 
390
+ **messageList** (`MessageList`): The message list the prompt was converted from, when the call path has one. Use it for provenance the converted prompt no longer carries, such as per-turn provider stamps.
391
+
390
392
  **stepNumber** (`number`): Current step number (0-indexed). Step 0 is the initial LLM call.
391
393
 
392
394
  **steps** (`StepResult[]`): Results from previous steps, including text, toolCalls, and toolResults.
@@ -26,6 +26,8 @@ const processor = new PromptInjectionDetector({
26
26
 
27
27
  **options.model** (`MastraModelConfig`): Model configuration for the detection agent
28
28
 
29
+ **options.errorStrategy** (`'warn' | 'strict'`): How to handle failures from the internal model call. 'warn' is fail-open: it logs the failure and allows the content through unchanged. 'strict' is fail-closed: it stops processing with a tripwire.
30
+
29
31
  **options.detectionTypes** (`string[]`): Detection types to check for. If not specified, uses default categories
30
32
 
31
33
  **options.threshold** (`number`): Confidence threshold for flagging (0-1). Higher threshold = less sensitive to avoid false positives
@@ -47,12 +47,13 @@ Mastra agents don't add this processor automatically. Add it explicitly when you
47
47
 
48
48
  `ProviderHistoryCompat` includes these built-in compatibility rules:
49
49
 
50
- | Rule | Provider | Timing | Behavior |
51
- | ------------------------------------------- | ------------ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
52
- | `anthropic-tool-id-format` | Anthropic | Reactive API error recovery | Rewrites tool call IDs that contain characters outside `[a-zA-Z0-9_-]` and retries the request. |
53
- | `cerebras-strip-reasoning-content` | Cerebras | Preemptive prompt rewrite | Removes assistant `reasoning` parts from the outbound prompt so they're not serialized as unsupported `reasoning_content` fields. |
54
- | `anthropic-strip-foreign-reasoning-content` | Anthropic | Preemptive prompt rewrite | Removes non-Anthropic assistant `reasoning` parts from the outbound prompt. Anthropic-native thinking history is preserved. |
55
- | `azure-system-reminder-transform` | Azure OpenAI | Preemptive prompt rewrite | Renames `<system-reminder>` wrappers in user text and system instructions to `<memory-context>` for the outbound request. Stored history remains unchanged. |
50
+ | Rule | Provider | Timing | Behavior |
51
+ | ------------------------------------------- | -------------------- | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
52
+ | `anthropic-tool-id-format` | Anthropic | Reactive API error recovery | Rewrites tool call IDs that contain characters outside `[a-zA-Z0-9_-]` and retries the request. |
53
+ | `cerebras-strip-reasoning-content` | Cerebras | Preemptive prompt rewrite | Removes assistant `reasoning` parts from the outbound prompt so they're not serialized as unsupported `reasoning_content` fields. |
54
+ | `anthropic-strip-foreign-reasoning-content` | Anthropic | Preemptive prompt rewrite | Removes non-Anthropic assistant `reasoning` parts from the outbound prompt. Anthropic-native thinking history is preserved. |
55
+ | `anthropic-strip-foreign-signed-reasoning` | Anthropic-compatible | Preemptive prompt rewrite | Drops signed thinking from the outbound prompt when its origin turn was stamped with a different provider (for example Kimi For Coding ↔ `anthropic/claude-sonnet-4-6`), since the receiving provider can't verify another provider's signature. Turns emptied of all content by the drop are removed from the prompt. Unstamped history is left untouched. |
56
+ | `azure-system-reminder-transform` | Azure OpenAI | Preemptive prompt rewrite | Renames `<system-reminder>` wrappers in user text and system instructions to `<memory-context>` for the outbound request. Stored history remains unchanged. |
56
57
 
57
58
  Preemptive rules run through `processLLMRequest` after Mastra converts messages to the model prompt format and before the prompt is sent to the provider. These rewrites affect only the current provider call.
58
59
 
@@ -26,6 +26,8 @@ const processor = new SystemPromptScrubber({
26
26
 
27
27
  **options.model** (`MastraModelConfig`): Model configuration for the detection agent
28
28
 
29
+ **options.errorStrategy** (`'warn' | 'strict'`): How to handle failures from the internal model call. 'warn' is fail-open: it logs the failure and allows the content through unchanged. 'strict' is fail-closed: it stops processing with a tripwire.
30
+
29
31
  **options.strategy** (`'block' | 'warn' | 'filter' | 'redact'`): Strategy when system prompts are detected: 'block' rejects with error, 'warn' logs warning but allows through, 'filter' removes flagged messages, 'redact' replaces with redacted versions
30
32
 
31
33
  **options.customPatterns** (`string[]`): Custom patterns to detect system prompts (regex strings)
@@ -10,6 +10,34 @@ Note that if you only need to use your tools or agents directly within your Mast
10
10
 
11
11
  It supports both [stdio (subprocess) and SSE (HTTP) MCP transports](https://modelcontextprotocol.io/docs/concepts/transports).
12
12
 
13
+ ## Operate a remote Mastra server
14
+
15
+ Use `MastraApiMCPServer` to give MCP clients the Mastra server operations from the `mastra api` CLI. It reads the target server's API schema when it starts and only registers operations supported by that server. Factory commands and routes outside this catalog aren't exposed.
16
+
17
+ ```typescript
18
+ import { Mastra } from '@mastra/core/mastra'
19
+ import { MastraApiMCPServer } from '@mastra/mcp'
20
+
21
+ const operations = await MastraApiMCPServer.create({
22
+ url: 'https://my-mastra-server.example.com',
23
+ headers: {
24
+ Authorization: `Bearer ${process.env.MASTRA_API_TOKEN}`,
25
+ },
26
+ })
27
+
28
+ export const mastra = new Mastra({
29
+ mcpServers: { operations },
30
+ })
31
+ ```
32
+
33
+ Tool names follow the CLI command hierarchy. For example, `mastra api workflow run start` becomes `workflow_run_start`.
34
+
35
+ The server can expose 60 tools across agents, workflows, tools, MCP servers, memory threads, working memory, traces, logs, metrics, scores, datasets, experiments, and Trace Intelligence. Each tool uses the input schema returned by the target server. Trace list and get tools also support the CLI's `verbose` option.
36
+
37
+ The server uses stateless MCP transport. Read operations, mutations, and destructive operations have separate MCP tool annotations. Agent, workflow, experiment, and tool execution are marked as potentially destructive because they can invoke operations that delete or overwrite data. These annotations are hints for MCP clients, not authorization checks. Each tool call sends one request to the target API and doesn't retry mutations.
38
+
39
+ Use `headers` to authenticate the API schema request. For tool calls, the MCP caller's bearer token replaces the configured `Authorization` header. You can also set `apiPrefix`, `timeoutMs`, `id`, `name`, and `version`.
40
+
13
41
  ## Constructor
14
42
 
15
43
  To create a new `MCPServer`, you need to provide some basic information about your server, the tools it will offer, and optionally, any agents you want to expose as tools.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/mcp-docs-server",
3
- "version": "1.2.26-alpha.8",
3
+ "version": "1.2.26",
4
4
  "description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -27,8 +27,8 @@
27
27
  "jsdom": "^26.1.0",
28
28
  "local-pkg": "^1.1.2",
29
29
  "zod": "^4.4.3",
30
- "@mastra/mcp": "^1.17.4-alpha.0",
31
- "@mastra/core": "1.67.0-alpha.3"
30
+ "@mastra/mcp": "^1.18.0",
31
+ "@mastra/core": "1.67.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@hono/node-server": "^2.0.0",
@@ -44,9 +44,9 @@
44
44
  "tsx": "^4.23.1",
45
45
  "typescript": "^7.0.2",
46
46
  "vitest": "4.1.10",
47
- "@internal/types-builder": "0.0.107",
48
- "@mastra/core": "1.67.0-alpha.3",
49
- "@internal/lint": "0.0.132"
47
+ "@internal/types-builder": "0.0.108",
48
+ "@mastra/core": "1.67.0",
49
+ "@internal/lint": "0.0.133"
50
50
  },
51
51
  "homepage": "https://mastra.ai",
52
52
  "repository": {