@mastra/mcp-docs-server 0.13.2 → 0.13.3-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/organized/changelogs/%40internal%2Fstorage-test-utils.md +33 -0
- package/.docs/organized/changelogs/%40mastra%2Fagui.md +48 -0
- package/.docs/organized/changelogs/%40mastra%2Fastra.md +30 -30
- package/.docs/organized/changelogs/%40mastra%2Fchroma.md +30 -30
- package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +33 -33
- package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +85 -85
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +35 -35
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +70 -70
- package/.docs/organized/changelogs/%40mastra%2Fcouchbase.md +29 -29
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +92 -92
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +94 -94
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +92 -92
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +104 -104
- package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +35 -35
- package/.docs/organized/changelogs/%40mastra%2Fevals.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Ffirecrawl.md +29 -29
- package/.docs/organized/changelogs/%40mastra%2Fgithub.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Flance.md +32 -0
- package/.docs/organized/changelogs/%40mastra%2Flibsql.md +35 -35
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +59 -59
- package/.docs/organized/changelogs/%40mastra%2Fmcp-registry-registry.md +29 -29
- package/.docs/organized/changelogs/%40mastra%2Fmcp.md +31 -31
- package/.docs/organized/changelogs/%40mastra%2Fmem0.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fmemory.md +56 -56
- package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +37 -37
- package/.docs/organized/changelogs/%40mastra%2Fopensearch.md +30 -17
- package/.docs/organized/changelogs/%40mastra%2Fpg.md +57 -57
- package/.docs/organized/changelogs/%40mastra%2Fpinecone.md +29 -29
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +108 -108
- package/.docs/organized/changelogs/%40mastra%2Fqdrant.md +29 -29
- package/.docs/organized/changelogs/%40mastra%2Frag.md +27 -27
- package/.docs/organized/changelogs/%40mastra%2Fragie.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fschema-compat.md +7 -0
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +82 -82
- package/.docs/organized/changelogs/%40mastra%2Fturbopuffer.md +29 -29
- package/.docs/organized/changelogs/%40mastra%2Fupstash.md +33 -33
- package/.docs/organized/changelogs/%40mastra%2Fvectorize.md +31 -31
- package/.docs/organized/changelogs/%40mastra%2Fvoice-cloudflare.md +28 -28
- package/.docs/organized/changelogs/%40mastra%2Fvoice-deepgram.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fvoice-elevenlabs.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fvoice-gladia.md +25 -0
- package/.docs/organized/changelogs/%40mastra%2Fvoice-google.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fvoice-murf.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai-realtime.md +23 -23
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fvoice-playai.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fvoice-sarvam.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fvoice-speechify.md +26 -26
- package/.docs/organized/changelogs/create-mastra.md +37 -37
- package/.docs/organized/changelogs/mastra.md +115 -115
- package/.docs/organized/code-examples/a2a.md +1 -30
- package/.docs/organized/code-examples/agent-network.md +26 -115
- package/.docs/organized/code-examples/agent.md +1 -29
- package/.docs/organized/code-examples/agui.md +0 -22
- package/.docs/organized/code-examples/ai-sdk-useChat.md +1 -16
- package/.docs/organized/code-examples/assistant-ui.md +1 -16
- package/.docs/organized/code-examples/bird-checker-with-express.md +1 -19
- package/.docs/organized/code-examples/bird-checker-with-nextjs-and-eval.md +1 -20
- package/.docs/organized/code-examples/bird-checker-with-nextjs.md +1 -18
- package/.docs/organized/code-examples/client-side-tools.md +1 -18
- package/.docs/organized/code-examples/crypto-chatbot.md +4 -25
- package/.docs/organized/code-examples/experimental-auth-weather-agent.md +1 -26
- package/.docs/organized/code-examples/fireworks-r1.md +1 -21
- package/.docs/organized/code-examples/mcp-configuration.md +1 -24
- package/.docs/organized/code-examples/mcp-registry-registry.md +1 -22
- package/.docs/organized/code-examples/memory-per-resource-example.md +0 -14
- package/.docs/organized/code-examples/memory-todo-agent.md +1 -20
- package/.docs/organized/code-examples/memory-with-context.md +1 -20
- package/.docs/organized/code-examples/memory-with-libsql.md +1 -21
- package/.docs/organized/code-examples/memory-with-mem0.md +1 -21
- package/.docs/organized/code-examples/memory-with-pg.md +1 -22
- package/.docs/organized/code-examples/memory-with-processors.md +1 -17
- package/.docs/organized/code-examples/memory-with-upstash.md +1 -24
- package/.docs/organized/code-examples/openapi-spec-writer.md +1 -21
- package/.docs/organized/code-examples/quick-start.md +1 -21
- package/.docs/organized/code-examples/stock-price-tool.md +1 -21
- package/.docs/organized/code-examples/weather-agent.md +1 -20
- package/.docs/organized/code-examples/workflow-ai-recruiter.md +1 -22
- package/.docs/organized/code-examples/workflow-with-inline-steps.md +1 -20
- package/.docs/organized/code-examples/workflow-with-memory.md +1 -21
- package/.docs/organized/code-examples/workflow-with-separate-steps.md +1 -22
- package/.docs/raw/course/01-first-agent/11-creating-transactions-tool.md +1 -1
- package/.docs/raw/course/03-agent-memory/24-working-memory-in-practice.md +0 -3
- package/.docs/raw/course/03-agent-memory/29-memory-best-practices.md +0 -6
- package/.docs/raw/deployment/cloud-providers/amazon-ec2.mdx +81 -0
- package/.docs/raw/deployment/cloud-providers/azure-app-services.mdx +136 -0
- package/.docs/raw/deployment/cloud-providers/index.mdx +2 -0
- package/.docs/raw/deployment/serverless-platforms/cloudflare-deployer.mdx +111 -0
- package/.docs/raw/deployment/{deployment.mdx → serverless-platforms/index.mdx} +5 -10
- package/.docs/raw/deployment/serverless-platforms/netlify-deployer.mdx +94 -0
- package/.docs/raw/deployment/serverless-platforms/vercel-deployer.mdx +91 -0
- package/.docs/raw/frameworks/ai-sdk-v5.mdx +91 -0
- package/.docs/raw/frameworks/web-frameworks/next-js.mdx +56 -18
- package/.docs/raw/frameworks/web-frameworks/sveltekit.mdx +456 -0
- package/.docs/raw/frameworks/web-frameworks/vite-react.mdx +28 -9
- package/.docs/raw/getting-started/model-providers.mdx +118 -127
- package/.docs/raw/memory/overview.mdx +30 -0
- package/.docs/raw/reference/agents/generate.mdx +3 -3
- package/.docs/raw/reference/agents/getModel.mdx +1 -1
- package/.docs/raw/reference/agents/stream.mdx +3 -3
- package/.docs/raw/reference/deployer/cloudflare.mdx +4 -119
- package/.docs/raw/reference/deployer/netlify.mdx +4 -83
- package/.docs/raw/reference/deployer/vercel.mdx +4 -51
- package/.docs/raw/reference/memory/Memory.mdx +71 -2
- package/.docs/raw/reference/observability/logger.mdx +70 -0
- package/.docs/raw/reference/rag/pg.mdx +15 -0
- package/.docs/raw/reference/storage/postgresql.mdx +17 -0
- package/.docs/raw/reference/workflows/step.mdx +8 -1
- package/.docs/raw/workflows/overview.mdx +1 -1
- package/dist/{chunk-P5AHYMUI.js → chunk-7QXT2IEP.js} +48 -11
- package/dist/prepare-docs/prepare.js +1 -1
- package/dist/stdio.js +1 -1
- package/package.json +5 -5
|
@@ -56,6 +56,15 @@ const memory = new Memory({
|
|
|
56
56
|
- Last Name:
|
|
57
57
|
`,
|
|
58
58
|
},
|
|
59
|
+
|
|
60
|
+
// Thread configuration
|
|
61
|
+
threads: {
|
|
62
|
+
generateTitle: true, // Enable title generation using agent's model
|
|
63
|
+
// Or use a different model for title generation
|
|
64
|
+
// generateTitle: {
|
|
65
|
+
// model: openai("gpt-4.1-nano"), // Use cheaper model for titles
|
|
66
|
+
// },
|
|
67
|
+
},
|
|
59
68
|
},
|
|
60
69
|
});
|
|
61
70
|
|
|
@@ -84,6 +93,66 @@ const memory = new Memory({
|
|
|
84
93
|
|
|
85
94
|
If no template is provided, the Memory class uses a default template that includes fields for user details, preferences, goals, and other contextual information in Markdown format. See the [Working Memory guide](/docs/memory/working-memory.mdx#designing-effective-templates) for detailed usage examples and best practices.
|
|
86
95
|
|
|
96
|
+
### Thread Title Generation
|
|
97
|
+
|
|
98
|
+
The `generateTitle` feature automatically creates meaningful titles for conversation threads based on the user's first message. This helps organize and identify conversations in your application.
|
|
99
|
+
|
|
100
|
+
#### Basic Usage
|
|
101
|
+
|
|
102
|
+
```typescript copy showLineNumbers
|
|
103
|
+
const memory = new Memory({
|
|
104
|
+
options: {
|
|
105
|
+
threads: {
|
|
106
|
+
generateTitle: true, // Use the agent's model for title generation
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
#### Cost Optimization with Custom Models
|
|
113
|
+
|
|
114
|
+
You can specify a different (typically cheaper) model for title generation while using a high-quality model for the main conversation:
|
|
115
|
+
|
|
116
|
+
```typescript copy showLineNumbers
|
|
117
|
+
import { openai } from "@ai-sdk/openai";
|
|
118
|
+
|
|
119
|
+
const memory = new Memory({
|
|
120
|
+
options: {
|
|
121
|
+
threads: {
|
|
122
|
+
generateTitle: {
|
|
123
|
+
model: openai("gpt-4.1-nano"), // Cheaper model for titles
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
const agent = new Agent({
|
|
130
|
+
model: openai("gpt-4o"), // High-quality model for main conversation
|
|
131
|
+
memory,
|
|
132
|
+
});
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
#### Dynamic Model Selection
|
|
136
|
+
|
|
137
|
+
You can also use a function to dynamically determine the model based on runtime context:
|
|
138
|
+
|
|
139
|
+
```typescript copy showLineNumbers
|
|
140
|
+
const memory = new Memory({
|
|
141
|
+
options: {
|
|
142
|
+
threads: {
|
|
143
|
+
generateTitle: {
|
|
144
|
+
model: (ctx: RuntimeContext) => {
|
|
145
|
+
// Use different models based on context
|
|
146
|
+
const userTier = ctx.get("userTier");
|
|
147
|
+
return userTier === "premium"
|
|
148
|
+
? openai("gpt-4.1")
|
|
149
|
+
: openai("gpt-4.1-nano");
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
});
|
|
155
|
+
```
|
|
87
156
|
### embedder
|
|
88
157
|
|
|
89
158
|
An embedding model is required if `semanticRecall` is enabled.
|
|
@@ -216,9 +285,9 @@ Mastra supports many embedding models through the [Vercel AI SDK](https://sdk.ve
|
|
|
216
285
|
},
|
|
217
286
|
{
|
|
218
287
|
name: "threads",
|
|
219
|
-
type: "{ generateTitle?: boolean }",
|
|
288
|
+
type: "{ generateTitle?: boolean | { model: LanguageModelV1 | ((ctx: RuntimeContext) => LanguageModelV1 | Promise<LanguageModelV1>) } }",
|
|
220
289
|
description:
|
|
221
|
-
"Settings related to memory thread creation. `generateTitle`
|
|
290
|
+
"Settings related to memory thread creation. `generateTitle` controls automatic thread title generation from the user's first message. Can be a boolean to enable/disable using the agent's model, or an object with a custom model for title generation (useful for cost optimization). Example: { generateTitle: { model: openai('gpt-4.1-nano') } }",
|
|
222
291
|
isOptional: true,
|
|
223
292
|
defaultValue: "{ generateTitle: false }",
|
|
224
293
|
},
|
|
@@ -57,3 +57,73 @@ logger.error("An error occurred"); // Logged as ERROR
|
|
|
57
57
|
/>
|
|
58
58
|
|
|
59
59
|
**Note:** Some loggers require a `BaseLogMessage` object (with `message`, `destinationPath`, `type` fields). For instance, the `File` and `Upstash` loggers need structured messages.
|
|
60
|
+
|
|
61
|
+
## File Transport (Structured Logs)
|
|
62
|
+
|
|
63
|
+
```typescript showLineNumbers copy
|
|
64
|
+
import { FileTransport } from "@mastra/loggers/file";
|
|
65
|
+
|
|
66
|
+
const fileLogger = new PinoLogger({
|
|
67
|
+
name: "Mastra",
|
|
68
|
+
transports: { file: new FileTransport({ path: "test-dir/test.log" }) },
|
|
69
|
+
level: "warn",
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
fileLogger.warn("Low disk space", {
|
|
73
|
+
destinationPath: "system",
|
|
74
|
+
type: "WORKFLOW",
|
|
75
|
+
});
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Upstash Logger (Remote Log Drain)
|
|
79
|
+
|
|
80
|
+
```typescript showLineNumbers copy
|
|
81
|
+
import { UpstashTransport } from "@mastra/loggers/upstash";
|
|
82
|
+
|
|
83
|
+
const logger = new PinoLogger({
|
|
84
|
+
name: "Mastra",
|
|
85
|
+
transports: {
|
|
86
|
+
upstash: new UpstashTransport({
|
|
87
|
+
listName: "production-logs",
|
|
88
|
+
upstashUrl: process.env.UPSTASH_URL!,
|
|
89
|
+
upstashToken: process.env.UPSTASH_TOKEN!,
|
|
90
|
+
}),
|
|
91
|
+
},
|
|
92
|
+
level: "info",
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
logger.info({
|
|
96
|
+
message: "User signed in",
|
|
97
|
+
destinationPath: "auth",
|
|
98
|
+
type: "AGENT",
|
|
99
|
+
runId: "run_123",
|
|
100
|
+
});
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Custom Transport
|
|
104
|
+
|
|
105
|
+
You can create custom transports using the `createCustomTransport` utility to integrate with any logging service or stream.
|
|
106
|
+
|
|
107
|
+
### Example: Sentry Integration
|
|
108
|
+
|
|
109
|
+
```typescript showLineNumbers copy
|
|
110
|
+
import { createCustomTransport } from "@mastra/core/loggers";
|
|
111
|
+
import pinoSentry from 'pino-sentry-transport';
|
|
112
|
+
|
|
113
|
+
const sentryStream = await pinoSentry({
|
|
114
|
+
sentry: {
|
|
115
|
+
dsn: 'YOUR_SENTRY_DSN',
|
|
116
|
+
_experiments: {
|
|
117
|
+
enableLogs: true,
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
const customTransport = createCustomTransport(sentryStream);
|
|
123
|
+
|
|
124
|
+
const logger = new PinoLogger({
|
|
125
|
+
name: "Mastra",
|
|
126
|
+
transports: { sentry: customTransport },
|
|
127
|
+
level: "info",
|
|
128
|
+
});
|
|
129
|
+
```
|
|
@@ -504,6 +504,21 @@ try {
|
|
|
504
504
|
- Adjust parameters like `lists` and `m` based on dataset size and query requirements.
|
|
505
505
|
- Rebuild indexes periodically to maintain efficiency, especially after significant data changes.
|
|
506
506
|
|
|
507
|
+
## Direct Pool Access
|
|
508
|
+
|
|
509
|
+
The `PgVector` class exposes its underlying PostgreSQL connection pool as a public field:
|
|
510
|
+
|
|
511
|
+
```typescript
|
|
512
|
+
pgVector.pool // instance of pg.Pool
|
|
513
|
+
```
|
|
514
|
+
|
|
515
|
+
This enables advanced usage such as running direct SQL queries, managing transactions, or monitoring pool state. When using the pool directly:
|
|
516
|
+
- You are responsible for releasing clients (`client.release()`) after use.
|
|
517
|
+
- The pool remains accessible after calling `disconnect()`, but new queries will fail.
|
|
518
|
+
- Direct access bypasses any validation or transaction logic provided by PgVector methods.
|
|
519
|
+
|
|
520
|
+
This design supports advanced use cases but requires careful resource management by the user.
|
|
521
|
+
|
|
507
522
|
## Related
|
|
508
523
|
|
|
509
524
|
- [Metadata Filters](./metadata-filters)
|
|
@@ -91,3 +91,20 @@ The storage implementation handles schema creation and updates automatically. It
|
|
|
91
91
|
- `threads`: Stores conversation threads
|
|
92
92
|
- `messages`: Stores individual messages
|
|
93
93
|
- `metadata`: Stores additional metadata for threads and messages
|
|
94
|
+
|
|
95
|
+
### Direct Database and Pool Access
|
|
96
|
+
|
|
97
|
+
`PostgresStore` exposes both the underlying database object and the pg-promise instance as public fields:
|
|
98
|
+
|
|
99
|
+
```typescript
|
|
100
|
+
store.db // pg-promise database instance
|
|
101
|
+
store.pgp // pg-promise main instance
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
This enables direct queries and custom transaction management. When using these fields:
|
|
105
|
+
- You are responsible for proper connection and transaction handling.
|
|
106
|
+
- Closing the store (`store.close()`) will destroy the associated connection pool.
|
|
107
|
+
- Direct access bypasses any additional logic or validation provided by PostgresStore methods.
|
|
108
|
+
|
|
109
|
+
This approach is intended for advanced scenarios where low-level access is required.
|
|
110
|
+
|
|
@@ -35,6 +35,7 @@ const processOrder = createStep({
|
|
|
35
35
|
getInitData,
|
|
36
36
|
suspend,
|
|
37
37
|
runtimeContext,
|
|
38
|
+
runCount
|
|
38
39
|
runId,
|
|
39
40
|
}) => {
|
|
40
41
|
return {
|
|
@@ -90,7 +91,7 @@ const processOrder = createStep({
|
|
|
90
91
|
type: "(params: ExecuteParams) => Promise<any>",
|
|
91
92
|
description: "Async function containing step logic",
|
|
92
93
|
required: true,
|
|
93
|
-
}
|
|
94
|
+
}
|
|
94
95
|
]}
|
|
95
96
|
/>
|
|
96
97
|
|
|
@@ -142,6 +143,12 @@ const processOrder = createStep({
|
|
|
142
143
|
description:
|
|
143
144
|
"Runtime context for dependency injection and contextual information.",
|
|
144
145
|
},
|
|
146
|
+
{
|
|
147
|
+
name: "runCount",
|
|
148
|
+
type: "number",
|
|
149
|
+
description: "The run count for this specific step, it automatically increases each time the step runs",
|
|
150
|
+
isOptional: true,
|
|
151
|
+
}
|
|
145
152
|
]}
|
|
146
153
|
/>
|
|
147
154
|
|
|
@@ -172,7 +172,7 @@ const result = await run.start({
|
|
|
172
172
|
|
|
173
173
|
console.log(JSON.stringify(result, null, 2));
|
|
174
174
|
```
|
|
175
|
-
> see [createRunAsync](/reference/workflows/create-run
|
|
175
|
+
> see [createRunAsync](/reference/workflows/create-run) and [start](/reference/workflows/start) for more information.
|
|
176
176
|
|
|
177
177
|
To trigger this workflow, run the following:
|
|
178
178
|
|
|
@@ -119,6 +119,21 @@ ${pathList}`;
|
|
|
119
119
|
}
|
|
120
120
|
var EXAMPLES_SOURCE = fromRepoRoot("examples");
|
|
121
121
|
var OUTPUT_DIR = fromPackageRoot(".docs/organized/code-examples");
|
|
122
|
+
async function loadExampleConfig(examplePath) {
|
|
123
|
+
try {
|
|
124
|
+
const configPath = path4.join(examplePath, ".mcp-docs.json");
|
|
125
|
+
const configContent = await fs2.readFile(configPath, "utf-8");
|
|
126
|
+
return JSON.parse(configContent);
|
|
127
|
+
} catch {
|
|
128
|
+
return {};
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
function shouldIgnoreFile(filePath, ignorePatterns = []) {
|
|
132
|
+
return ignorePatterns.some((pattern) => {
|
|
133
|
+
const regex = pattern.replace(/\*/g, ".*").replace(/\?/g, ".").replace(/\//g, "\\/");
|
|
134
|
+
return new RegExp(regex).test(filePath);
|
|
135
|
+
});
|
|
136
|
+
}
|
|
122
137
|
async function prepareCodeExamples() {
|
|
123
138
|
try {
|
|
124
139
|
await fs2.rm(OUTPUT_DIR, { recursive: true, force: true });
|
|
@@ -130,18 +145,37 @@ async function prepareCodeExamples() {
|
|
|
130
145
|
for (const dir of exampleDirs) {
|
|
131
146
|
const examplePath = path4.join(EXAMPLES_SOURCE, dir.name);
|
|
132
147
|
const outputFile = path4.join(OUTPUT_DIR, `${dir.name}.md`);
|
|
148
|
+
const config = await loadExampleConfig(examplePath);
|
|
133
149
|
const files = [];
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
150
|
+
if (!shouldIgnoreFile("package.json", config.ignore)) {
|
|
151
|
+
try {
|
|
152
|
+
const packageJsonContent = await fs2.readFile(path4.join(examplePath, "package.json"), "utf-8");
|
|
153
|
+
const packageJson = JSON.parse(packageJsonContent);
|
|
154
|
+
for (const key of [
|
|
155
|
+
"scripts",
|
|
156
|
+
"private",
|
|
157
|
+
"type",
|
|
158
|
+
"description",
|
|
159
|
+
"version",
|
|
160
|
+
"main",
|
|
161
|
+
"pnpm",
|
|
162
|
+
"packageManager",
|
|
163
|
+
"keywords",
|
|
164
|
+
"author",
|
|
165
|
+
"license"
|
|
166
|
+
]) {
|
|
167
|
+
if (key in packageJson) delete packageJson[key];
|
|
168
|
+
}
|
|
169
|
+
files.push({
|
|
170
|
+
path: "package.json",
|
|
171
|
+
content: JSON.stringify(packageJson, null, 2)
|
|
172
|
+
});
|
|
173
|
+
} catch {
|
|
174
|
+
}
|
|
141
175
|
}
|
|
142
176
|
try {
|
|
143
177
|
const srcPath = path4.join(examplePath, "src");
|
|
144
|
-
await scanDirectory(srcPath, srcPath, files);
|
|
178
|
+
await scanDirectory(srcPath, srcPath, files, config.ignore);
|
|
145
179
|
} catch {
|
|
146
180
|
}
|
|
147
181
|
if (files.length > 0) {
|
|
@@ -151,7 +185,7 @@ ${file.content}
|
|
|
151
185
|
\`\`\`
|
|
152
186
|
`).join("\n");
|
|
153
187
|
const totalLines = output.split("\n").length;
|
|
154
|
-
const limit =
|
|
188
|
+
const limit = config.maxLines || 1500;
|
|
155
189
|
if (totalLines > limit) {
|
|
156
190
|
log(`Skipping ${dir.name}: ${totalLines} lines exceeds limit of ${limit}`);
|
|
157
191
|
continue;
|
|
@@ -161,13 +195,16 @@ ${file.content}
|
|
|
161
195
|
}
|
|
162
196
|
}
|
|
163
197
|
}
|
|
164
|
-
async function scanDirectory(basePath, currentPath, files) {
|
|
198
|
+
async function scanDirectory(basePath, currentPath, files, ignorePatterns) {
|
|
165
199
|
const entries = await fs2.readdir(currentPath, { withFileTypes: true });
|
|
166
200
|
for (const entry of entries) {
|
|
167
201
|
const fullPath = path4.join(currentPath, entry.name);
|
|
168
202
|
const relativePath = path4.relative(basePath, fullPath);
|
|
203
|
+
if (shouldIgnoreFile(relativePath, ignorePatterns)) {
|
|
204
|
+
continue;
|
|
205
|
+
}
|
|
169
206
|
if (entry.isDirectory()) {
|
|
170
|
-
await scanDirectory(basePath, fullPath, files);
|
|
207
|
+
await scanDirectory(basePath, fullPath, files, ignorePatterns);
|
|
171
208
|
} else if (entry.isFile() && entry.name.endsWith(".ts")) {
|
|
172
209
|
const content = await fs2.readFile(fullPath, "utf-8");
|
|
173
210
|
files.push({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { prepare } from '../chunk-
|
|
1
|
+
export { prepare } from '../chunk-7QXT2IEP.js';
|
package/dist/stdio.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { fromPackageRoot, prepare, getMatchingPaths } from './chunk-
|
|
2
|
+
import { fromPackageRoot, prepare, getMatchingPaths } from './chunk-7QXT2IEP.js';
|
|
3
3
|
import * as fs from 'fs';
|
|
4
4
|
import { existsSync, mkdirSync } from 'fs';
|
|
5
5
|
import * as os2 from 'os';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/mcp-docs-server",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.3-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",
|
|
@@ -42,13 +42,13 @@
|
|
|
42
42
|
"@wong2/mcp-cli": "^1.10.0",
|
|
43
43
|
"cross-env": "^7.0.3",
|
|
44
44
|
"eslint": "^9.29.0",
|
|
45
|
-
"hono": "^4.
|
|
45
|
+
"hono": "^4.8.3",
|
|
46
46
|
"tsup": "^8.5.0",
|
|
47
47
|
"tsx": "^4.19.4",
|
|
48
48
|
"typescript": "^5.8.3",
|
|
49
|
-
"vitest": "^3.2.
|
|
50
|
-
"@internal/lint": "0.0.
|
|
51
|
-
"@mastra/core": "0.10.
|
|
49
|
+
"vitest": "^3.2.4",
|
|
50
|
+
"@internal/lint": "0.0.15",
|
|
51
|
+
"@mastra/core": "0.10.9-alpha.0"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"@mastra/core": "^0.10.0-alpha.0"
|