Commit c852d85
feat(plugin-mcp): add support for server instructions (#15858)
### What?
Adds an `instructions` option to the MCP plugin's `MCPServerOptions`
type.
### Why?
The MCP protocol supports an `instructions` field that is sent to
clients during initialization. The Payload MCP plugin currently doesn't
expose this option, so users have no way to provide instructions
describing how to use the server and its features.
### How?
- Added `instructions` field to `MCPServerOptions` in `types.ts`
- Pass `instructions` through to the MCP SDK via `createMcpHandler` in
`getMcpHandler.ts`
```ts
mcpPlugin({
collections: { ... },
mcp: {
serverOptions: {
instructions: 'This server manages blog posts and pages.',
},
},
})
```
---------
Co-authored-by: Paul Popus <paul@payloadcms.com>1 parent 7ca8b05 commit c852d85
2 files changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
527 | 527 | | |
528 | 528 | | |
529 | 529 | | |
| 530 | + | |
530 | 531 | | |
531 | 532 | | |
532 | 533 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
376 | 380 | | |
377 | 381 | | |
378 | 382 | | |
| |||
0 commit comments