@payloadcms/plugin-mcp 3.83.0-internal.06ac84e → 3.83.0-internal.86b7bfb
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/dist/collections/createApiKeysCollection.d.ts +3 -3
- package/dist/collections/createApiKeysCollection.d.ts.map +1 -1
- package/dist/collections/createApiKeysCollection.js.map +1 -1
- package/dist/endpoints/mcp.d.ts +2 -2
- package/dist/endpoints/mcp.d.ts.map +1 -1
- package/dist/endpoints/mcp.js.map +1 -1
- package/dist/index.d.ts +6 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/mcp/getMcpHandler.d.ts +2 -2
- package/dist/mcp/getMcpHandler.d.ts.map +1 -1
- package/dist/mcp/getMcpHandler.js.map +1 -1
- package/dist/mcp/tools/auth/auth.js +1 -1
- package/dist/mcp/tools/auth/auth.js.map +1 -1
- package/dist/mcp/tools/auth/forgotPassword.js +1 -1
- package/dist/mcp/tools/auth/forgotPassword.js.map +1 -1
- package/dist/mcp/tools/auth/login.js +1 -1
- package/dist/mcp/tools/auth/login.js.map +1 -1
- package/dist/mcp/tools/auth/resetPassword.js +1 -1
- package/dist/mcp/tools/auth/resetPassword.js.map +1 -1
- package/dist/mcp/tools/auth/unlock.js +1 -1
- package/dist/mcp/tools/auth/unlock.js.map +1 -1
- package/dist/mcp/tools/global/find.d.ts +2 -2
- package/dist/mcp/tools/global/find.d.ts.map +1 -1
- package/dist/mcp/tools/global/find.js +1 -1
- package/dist/mcp/tools/global/find.js.map +1 -1
- package/dist/mcp/tools/global/update.d.ts +2 -2
- package/dist/mcp/tools/global/update.d.ts.map +1 -1
- package/dist/mcp/tools/global/update.js +1 -1
- package/dist/mcp/tools/global/update.js.map +1 -1
- package/dist/mcp/tools/job/run.js +2 -2
- package/dist/mcp/tools/job/run.js.map +1 -1
- package/dist/mcp/tools/resource/create.d.ts +2 -2
- package/dist/mcp/tools/resource/create.d.ts.map +1 -1
- package/dist/mcp/tools/resource/create.js +1 -1
- package/dist/mcp/tools/resource/create.js.map +1 -1
- package/dist/mcp/tools/resource/delete.d.ts +2 -2
- package/dist/mcp/tools/resource/delete.d.ts.map +1 -1
- package/dist/mcp/tools/resource/delete.js +3 -3
- package/dist/mcp/tools/resource/delete.js.map +1 -1
- package/dist/mcp/tools/resource/find.d.ts +2 -2
- package/dist/mcp/tools/resource/find.d.ts.map +1 -1
- package/dist/mcp/tools/resource/find.js +2 -2
- package/dist/mcp/tools/resource/find.js.map +1 -1
- package/dist/mcp/tools/resource/update.d.ts +2 -2
- package/dist/mcp/tools/resource/update.d.ts.map +1 -1
- package/dist/mcp/tools/resource/update.js +3 -3
- package/dist/mcp/tools/resource/update.js.map +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +3 -3
- package/src/collections/createApiKeysCollection.ts +5 -5
- package/src/endpoints/mcp.ts +2 -2
- package/src/index.ts +13 -7
- package/src/mcp/getMcpHandler.ts +6 -6
- package/src/mcp/tools/auth/auth.ts +1 -1
- package/src/mcp/tools/auth/forgotPassword.ts +1 -1
- package/src/mcp/tools/auth/login.ts +1 -1
- package/src/mcp/tools/auth/resetPassword.ts +1 -1
- package/src/mcp/tools/auth/unlock.ts +1 -1
- package/src/mcp/tools/global/find.ts +3 -3
- package/src/mcp/tools/global/update.ts +3 -3
- package/src/mcp/tools/job/run.ts +2 -2
- package/src/mcp/tools/resource/create.ts +3 -3
- package/src/mcp/tools/resource/delete.ts +5 -5
- package/src/mcp/tools/resource/find.ts +4 -4
- package/src/mcp/tools/resource/update.ts +5 -5
- package/src/types.ts +2 -2
|
@@ -4,7 +4,7 @@ import type { PayloadRequest, SelectType, TypedUser } from 'payload'
|
|
|
4
4
|
|
|
5
5
|
import { z } from 'zod'
|
|
6
6
|
|
|
7
|
-
import type {
|
|
7
|
+
import type { MCPPluginConfig } from '../../../types.js'
|
|
8
8
|
|
|
9
9
|
import { toCamelCase } from '../../../utils/camelCase.js'
|
|
10
10
|
import {
|
|
@@ -20,7 +20,7 @@ export const updateResourceTool = (
|
|
|
20
20
|
user: TypedUser,
|
|
21
21
|
verboseLogs: boolean,
|
|
22
22
|
collectionSlug: string,
|
|
23
|
-
collections:
|
|
23
|
+
collections: MCPPluginConfig['collections'],
|
|
24
24
|
schema: JSONSchema4,
|
|
25
25
|
) => {
|
|
26
26
|
const tool = async (
|
|
@@ -178,7 +178,7 @@ export const updateResourceTool = (
|
|
|
178
178
|
text: `Document updated successfully in collection "${collectionSlug}"!
|
|
179
179
|
Updated document:
|
|
180
180
|
\`\`\`json
|
|
181
|
-
${JSON.stringify(result
|
|
181
|
+
${JSON.stringify(result)}
|
|
182
182
|
\`\`\``,
|
|
183
183
|
},
|
|
184
184
|
],
|
|
@@ -236,14 +236,14 @@ Errors: ${errors.length}
|
|
|
236
236
|
if (docs.length > 0) {
|
|
237
237
|
responseText += `\n\nUpdated documents:
|
|
238
238
|
\`\`\`json
|
|
239
|
-
${JSON.stringify(docs
|
|
239
|
+
${JSON.stringify(docs)}
|
|
240
240
|
\`\`\``
|
|
241
241
|
}
|
|
242
242
|
|
|
243
243
|
if (errors.length > 0) {
|
|
244
244
|
responseText += `\n\nErrors:
|
|
245
245
|
\`\`\`json
|
|
246
|
-
${JSON.stringify(errors
|
|
246
|
+
${JSON.stringify(errors)}
|
|
247
247
|
\`\`\``
|
|
248
248
|
}
|
|
249
249
|
|
package/src/types.ts
CHANGED
|
@@ -9,7 +9,7 @@ import type { z } from 'zod'
|
|
|
9
9
|
|
|
10
10
|
import { type ResourceTemplate } from '@modelcontextprotocol/sdk/server/mcp.js'
|
|
11
11
|
|
|
12
|
-
export type
|
|
12
|
+
export type MCPPluginConfig = {
|
|
13
13
|
/**
|
|
14
14
|
* Set the collections that should be available as resources via MCP.
|
|
15
15
|
*/
|
|
@@ -425,7 +425,7 @@ export type MCPAccessSettings = {
|
|
|
425
425
|
user: TypedUser
|
|
426
426
|
} & Record<string, unknown>
|
|
427
427
|
|
|
428
|
-
export type EntityConfig =
|
|
428
|
+
export type EntityConfig = MCPPluginConfig['collections'] | MCPPluginConfig['globals']
|
|
429
429
|
|
|
430
430
|
export type FieldDefinition = {
|
|
431
431
|
description?: string
|