You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/plugins/mcp.mdx
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: MCP Plugin
3
3
label: MCP
4
-
order: 120
4
+
order: 49
5
5
desc: MCP (Model Context Protocol) capabilities with Payload
6
6
keywords: plugins, mcp, ai, model context protocol, plugin, payload, cms
7
7
---
@@ -86,18 +86,18 @@ export default config
86
86
|`disabled`|`boolean`| Disable the MCP plugin while keeping database schema consistent. |
87
87
|`overrideApiKeyCollection`|`function`| A function that allows you to override the automatically generated API Keys collection. |
88
88
|`mcp`|`object`| MCP options that allow you to customize the MCP server. |
89
-
|`mcp.tools`|`array`| An array of custom tools to add to the MCP server. |
89
+
|`mcp.tools`|`array`| An array of tools to add to the MCP server.|
90
90
|`mcp.tools.name`|`string`| The name of the tool. |
91
91
|`mcp.tools.description`|`string`| The description of the tool. |
92
92
|`mcp.tools.handler`|`function`| The handler function for the tool. |
93
93
|`mcp.tools.parameters`|`object`| The parameters for the tool (Zod schema). |
94
-
|`mcp.prompts`|`array`| An array of custom prompts to add to the MCP server. |
94
+
|`mcp.prompts`|`array`| An array of prompts to add to the MCP server.|
95
95
|`mcp.prompts.name`|`string`| The name of the prompt. |
96
96
|`mcp.prompts.title`|`string`| The title of the prompt (used by LLMs to determine when to use it). |
97
97
|`mcp.prompts.description`|`string`| The description of the prompt. |
98
98
|`mcp.prompts.handler`|`function`| The handler function for the prompt. |
99
99
|`mcp.prompts.argsSchema`|`object`| The arguments schema for the prompt (Zod schema). |
100
-
|`mcp.resources`|`array`| An array of custom resources to add to the MCP server. |
100
+
|`mcp.resources`|`array`| An array of resources to add to the MCP server.|
101
101
|`mcp.resources.name`|`string`| The name of the resource. |
102
102
|`mcp.resources.title`|`string`| The title of the resource (used by LLMs to determine when to use it). |
103
103
|`mcp.resources.description`|`string`| The description of the resource. |
@@ -120,14 +120,14 @@ The plugin automatically creates an **API Keys** collection that provides high-r
120
120
- Create API keys for MCP clients
121
121
- Allow or disallow specific MCP capabilities in real-time
122
122
- Control which collections can be accessed via MCP
123
-
- Enable or disable custom tools
123
+
- Enable or disable tools
124
124
125
125
You can customize this collection using the `overrideApiKeyCollection` option:
126
126
127
127
```ts
128
128
mcpPlugin({
129
129
overrideApiKeyCollection: (collection) => {
130
-
// Add custom fields to the API Keys collection
130
+
// Add fields to the API Keys collection
131
131
collection.fields.push({
132
132
name: 'department',
133
133
type: 'select',
@@ -142,7 +142,7 @@ mcpPlugin({
142
142
})
143
143
```
144
144
145
-
## Custom Prompts
145
+
## Prompts
146
146
147
147
Prompts allow LLMs to generate structured messages for specific tasks. Each prompt defines a schema for arguments and returns formatted messages:
148
148
@@ -171,7 +171,7 @@ prompts: [
171
171
]
172
172
```
173
173
174
-
## Custom Resources
174
+
## Resources
175
175
176
176
Resources provide access to data or content that LLMs can read. They can be static or dynamic with parameterized URIs:
177
177
@@ -259,15 +259,15 @@ collections: {
259
259
}
260
260
```
261
261
262
-
### Custom Tool with Database Access
262
+
### Example Tool with Database Access
263
263
264
-
Custom tools allow you to extend MCP capabilities beyond basic CRUD operations. Use them when you need to perform complex queries, aggregations, or business logic that isn't covered by the standard collection operations.
264
+
Tools allow you to extend MCP capabilities beyond basic CRUD operations. Use them when you need to perform complex queries, aggregations, or business logic that isn't covered by the standard collection operations.
265
265
266
266
```ts
267
267
tools: [
268
268
{
269
-
name: 'getPostStats',
270
-
description: 'Get statistics about posts in the system',
269
+
name: 'getPostScores',
270
+
description: 'Get useful scores about content in posts',
271
271
handler: async (args, { payload }) => {
272
272
const stats =awaitpayload.find({
273
273
collection: 'posts',
@@ -328,7 +328,7 @@ const config = buildConfig({
328
328
collections: {
329
329
posts: {
330
330
enabled: true,
331
-
description: 'My posts',
331
+
description: 'Posts with content about science and nature',
0 commit comments