@mastra/mcp 1.0.0-beta.6 → 1.0.0-beta.7
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/CHANGELOG.md +29 -0
- package/dist/index.cjs +20 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +20 -2
- package/dist/index.js.map +1 -1
- package/dist/server/server.d.ts.map +1 -1
- package/package.json +3 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# @mastra/mcp
|
|
2
2
|
|
|
3
|
+
## 1.0.0-beta.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Add support for `instructions` field in MCPServer ([#11421](https://github.com/mastra-ai/mastra/pull/11421))
|
|
8
|
+
|
|
9
|
+
Implements the official MCP specification's `instructions` field, which allows MCP servers to provide system-wide prompts that are automatically sent to clients during initialization. This eliminates the need for per-project configuration files (like AGENTS.md) by centralizing the system prompt in the server definition.
|
|
10
|
+
|
|
11
|
+
**What's New:**
|
|
12
|
+
- Added `instructions` optional field to `MCPServerConfig` type
|
|
13
|
+
- Instructions are passed to the underlying MCP SDK Server during initialization
|
|
14
|
+
- Instructions are sent to clients in the `InitializeResult` response
|
|
15
|
+
- Fully compatible with all MCP clients (Cursor, Windsurf, Claude Desktop, etc.)
|
|
16
|
+
|
|
17
|
+
**Example Usage:**
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
const server = new MCPServer({
|
|
21
|
+
name: 'GitHub MCP Server',
|
|
22
|
+
version: '1.0.0',
|
|
23
|
+
instructions:
|
|
24
|
+
'Use the available tools to help users manage GitHub repositories, issues, and pull requests. Always search before creating to avoid duplicates.',
|
|
25
|
+
tools: { searchIssues, createIssue, listPRs },
|
|
26
|
+
});
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
- Updated dependencies [[`3d93a15`](https://github.com/mastra-ai/mastra/commit/3d93a15796b158c617461c8b98bede476ebb43e2), [`efe406a`](https://github.com/mastra-ai/mastra/commit/efe406a1353c24993280ebc2ed61dd9f65b84b26), [`119e5c6`](https://github.com/mastra-ai/mastra/commit/119e5c65008f3e5cfca954eefc2eb85e3bf40da4), [`74e504a`](https://github.com/mastra-ai/mastra/commit/74e504a3b584eafd2f198001c6a113bbec589fd3), [`e33fdbd`](https://github.com/mastra-ai/mastra/commit/e33fdbd07b33920d81e823122331b0c0bee0bb59), [`929f69c`](https://github.com/mastra-ai/mastra/commit/929f69c3436fa20dd0f0e2f7ebe8270bd82a1529), [`8a73529`](https://github.com/mastra-ai/mastra/commit/8a73529ca01187f604b1f3019d0a725ac63ae55f)]:
|
|
30
|
+
- @mastra/core@1.0.0-beta.16
|
|
31
|
+
|
|
3
32
|
## 1.0.0-beta.6
|
|
4
33
|
|
|
5
34
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -2378,7 +2378,16 @@ var MCPServer = class extends mcp.MCPServerBase {
|
|
|
2378
2378
|
if (opts.prompts) {
|
|
2379
2379
|
capabilities.prompts = { listChanged: true };
|
|
2380
2380
|
}
|
|
2381
|
-
this.server = new index_js$1.Server(
|
|
2381
|
+
this.server = new index_js$1.Server(
|
|
2382
|
+
{
|
|
2383
|
+
name: this.name,
|
|
2384
|
+
version: this.version
|
|
2385
|
+
},
|
|
2386
|
+
{
|
|
2387
|
+
capabilities,
|
|
2388
|
+
...this.instructions ? { instructions: this.instructions } : {}
|
|
2389
|
+
}
|
|
2390
|
+
);
|
|
2382
2391
|
this.logger.info(
|
|
2383
2392
|
`Initialized MCPServer '${this.name}' v${this.version} (ID: ${this.id}) with tools: ${Object.keys(this.convertedTools).join(", ")} and resources. Capabilities: ${JSON.stringify(capabilities)}`
|
|
2384
2393
|
);
|
|
@@ -2475,7 +2484,16 @@ var MCPServer = class extends mcp.MCPServerBase {
|
|
|
2475
2484
|
if (this.promptOptions) {
|
|
2476
2485
|
capabilities.prompts = { listChanged: true };
|
|
2477
2486
|
}
|
|
2478
|
-
const serverInstance = new index_js$1.Server(
|
|
2487
|
+
const serverInstance = new index_js$1.Server(
|
|
2488
|
+
{
|
|
2489
|
+
name: this.name,
|
|
2490
|
+
version: this.version
|
|
2491
|
+
},
|
|
2492
|
+
{
|
|
2493
|
+
capabilities,
|
|
2494
|
+
...this.instructions ? { instructions: this.instructions } : {}
|
|
2495
|
+
}
|
|
2496
|
+
);
|
|
2479
2497
|
this.registerHandlersOnServer(serverInstance);
|
|
2480
2498
|
return serverInstance;
|
|
2481
2499
|
}
|