@payloadcms/plugin-mcp 3.63.0 → 3.64.0-internal.23abf20

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.
Files changed (42) hide show
  1. package/dist/collections/createApiKeysCollection.d.ts +2 -2
  2. package/dist/collections/createApiKeysCollection.d.ts.map +1 -1
  3. package/dist/collections/createApiKeysCollection.js +67 -6
  4. package/dist/collections/createApiKeysCollection.js.map +1 -1
  5. package/dist/endpoints/mcp.d.ts.map +1 -1
  6. package/dist/endpoints/mcp.js +2 -2
  7. package/dist/endpoints/mcp.js.map +1 -1
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +1 -1
  10. package/dist/index.js.map +1 -1
  11. package/dist/mcp/getMcpHandler.d.ts +2 -2
  12. package/dist/mcp/getMcpHandler.d.ts.map +1 -1
  13. package/dist/mcp/getMcpHandler.js +61 -49
  14. package/dist/mcp/getMcpHandler.js.map +1 -1
  15. package/dist/mcp/tools/resource/create.d.ts.map +1 -1
  16. package/dist/mcp/tools/resource/create.js +2 -1
  17. package/dist/mcp/tools/resource/create.js.map +1 -1
  18. package/dist/mcp/tools/resource/delete.d.ts.map +1 -1
  19. package/dist/mcp/tools/resource/delete.js +2 -1
  20. package/dist/mcp/tools/resource/delete.js.map +1 -1
  21. package/dist/mcp/tools/resource/find.d.ts.map +1 -1
  22. package/dist/mcp/tools/resource/find.js +3 -1
  23. package/dist/mcp/tools/resource/find.js.map +1 -1
  24. package/dist/mcp/tools/resource/update.d.ts.map +1 -1
  25. package/dist/mcp/tools/resource/update.js +4 -2
  26. package/dist/mcp/tools/resource/update.js.map +1 -1
  27. package/dist/mcp/tools/schemas.js +13 -13
  28. package/dist/mcp/tools/schemas.js.map +1 -1
  29. package/dist/types.d.ts +9 -3
  30. package/dist/types.d.ts.map +1 -1
  31. package/dist/types.js.map +1 -1
  32. package/package.json +3 -3
  33. package/src/collections/createApiKeysCollection.ts +80 -3
  34. package/src/endpoints/mcp.ts +3 -3
  35. package/src/index.ts +6 -1
  36. package/src/mcp/getMcpHandler.ts +79 -59
  37. package/src/mcp/tools/resource/create.ts +2 -1
  38. package/src/mcp/tools/resource/delete.ts +2 -1
  39. package/src/mcp/tools/resource/find.ts +3 -1
  40. package/src/mcp/tools/resource/update.ts +4 -2
  41. package/src/mcp/tools/schemas.ts +13 -13
  42. package/src/types.ts +10 -4
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/mcp/tools/schemas.ts"],"sourcesContent":["import { z } from 'zod'\n\nexport const toolSchemas = {\n findResources: {\n description: 'Find documents in a Payload collection using Find or FindByID.',\n parameters: z.object({\n id: z\n .string()\n .optional()\n .describe(\n 'Optional: specific document ID to retrieve. If not provided, returns all documents',\n ),\n limit: z\n .number()\n .int()\n .min(1, 'Limit must be at least 1')\n .max(100, 'Limit cannot exceed 100')\n .optional()\n .default(10)\n .describe('Maximum number of documents to return (default: 10, max: 100)'),\n page: z\n .number()\n .int()\n .min(1, 'Page must be at least 1')\n .optional()\n .default(1)\n .describe('Page number for pagination (default: 1)'),\n sort: z\n .string()\n .optional()\n .describe('Field to sort by (e.g., \"createdAt\", \"-updatedAt\" for descending)'),\n where: z\n .string()\n .optional()\n .describe(\n 'Optional JSON string for where clause filtering (e.g., \\'{\"title\": {\"contains\": \"test\"}}\\')',\n ),\n }),\n },\n\n createResource: {\n description: 'Create a document in a Payload collection.',\n parameters: z.object({\n data: z.string().describe('JSON string containing the data for the new document'),\n draft: z\n .boolean()\n .optional()\n .default(false)\n .describe('Whether to create the document as a draft'),\n }),\n },\n\n updateResource: {\n description: 'Update documents in a Payload collection by ID or where clause.',\n parameters: z.object({\n id: z.string().optional().describe('Optional: specific document ID to update'),\n data: z.string().describe('JSON string containing the data to update'),\n depth: z\n .number()\n .int()\n .min(0)\n .max(10)\n .optional()\n .default(0)\n .describe('Depth of population for relationships'),\n draft: z.boolean().optional().default(false).describe('Whether to update as a draft'),\n filePath: z.string().optional().describe('Optional: absolute file path for file uploads'),\n overrideLock: z\n .boolean()\n .optional()\n .default(true)\n .describe('Whether to override document locks'),\n overwriteExistingFiles: z\n .boolean()\n .optional()\n .default(false)\n .describe('Whether to overwrite existing files'),\n where: z\n .string()\n .optional()\n .describe('Optional: JSON string for where clause to update multiple documents'),\n }),\n },\n\n deleteResource: {\n description: 'Delete documents in a Payload collection by ID or where clause.',\n parameters: z.object({\n id: z.string().optional().describe('Optional: specific document ID to delete'),\n depth: z\n .number()\n .int()\n .min(0)\n .max(10)\n .optional()\n .default(0)\n .describe('Depth of population for relationships in response'),\n where: z\n .string()\n .optional()\n .describe('Optional: JSON string for where clause to delete multiple documents'),\n }),\n },\n\n // Experimental Below This Line\n createCollection: {\n description: 'Creates a new Payload collection with specified fields and configuration.',\n parameters: z.object({\n collectionDescription: z\n .string()\n .optional()\n .describe('Optional description for the collection'),\n collectionName: z.string().describe('The name of the collection to create'),\n fields: z.array(z.any()).describe('Array of field definitions for the collection'),\n hasUpload: z\n .boolean()\n .optional()\n .describe('Whether the collection should have upload capabilities'),\n }),\n },\n\n findCollections: {\n description: 'Finds and lists Payload collections with optional content and document counts.',\n parameters: z.object({\n collectionName: z\n .string()\n .optional()\n .describe('Optional: specific collection name to retrieve'),\n includeContent: z\n .boolean()\n .optional()\n .default(false)\n .describe('Whether to include collection file content'),\n includeCount: z\n .boolean()\n .optional()\n .default(false)\n .describe('Whether to include document counts for each collection'),\n }),\n },\n\n updateCollection: {\n description:\n 'Updates an existing Payload collection with new fields, modifications, or configuration changes.',\n parameters: z.object({\n collectionName: z.string().describe('The name of the collection to update'),\n configUpdates: z.any().optional().describe('Configuration updates (for update_config type)'),\n fieldModifications: z\n .array(z.any())\n .optional()\n .describe('Field modifications (for modify_field type)'),\n fieldNamesToRemove: z\n .array(z.string())\n .optional()\n .describe('Field names to remove (for remove_field type)'),\n newContent: z\n .string()\n .optional()\n .describe('New content to replace entire collection (for replace_content type)'),\n newFields: z.array(z.any()).optional().describe('New fields to add (for add_field type)'),\n updateType: z\n .enum(['add_field', 'remove_field', 'modify_field', 'update_config', 'replace_content'])\n .describe('Type of update to perform'),\n }),\n },\n\n deleteCollection: {\n description: 'Deletes a Payload collection and optionally updates the configuration.',\n parameters: z.object({\n collectionName: z.string().describe('The name of the collection to delete'),\n confirmDeletion: z.boolean().describe('Confirmation flag to prevent accidental deletion'),\n updateConfig: z\n .boolean()\n .optional()\n .default(false)\n .describe('Whether to update payload.config.ts to remove collection reference'),\n }),\n },\n\n findConfig: {\n description: 'Reads and displays the current Payload configuration file.',\n parameters: z.object({\n includeMetadata: z\n .boolean()\n .optional()\n .default(false)\n .describe('Whether to include file metadata (size, modified date, etc.)'),\n }),\n },\n\n updateConfig: {\n description: 'Updates the Payload configuration file with various modifications.',\n parameters: z.object({\n adminConfig: z\n .any()\n .optional()\n .describe('Admin configuration updates (for update_admin type)'),\n collectionName: z\n .string()\n .optional()\n .describe('Collection name (required for add_collection and remove_collection)'),\n databaseConfig: z\n .any()\n .optional()\n .describe('Database configuration updates (for update_database type)'),\n generalConfig: z.any().optional().describe('General configuration updates'),\n newContent: z\n .string()\n .optional()\n .describe('New configuration content (for replace_content type)'),\n pluginUpdates: z\n .any()\n .optional()\n .describe('Plugin configuration updates (for update_plugins type)'),\n updateType: z\n .enum([\n 'add_collection',\n 'remove_collection',\n 'update_admin',\n 'update_database',\n 'update_plugins',\n 'replace_content',\n ])\n .describe('Type of configuration update to perform'),\n }),\n },\n\n auth: {\n description: 'Checks authentication status for the current user.',\n parameters: z.object({\n headers: z\n .string()\n .optional()\n .describe(\n 'Optional JSON string containing custom headers to send with the authentication request',\n ),\n }),\n },\n\n login: {\n description: 'Authenticates a user with email and password.',\n parameters: z.object({\n collection: z.string().describe('The collection containing the user (e.g., \"users\")'),\n depth: z\n .number()\n .int()\n .min(0)\n .max(10)\n .optional()\n .default(0)\n .describe('Depth of population for relationships'),\n email: z.string().email().describe('The user email address'),\n overrideAccess: z\n .boolean()\n .optional()\n .default(false)\n .describe('Whether to override access controls'),\n password: z.string().describe('The user password'),\n showHiddenFields: z\n .boolean()\n .optional()\n .default(false)\n .describe('Whether to show hidden fields in the response'),\n }),\n },\n\n verify: {\n description: 'Verifies a user email with a verification token.',\n parameters: z.object({\n collection: z.string().describe('The collection containing the user (e.g., \"users\")'),\n token: z.string().describe('The verification token sent to the user email'),\n }),\n },\n\n resetPassword: {\n description: 'Resets a user password with a reset token.',\n parameters: z.object({\n collection: z.string().describe('The collection containing the user (e.g., \"users\")'),\n password: z.string().describe('The new password for the user'),\n token: z.string().describe('The password reset token sent to the user email'),\n }),\n },\n\n forgotPassword: {\n description: 'Sends a password reset email to a user.',\n parameters: z.object({\n collection: z.string().describe('The collection containing the user (e.g., \"users\")'),\n disableEmail: z\n .boolean()\n .optional()\n .default(false)\n .describe('Whether to disable sending the email (for testing)'),\n email: z.string().email().describe('The user email address'),\n }),\n },\n\n unlock: {\n description: 'Unlocks a user account that has been locked due to failed login attempts.',\n parameters: z.object({\n collection: z.string().describe('The collection containing the user (e.g., \"users\")'),\n email: z.string().email().describe('The user email address'),\n }),\n },\n\n createJob: {\n description: 'Creates a new Payload job (task or workflow) with specified configuration.',\n parameters: z.object({\n description: z.string().describe('Description of what the job does'),\n inputSchema: z.record(z.any()).optional().default({}).describe('Input schema for the job'),\n jobData: z\n .record(z.any())\n .optional()\n .default({})\n .describe('Additional job configuration data'),\n jobName: z\n .string()\n .min(1, 'Job name cannot be empty')\n .regex(/^[a-z][\\w-]*$/i, 'Job name must be alphanumeric and can contain underscores/dashes')\n .describe('The name of the job to create'),\n jobSlug: z\n .string()\n .min(1, 'Job slug cannot be empty')\n .regex(/^[a-z][a-z0-9-]*$/, 'Job slug must be kebab-case')\n .describe('The slug for the job (kebab-case format)'),\n jobType: z\n .enum(['task', 'workflow'])\n .describe('Whether to create a task (individual unit) or workflow (orchestrates tasks)'),\n outputSchema: z.record(z.any()).optional().default({}).describe('Output schema for the job'),\n }),\n },\n\n updateJob: {\n description: 'Updates an existing Payload job with new configuration, schema, or handler code.',\n parameters: z.object({\n configUpdate: z.record(z.any()).optional().describe('New configuration for the job'),\n handlerCode: z\n .string()\n .optional()\n .describe('New handler code to replace the existing handler'),\n inputSchema: z.record(z.any()).optional().describe('New input schema for the job'),\n jobSlug: z.string().describe('The slug of the job to update'),\n outputSchema: z.record(z.any()).optional().describe('New output schema for the job'),\n taskSequence: z.array(z.any()).optional().describe('New task sequence for workflows'),\n updateType: z\n .enum(['modify_schema', 'update_tasks', 'change_config', 'replace_handler'])\n .describe('Type of update to perform on the job'),\n }),\n },\n\n runJob: {\n description: 'Runs a Payload job with specified input data and queue options.',\n parameters: z.object({\n delay: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe('Delay in milliseconds before job execution'),\n input: z.record(z.any()).describe('Input data for the job execution'),\n jobSlug: z.string().describe('The slug of the job to run'),\n priority: z\n .number()\n .int()\n .min(1)\n .max(10)\n .optional()\n .describe('Job priority (1-10, higher is more important)'),\n queue: z\n .string()\n .optional()\n .describe('Queue name to use for job execution (default: \"default\")'),\n }),\n },\n}\n"],"names":["z","toolSchemas","findResources","description","parameters","object","id","string","optional","describe","limit","number","int","min","max","default","page","sort","where","createResource","data","draft","boolean","updateResource","depth","filePath","overrideLock","overwriteExistingFiles","deleteResource","createCollection","collectionDescription","collectionName","fields","array","any","hasUpload","findCollections","includeContent","includeCount","updateCollection","configUpdates","fieldModifications","fieldNamesToRemove","newContent","newFields","updateType","enum","deleteCollection","confirmDeletion","updateConfig","findConfig","includeMetadata","adminConfig","databaseConfig","generalConfig","pluginUpdates","auth","headers","login","collection","email","overrideAccess","password","showHiddenFields","verify","token","resetPassword","forgotPassword","disableEmail","unlock","createJob","inputSchema","record","jobData","jobName","regex","jobSlug","jobType","outputSchema","updateJob","configUpdate","handlerCode","taskSequence","runJob","delay","input","priority","queue"],"mappings":"AAAA,SAASA,CAAC,QAAQ,MAAK;AAEvB,OAAO,MAAMC,cAAc;IACzBC,eAAe;QACbC,aAAa;QACbC,YAAYJ,EAAEK,MAAM,CAA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T5E,aAAa;QACbC,YAAYJ,EAAEK,MAAM,CAAC;YACnB2E,cAAchF,EAAEwE,MAAM,CAACxE,EAAEkC,GAAG,IAAI1B,QAAQ,GAAGC,QAAQ,CAAC;YACpDwE,aAAajF,EACVO,MAAM,GACNC,QAAQ,GACRC,QAAQ,CAAC;YACZ8D,aAAavE,EAAEwE,MAAM,CAACxE,EAAEkC,GAAG,IAAI1B,QAAQ,GAAGC,QAAQ,CAAC;YACnDmE,SAAS5E,EAAEO,MAAM,GAAGE,QAAQ,CAAC;YAC7BqE,cAAc9E,EAAEwE,MAAM,CAACxE,EAAEkC,GAAG,IAAI1B,QAAQ,GAAGC,QAAQ,CAAC;YACpDyE,cAAclF,EAAEiC,KAAK,CAACjC,EAAEkC,GAAG,IAAI1B,QAAQ,GAAGC,QAAQ,CAAC;YACnDoC,YAAY7C,EACT8C,IAAI,CAAC;gBAAC;gBAAiB;gBAAgB;gBAAiB;aAAkB,EAC1ErC,QAAQ,CAAC;QACd;IACF;IAEA0E,QAAQ;QACNhF,aAAa;QACbC,YAAYJ,EAAEK,MAAM,CAAC;YACnB+E,OAAOpF,EACJW,MAAM,GACNC,GAAG,GACHC,GAAG,CAAC,GACJL,QAAQ,GACRC,QAAQ,CAAC;YACZ4E,OAAOrF,EAAEwE,MAAM,CAACxE,EAAEkC,GAAG,IAAIzB,QAAQ,CAAC;YAClCmE,SAAS5E,EAAEO,MAAM,GAAGE,QAAQ,CAAC;YAC7B6E,UAAUtF,EACPW,MAAM,GACNC,GAAG,GACHC,GAAG,CAAC,GACJC,GAAG,CAAC,IACJN,QAAQ,GACRC,QAAQ,CAAC;YACZ8E,OAAOvF,EACJO,MAAM,GACNC,QAAQ,GACRC,QAAQ,CAAC;QACd;IACF;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../src/mcp/tools/schemas.ts"],"sourcesContent":["import { z } from 'zod'\n\nexport const toolSchemas = {\n findResources: {\n description: 'Find documents in a collection by ID or where clause using Find or FindByID.',\n parameters: z.object({\n id: z\n .string()\n .optional()\n .describe(\n 'Optional: specific document ID to retrieve. If not provided, returns all documents',\n ),\n limit: z\n .number()\n .int()\n .min(1, 'Limit must be at least 1')\n .max(100, 'Limit cannot exceed 100')\n .optional()\n .default(10)\n .describe('Maximum number of documents to return (default: 10, max: 100)'),\n page: z\n .number()\n .int()\n .min(1, 'Page must be at least 1')\n .optional()\n .default(1)\n .describe('Page number for pagination (default: 1)'),\n sort: z\n .string()\n .optional()\n .describe('Field to sort by (e.g., \"createdAt\", \"-updatedAt\" for descending)'),\n where: z\n .string()\n .optional()\n .describe(\n 'Optional JSON string for where clause filtering (e.g., \\'{\"title\": {\"contains\": \"test\"}}\\')',\n ),\n }),\n },\n\n createResource: {\n description: 'Create a document in a collection.',\n parameters: z.object({\n data: z.string().describe('JSON string containing the data for the new document'),\n draft: z\n .boolean()\n .optional()\n .default(false)\n .describe('Whether to create the document as a draft'),\n }),\n },\n\n updateResource: {\n description: 'Update documents in a collection by ID or where clause.',\n parameters: z.object({\n id: z.string().optional().describe('Optional: specific document ID to update'),\n data: z.string().describe('JSON string containing the data to update'),\n depth: z\n .number()\n .int()\n .min(0)\n .max(10)\n .optional()\n .default(0)\n .describe('Depth of population for relationships'),\n draft: z.boolean().optional().default(false).describe('Whether to update as a draft'),\n filePath: z.string().optional().describe('Optional: absolute file path for file uploads'),\n overrideLock: z\n .boolean()\n .optional()\n .default(true)\n .describe('Whether to override document locks'),\n overwriteExistingFiles: z\n .boolean()\n .optional()\n .default(false)\n .describe('Whether to overwrite existing files'),\n where: z\n .string()\n .optional()\n .describe('Optional: JSON string for where clause to update multiple documents'),\n }),\n },\n\n deleteResource: {\n description: 'Delete documents in a collection by ID or where clause.',\n parameters: z.object({\n id: z.string().optional().describe('Optional: specific document ID to delete'),\n depth: z\n .number()\n .int()\n .min(0)\n .max(10)\n .optional()\n .default(0)\n .describe('Depth of population for relationships in response'),\n where: z\n .string()\n .optional()\n .describe('Optional: JSON string for where clause to delete multiple documents'),\n }),\n },\n\n // Experimental Below This Line\n createCollection: {\n description: 'Creates a new collection with specified fields and configuration.',\n parameters: z.object({\n collectionDescription: z\n .string()\n .optional()\n .describe('Optional description for the collection'),\n collectionName: z.string().describe('The name of the collection to create'),\n fields: z.array(z.any()).describe('Array of field definitions for the collection'),\n hasUpload: z\n .boolean()\n .optional()\n .describe('Whether the collection should have upload capabilities'),\n }),\n },\n\n findCollections: {\n description: 'Finds and lists collections with optional content and document counts.',\n parameters: z.object({\n collectionName: z\n .string()\n .optional()\n .describe('Optional: specific collection name to retrieve'),\n includeContent: z\n .boolean()\n .optional()\n .default(false)\n .describe('Whether to include collection file content'),\n includeCount: z\n .boolean()\n .optional()\n .default(false)\n .describe('Whether to include document counts for each collection'),\n }),\n },\n\n updateCollection: {\n description:\n 'Updates an existing collection with new fields, modifications, or configuration changes.',\n parameters: z.object({\n collectionName: z.string().describe('The name of the collection to update'),\n configUpdates: z.any().optional().describe('Configuration updates (for update_config type)'),\n fieldModifications: z\n .array(z.any())\n .optional()\n .describe('Field modifications (for modify_field type)'),\n fieldNamesToRemove: z\n .array(z.string())\n .optional()\n .describe('Field names to remove (for remove_field type)'),\n newContent: z\n .string()\n .optional()\n .describe('New content to replace entire collection (for replace_content type)'),\n newFields: z.array(z.any()).optional().describe('New fields to add (for add_field type)'),\n updateType: z\n .enum(['add_field', 'remove_field', 'modify_field', 'update_config', 'replace_content'])\n .describe('Type of update to perform'),\n }),\n },\n\n deleteCollection: {\n description: 'Deletes a collection and optionally updates the configuration.',\n parameters: z.object({\n collectionName: z.string().describe('The name of the collection to delete'),\n confirmDeletion: z.boolean().describe('Confirmation flag to prevent accidental deletion'),\n updateConfig: z\n .boolean()\n .optional()\n .default(false)\n .describe('Whether to update payload.config.ts to remove collection reference'),\n }),\n },\n\n findConfig: {\n description: 'Reads and displays the current configuration file.',\n parameters: z.object({\n includeMetadata: z\n .boolean()\n .optional()\n .default(false)\n .describe('Whether to include file metadata (size, modified date, etc.)'),\n }),\n },\n\n updateConfig: {\n description: 'Updates the configuration file with various modifications.',\n parameters: z.object({\n adminConfig: z\n .any()\n .optional()\n .describe('Admin configuration updates (for update_admin type)'),\n collectionName: z\n .string()\n .optional()\n .describe('Collection name (required for add_collection and remove_collection)'),\n databaseConfig: z\n .any()\n .optional()\n .describe('Database configuration updates (for update_database type)'),\n generalConfig: z.any().optional().describe('General configuration updates'),\n newContent: z\n .string()\n .optional()\n .describe('New configuration content (for replace_content type)'),\n pluginUpdates: z\n .any()\n .optional()\n .describe('Plugin configuration updates (for update_plugins type)'),\n updateType: z\n .enum([\n 'add_collection',\n 'remove_collection',\n 'update_admin',\n 'update_database',\n 'update_plugins',\n 'replace_content',\n ])\n .describe('Type of configuration update to perform'),\n }),\n },\n\n auth: {\n description: 'Checks authentication status for the current user.',\n parameters: z.object({\n headers: z\n .string()\n .optional()\n .describe(\n 'Optional JSON string containing custom headers to send with the authentication request',\n ),\n }),\n },\n\n login: {\n description: 'Authenticates a user with email and password.',\n parameters: z.object({\n collection: z.string().describe('The collection containing the user (e.g., \"users\")'),\n depth: z\n .number()\n .int()\n .min(0)\n .max(10)\n .optional()\n .default(0)\n .describe('Depth of population for relationships'),\n email: z.string().email().describe('The user email address'),\n overrideAccess: z\n .boolean()\n .optional()\n .default(false)\n .describe('Whether to override access controls'),\n password: z.string().describe('The user password'),\n showHiddenFields: z\n .boolean()\n .optional()\n .default(false)\n .describe('Whether to show hidden fields in the response'),\n }),\n },\n\n verify: {\n description: 'Verifies a user email with a verification token.',\n parameters: z.object({\n collection: z.string().describe('The collection containing the user (e.g., \"users\")'),\n token: z.string().describe('The verification token sent to the user email'),\n }),\n },\n\n resetPassword: {\n description: 'Resets a user password with a reset token.',\n parameters: z.object({\n collection: z.string().describe('The collection containing the user (e.g., \"users\")'),\n password: z.string().describe('The new password for the user'),\n token: z.string().describe('The password reset token sent to the user email'),\n }),\n },\n\n forgotPassword: {\n description: 'Sends a password reset email to a user.',\n parameters: z.object({\n collection: z.string().describe('The collection containing the user (e.g., \"users\")'),\n disableEmail: z\n .boolean()\n .optional()\n .default(false)\n .describe('Whether to disable sending the email (for testing)'),\n email: z.string().email().describe('The user email address'),\n }),\n },\n\n unlock: {\n description: 'Unlocks a user account that has been locked due to failed login attempts.',\n parameters: z.object({\n collection: z.string().describe('The collection containing the user (e.g., \"users\")'),\n email: z.string().email().describe('The user email address'),\n }),\n },\n\n createJob: {\n description: 'Creates a new job (task or workflow) with specified configuration.',\n parameters: z.object({\n description: z.string().describe('Description of what the job does'),\n inputSchema: z.record(z.any()).optional().default({}).describe('Input schema for the job'),\n jobData: z\n .record(z.any())\n .optional()\n .default({})\n .describe('Additional job configuration data'),\n jobName: z\n .string()\n .min(1, 'Job name cannot be empty')\n .regex(/^[a-z][\\w-]*$/i, 'Job name must be alphanumeric and can contain underscores/dashes')\n .describe('The name of the job to create'),\n jobSlug: z\n .string()\n .min(1, 'Job slug cannot be empty')\n .regex(/^[a-z][a-z0-9-]*$/, 'Job slug must be kebab-case')\n .describe('The slug for the job (kebab-case format)'),\n jobType: z\n .enum(['task', 'workflow'])\n .describe('Whether to create a task (individual unit) or workflow (orchestrates tasks)'),\n outputSchema: z.record(z.any()).optional().default({}).describe('Output schema for the job'),\n }),\n },\n\n updateJob: {\n description: 'Updates an existing job with new configuration, schema, or handler code.',\n parameters: z.object({\n configUpdate: z.record(z.any()).optional().describe('New configuration for the job'),\n handlerCode: z\n .string()\n .optional()\n .describe('New handler code to replace the existing handler'),\n inputSchema: z.record(z.any()).optional().describe('New input schema for the job'),\n jobSlug: z.string().describe('The slug of the job to update'),\n outputSchema: z.record(z.any()).optional().describe('New output schema for the job'),\n taskSequence: z.array(z.any()).optional().describe('New task sequence for workflows'),\n updateType: z\n .enum(['modify_schema', 'update_tasks', 'change_config', 'replace_handler'])\n .describe('Type of update to perform on the job'),\n }),\n },\n\n runJob: {\n description: 'Runs a job with specified input data and queue options.',\n parameters: z.object({\n delay: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe('Delay in milliseconds before job execution'),\n input: z.record(z.any()).describe('Input data for the job execution'),\n jobSlug: z.string().describe('The slug of the job to run'),\n priority: z\n .number()\n .int()\n .min(1)\n .max(10)\n .optional()\n .describe('Job priority (1-10, higher is more important)'),\n queue: z\n .string()\n .optional()\n .describe('Queue name to use for job execution (default: \"default\")'),\n }),\n },\n}\n"],"names":["z","toolSchemas","findResources","description","parameters","object","id","string","optional","describe","limit","number","int","min","max","default","page","sort","where","createResource","data","draft","boolean","updateResource","depth","filePath","overrideLock","overwriteExistingFiles","deleteResource","createCollection","collectionDescription","collectionName","fields","array","any","hasUpload","findCollections","includeContent","includeCount","updateCollection","configUpdates","fieldModifications","fieldNamesToRemove","newContent","newFields","updateType","enum","deleteCollection","confirmDeletion","updateConfig","findConfig","includeMetadata","adminConfig","databaseConfig","generalConfig","pluginUpdates","auth","headers","login","collection","email","overrideAccess","password","showHiddenFields","verify","token","resetPassword","forgotPassword","disableEmail","unlock","createJob","inputSchema","record","jobData","jobName","regex","jobSlug","jobType","outputSchema","updateJob","configUpdate","handlerCode","taskSequence","runJob","delay","input","priority","queue"],"mappings":"AAAA,SAASA,CAAC,QAAQ,MAAK;AAEvB,OAAO,MAAMC,cAAc;IACzBC,eAAe;QACbC,aAAa;QACbC,YAAYJ,EAAEK,MAAM,CAAC;YACnBC,IAAIN,EACDO,MAAM,GACNC,QAAQ,GACRC,QAAQ,CACP;YAEJC,OAAOV,EACJW,MAAM,GACNC,GAAG,GACHC,GAAG,CAAC,GAAG,4BACPC,GAAG,CAAC,KAAK,2BACTN,QAAQ,GACRO,OAAO,CAAC,IACRN,QAAQ,CAAC;YACZO,MAAMhB,EACHW,MAAM,GACNC,GAAG,GACHC,GAAG,CAAC,GAAG,2BACPL,QAAQ,GACRO,OAAO,CAAC,GACRN,QAAQ,CAAC;YACZQ,MAAMjB,EACHO,MAAM,GACNC,QAAQ,GACRC,QAAQ,CAAC;YACZS,OAAOlB,EACJO,MAAM,GACNC,QAAQ,GACRC,QAAQ,CACP;QAE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,EAAEiC,KAAK,CAACjC,EAAEkC,GAAG,IAAI1B,QAAQ,GAAGC,QAAQ,CAAC;YACnDoC,YAAY7C,EACT8C,IAAI,CAAC;gBAAC;gBAAiB;gBAAgB;gBAAiB;aAAkB,EAC1ErC,QAAQ,CAAC;QACd;IACF;IAEA0E,QAAQ;QACNhF,aAAa;QACbC,YAAYJ,EAAEK,MAAM,CAAC;YACnB+E,OAAOpF,EACJW,MAAM,GACNC,GAAG,GACHC,GAAG,CAAC,GACJL,QAAQ,GACRC,QAAQ,CAAC;YACZ4E,OAAOrF,EAAEwE,MAAM,CAACxE,EAAEkC,GAAG,IAAIzB,QAAQ,CAAC;YAClCmE,SAAS5E,EAAEO,MAAM,GAAGE,QAAQ,CAAC;YAC7B6E,UAAUtF,EACPW,MAAM,GACNC,GAAG,GACHC,GAAG,CAAC,GACJC,GAAG,CAAC,IACJN,QAAQ,GACRC,QAAQ,CAAC;YACZ8E,OAAOvF,EACJO,MAAM,GACNC,QAAQ,GACRC,QAAQ,CAAC;QACd;IACF;AACF,EAAC"}
package/dist/types.d.ts CHANGED
@@ -9,7 +9,7 @@ export type PluginMCPServerConfig = {
9
9
  /**
10
10
  * Set the description of the collection. This is used by MCP clients to determine when to use the collecton as a resource.
11
11
  */
12
- description: string;
12
+ description?: string;
13
13
  /**
14
14
  * Set the enabled capabilities of the collection. Admins can then allow or disallow the use of the capability by MCP clients.
15
15
  */
@@ -198,6 +198,10 @@ export type PluginMCPServerConfig = {
198
198
  }[];
199
199
  };
200
200
  overrideApiKeyCollection?: (collection: CollectionConfig) => CollectionConfig;
201
+ /**
202
+ * Set the users collection that API keys should be associated with.
203
+ */
204
+ userCollection?: CollectionConfig | string;
201
205
  };
202
206
  /**
203
207
  * MCP Handler options.
@@ -244,7 +248,7 @@ export type MCPServerOptions = {
244
248
  version: string;
245
249
  };
246
250
  };
247
- export type ToolSettings = {
251
+ export type MCPAccessSettings = {
248
252
  auth?: {
249
253
  auth?: boolean;
250
254
  forgotPassword?: boolean;
@@ -263,12 +267,14 @@ export type ToolSettings = {
263
267
  find?: boolean;
264
268
  update?: boolean;
265
269
  };
266
- custom?: Record<string, boolean>;
267
270
  jobs?: {
268
271
  create?: boolean;
269
272
  run?: boolean;
270
273
  update?: boolean;
271
274
  };
275
+ 'payload-mcp-prompt'?: Record<string, boolean>;
276
+ 'payload-mcp-resource'?: Record<string, boolean>;
277
+ 'payload-mcp-tool'?: Record<string, boolean>;
272
278
  } & Record<string, unknown>;
273
279
  export type FieldDefinition = {
274
280
  description?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAC/E,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAE5B,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,yCAAyC,CAAA;AAE/E,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CACnB,MAAM,CACJ,cAAc,EACd;QACE;;WAEG;QACH,WAAW,EAAE,MAAM,CAAA;QACnB;;WAEG;QACH,OAAO,EACH;YACE,MAAM,CAAC,EAAE,OAAO,CAAA;YAChB,MAAM,CAAC,EAAE,OAAO,CAAA;YAChB,IAAI,CAAC,EAAE,OAAO,CAAA;YACd,MAAM,CAAC,EAAE,OAAO,CAAA;SACjB,GACD,OAAO,CAAA;QAEX;;WAEG;QACH,QAAQ,CAAC,EAAE,CACT,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,GAAG,EAAE,cAAc,KAChB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;QAE5B;;WAEG;QACH,gBAAgB,CAAC,EAAE,CACjB,QAAQ,EAAE;YACR,OAAO,EAAE,KAAK,CAAC;gBACb,IAAI,EAAE,MAAM,CAAA;gBACZ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AAC,EAAE,OAAO,CAAA;QACjB,UAAU,CAAC,EAAE,MAAM,CAAA;KACpB,CAAA;CACF,CAAA;AAED,MAAM,WAAW,WAAW;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,gBAAgB;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB"}
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type { CollectionConfig, CollectionSlug, PayloadRequest } from 'payload'\nimport type { z } from 'zod'\n\nimport { type ResourceTemplate } from '@modelcontextprotocol/sdk/server/mcp.js'\n\nexport type PluginMCPServerConfig = {\n /**\n * Set the collections that should be available as resources via MCP.\n */\n collections?: Partial<\n Record<\n CollectionSlug,\n {\n /**\n * Set the description of the collection. This is used by MCP clients to determine when to use the collecton as a resource.\n */\n description: string\n /**\n * Set the enabled capabilities of the collection. Admins can then allow or disallow the use of the capability by MCP clients.\n */\n enabled:\n | {\n create?: boolean\n delete?: boolean\n find?: boolean\n update?: boolean\n }\n | boolean\n\n /**\n * Override the data generated by the MCP client. This allows you to modify the data that is sent to the MCP client. This is useful for adding additional data to the response, data normalization, or verifying data.\n */\n override?: (\n original: Record<string, unknown>,\n req: PayloadRequest,\n ) => Record<string, unknown>\n\n /**\n * Override the response generated by the MCP client. This allows you to modify the response that is sent to the MCP client. This is useful for adding additional data to the response, data normalization, or verifying data.\n */\n overrideResponse?: (\n response: {\n content: Array<{\n text: string\n type: string\n }>\n },\n doc: Record<string, unknown>,\n req: PayloadRequest,\n ) => {\n content: Array<{\n text: string\n type: string\n }>\n }\n }\n >\n >\n /**\n * Disable the MCP plugin.\n */\n disabled?: boolean\n /**\n * Experimental features\n * **These features are for experimental purposes -- They are Disabled in Production by Default**\n */\n experimental?: {\n /**\n * These are MCP tools that can be used by a client to modify Payload.\n */\n tools: {\n /**\n * **Experimental** -- Auth MCP tools allow a client to change authentication priviliages for users. This is for developing ideas that help Admins with authentication tasks.\n */\n auth?: {\n /**\n * Enable the auth MCP tools. This allows Admins to enable or disable the auth capabilities.\n * @default false\n */\n enabled: boolean\n }\n /**\n * **Experimental** -- Collection MCP tools allow for the creation, modification, and deletion of Payload collections. This is for developing ideas that help Developers with collection tasks.\n */\n collections?: {\n /**\n * Set the directory path to the collections directory. This can be a directory outside of your default directory, or another Payload project.\n */\n collectionsDirPath: string\n /**\n * Enable the collection MCP tools. This allows Admins to enable or disable the Collection modification capabilities.\n * @default false\n */\n enabled: boolean\n }\n /**\n * **Experimental** -- Config MCP tools allow for the modification of a Payload Config. This is for developing ideas that help Developers with config tasks.\n */\n config?: {\n /**\n * Set the directory path to the config directory. This can be a directory outside of your default directory, or another Payload project.\n */\n configFilePath: string\n /**\n * Enable the config MCP tools. This allows Admins to enable or disable the Payload Config modification capabilities.\n * @default false\n */\n enabled: boolean\n }\n /**\n * **Experimental** -- Jobs MCP tools allow for the modification of Payload jobs. This is for developing ideas that help Developers with job tasks.\n */\n jobs?: {\n /**\n * Enable the jobs MCP tools. This allows Admins to enable or disable the Job modification capabilities.\n * @default false\n */\n enabled: boolean\n /**\n * Set the directory path to the jobs directory. This can be a directory outside of your default directory, or another Payload project.\n */\n jobsDirPath: string\n }\n }\n }\n /**\n * MCP Server options.\n */\n mcp?: {\n handlerOptions?: MCPHandlerOptions\n /**\n * Add custom MCP Prompts.\n */\n prompts?: {\n /**\n * Set the args schema of the prompt. This is the args schema that will be passed to the prompt. This is used by MCP clients to determine the arguments that will be passed to the prompt.\n */\n argsSchema: z.ZodRawShape\n /**\n * Set the description of the prompt. This is used by MCP clients to determine when to use the prompt.\n */\n description: string\n /**\n * Set the handler of the prompt. This is the function that will be called when the prompt is used.\n */\n handler: (...args: any) => any\n /**\n * Set the function name of the prompt.\n */\n name: string\n /**\n * Set the title of the prompt. LLMs will interperate the title to determine when to use the prompt.\n */\n title: string\n }[]\n\n /**\n * Add custom MCP Resource.\n */\n resources?: {\n /**\n * Set the description of the resource. This is used by MCP clients to determine when to use the resource.\n * example: 'Data is a resource that contains special data.'\n */\n description: string\n /**\n * Set the handler of the resource. This is the function that will be called when the resource is used.\n */\n handler: (...args: any) => any\n /**\n * Set the mime type of the resource.\n * example: 'text/plain'\n */\n mimeType: string\n /**\n * Set the function name of the resource.\n * example: 'data'\n */\n name: string\n /**\n * Set the title of the resource. LLMs will interperate the title to determine when to use the resource.\n * example: 'Data'\n */\n title: string\n /**\n * Set the uri of the resource.\n * example: 'data://app'\n */\n uri: ResourceTemplate | string\n }[]\n serverOptions?: MCPServerOptions\n /**\n * Add custom MCP Tools.\n */\n tools?: {\n /**\n * Set the description of the tool. This is used by MCP clients to determine when to use the tool.\n */\n description: string\n /**\n * Set the handler of the tool. This is the function that will be called when the tool is used.\n */\n handler: (args: Record<string, unknown>) => Promise<{\n content: Array<{\n text: string\n type: 'text'\n }>\n }>\n /**\n * Set the name of the tool. This is the name that will be used to identify the tool. LLMs will interperate the name to determine when to use the tool.\n */\n name: string\n /**\n * Set the parameters of the tool. This is the parameters that will be passed to the tool.\n */\n parameters: z.ZodRawShape\n }[]\n }\n overrideApiKeyCollection?: (collection: CollectionConfig) => CollectionConfig\n}\n\n/**\n * MCP Handler options.\n */\nexport type MCPHandlerOptions = {\n /**\n * Set the base path of the MCP handler. This is the path that will be used to access the MCP handler.\n * @default /api\n */\n basePath?: string\n /**\n * Set the maximum duration of the MCP handler. This is the maximum duration that the MCP handler will run for.\n * @default 60\n */\n maxDuration?: number\n /**\n * Set the Redis URL for the MCP handler. This is the URL that will be used to access the Redis server.\n * @default process.env.REDIS_URL\n * INFO: Disabled until developer clarity is reached for server side streaming and we have an auth pattern for all SSE patterns\n */\n // redisUrl?: string\n /**\n * Set verbose logging.\n * @default false\n */\n verboseLogs?: boolean\n}\n\n/**\n * MCP Server options.\n */\nexport type MCPServerOptions = {\n /**\n * Set the server info of the MCP server.\n */\n serverInfo?: {\n /**\n * Set the name of the MCP server.\n * @default 'Payload MCP Server'\n */\n name: string\n /**\n * Set the version of the MCP server.\n * @default '1.0.0'\n */\n version: string\n }\n}\n\nexport type ToolSettings = {\n auth?: {\n auth?: boolean\n forgotPassword?: boolean\n login?: boolean\n resetPassword?: boolean\n unlock?: boolean\n verify?: boolean\n }\n collections?: {\n create?: boolean\n delete?: boolean\n find?: boolean\n update?: boolean\n }\n config?: {\n find?: boolean\n update?: boolean\n }\n custom?: Record<string, boolean>\n jobs?: {\n create?: boolean\n run?: boolean\n update?: boolean\n }\n} & Record<string, unknown>\n\nexport type FieldDefinition = {\n description?: string\n name: string\n options?: { label: string; value: string }[]\n position?: 'main' | 'sidebar'\n required?: boolean\n type: string\n}\n\nexport type FieldModification = {\n changes: {\n description?: string\n options?: { label: string; value: string }[]\n position?: 'main' | 'sidebar'\n required?: boolean\n type?: string\n }\n fieldName: string\n}\n\nexport type CollectionConfigUpdates = {\n access?: {\n create?: string\n delete?: string\n read?: string\n update?: string\n }\n description?: string\n slug?: string\n timestamps?: boolean\n versioning?: boolean\n}\n\nexport type AdminConfig = {\n avatar?: string\n css?: string\n dateFormat?: string\n inactivityRoute?: string\n livePreview?: {\n breakpoints?: Array<{\n height: number\n label: string\n name: string\n width: number\n }>\n }\n logoutRoute?: string\n meta?: {\n favicon?: string\n ogImage?: string\n titleSuffix?: string\n }\n user?: string\n}\n\nexport type DatabaseConfig = {\n connectOptions?: string\n type?: 'mongodb' | 'postgres'\n url?: string\n}\n\nexport type PluginUpdates = {\n add?: string[]\n remove?: string[]\n}\n\nexport type GeneralConfig = {\n cookiePrefix?: string\n cors?: string\n csrf?: string\n graphQL?: {\n disable?: boolean\n schemaOutputFile?: string\n }\n rateLimit?: {\n max?: number\n skip?: string\n window?: number\n }\n secret?: string\n serverURL?: string\n typescript?: {\n declare?: boolean\n outputFile?: string\n }\n}\n\nexport interface SchemaField {\n description?: string\n name: string\n options?: string[]\n required?: boolean\n type: string\n}\n\nexport interface TaskSequenceItem {\n description?: string\n retries?: number\n taskId: string\n taskSlug: string\n timeout?: number\n}\n\nexport interface JobConfigUpdate {\n description?: string\n queue?: string\n retries?: number\n timeout?: number\n}\n"],"names":[],"mappings":"AA+YA,WAKC"}
1
+ {"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type { CollectionConfig, CollectionSlug, PayloadRequest } from 'payload'\nimport type { z } from 'zod'\n\nimport { type ResourceTemplate } from '@modelcontextprotocol/sdk/server/mcp.js'\n\nexport type PluginMCPServerConfig = {\n /**\n * Set the collections that should be available as resources via MCP.\n */\n collections?: Partial<\n Record<\n CollectionSlug,\n {\n /**\n * Set the description of the collection. This is used by MCP clients to determine when to use the collecton as a resource.\n */\n description?: string\n /**\n * Set the enabled capabilities of the collection. Admins can then allow or disallow the use of the capability by MCP clients.\n */\n enabled:\n | {\n create?: boolean\n delete?: boolean\n find?: boolean\n update?: boolean\n }\n | boolean\n /**\n * Override the data generated by the MCP client. This allows you to modify the data that is sent to the MCP client. This is useful for adding additional data to the response, data normalization, or verifying data.\n */\n override?: (\n original: Record<string, unknown>,\n req: PayloadRequest,\n ) => Record<string, unknown>\n\n /**\n * Override the response generated by the MCP client. This allows you to modify the response that is sent to the MCP client. This is useful for adding additional data to the response, data normalization, or verifying data.\n */\n overrideResponse?: (\n response: {\n content: Array<{\n text: string\n type: string\n }>\n },\n doc: Record<string, unknown>,\n req: PayloadRequest,\n ) => {\n content: Array<{\n text: string\n type: string\n }>\n }\n }\n >\n >\n /**\n * Disable the MCP plugin.\n */\n disabled?: boolean\n /**\n * Experimental features\n * **These features are for experimental purposes -- They are Disabled in Production by Default**\n */\n experimental?: {\n /**\n * These are MCP tools that can be used by a client to modify Payload.\n */\n tools: {\n /**\n * **Experimental** -- Auth MCP tools allow a client to change authentication priviliages for users. This is for developing ideas that help Admins with authentication tasks.\n */\n auth?: {\n /**\n * Enable the auth MCP tools. This allows Admins to enable or disable the auth capabilities.\n * @default false\n */\n enabled: boolean\n }\n /**\n * **Experimental** -- Collection MCP tools allow for the creation, modification, and deletion of Payload collections. This is for developing ideas that help Developers with collection tasks.\n */\n collections?: {\n /**\n * Set the directory path to the collections directory. This can be a directory outside of your default directory, or another Payload project.\n */\n collectionsDirPath: string\n /**\n * Enable the collection MCP tools. This allows Admins to enable or disable the Collection modification capabilities.\n * @default false\n */\n enabled: boolean\n }\n /**\n * **Experimental** -- Config MCP tools allow for the modification of a Payload Config. This is for developing ideas that help Developers with config tasks.\n */\n config?: {\n /**\n * Set the directory path to the config directory. This can be a directory outside of your default directory, or another Payload project.\n */\n configFilePath: string\n /**\n * Enable the config MCP tools. This allows Admins to enable or disable the Payload Config modification capabilities.\n * @default false\n */\n enabled: boolean\n }\n /**\n * **Experimental** -- Jobs MCP tools allow for the modification of Payload jobs. This is for developing ideas that help Developers with job tasks.\n */\n jobs?: {\n /**\n * Enable the jobs MCP tools. This allows Admins to enable or disable the Job modification capabilities.\n * @default false\n */\n enabled: boolean\n /**\n * Set the directory path to the jobs directory. This can be a directory outside of your default directory, or another Payload project.\n */\n jobsDirPath: string\n }\n }\n }\n /**\n * MCP Server options.\n */\n mcp?: {\n handlerOptions?: MCPHandlerOptions\n /**\n * Add custom MCP Prompts.\n */\n prompts?: {\n /**\n * Set the args schema of the prompt. This is the args schema that will be passed to the prompt. This is used by MCP clients to determine the arguments that will be passed to the prompt.\n */\n argsSchema: z.ZodRawShape\n /**\n * Set the description of the prompt. This is used by MCP clients to determine when to use the prompt.\n */\n description: string\n /**\n * Set the handler of the prompt. This is the function that will be called when the prompt is used.\n */\n handler: (...args: any) => any\n /**\n * Set the function name of the prompt.\n */\n name: string\n /**\n * Set the title of the prompt. LLMs will interperate the title to determine when to use the prompt.\n */\n title: string\n }[]\n\n /**\n * Add custom MCP Resource.\n */\n resources?: {\n /**\n * Set the description of the resource. This is used by MCP clients to determine when to use the resource.\n * example: 'Data is a resource that contains special data.'\n */\n description: string\n /**\n * Set the handler of the resource. This is the function that will be called when the resource is used.\n */\n handler: (...args: any) => any\n /**\n * Set the mime type of the resource.\n * example: 'text/plain'\n */\n mimeType: string\n /**\n * Set the function name of the resource.\n * example: 'data'\n */\n name: string\n /**\n * Set the title of the resource. LLMs will interperate the title to determine when to use the resource.\n * example: 'Data'\n */\n title: string\n /**\n * Set the uri of the resource.\n * example: 'data://app'\n */\n uri: ResourceTemplate | string\n }[]\n serverOptions?: MCPServerOptions\n /**\n * Add custom MCP Tools.\n */\n tools?: {\n /**\n * Set the description of the tool. This is used by MCP clients to determine when to use the tool.\n */\n description: string\n /**\n * Set the handler of the tool. This is the function that will be called when the tool is used.\n */\n handler: (args: Record<string, unknown>) => Promise<{\n content: Array<{\n text: string\n type: 'text'\n }>\n }>\n /**\n * Set the name of the tool. This is the name that will be used to identify the tool. LLMs will interperate the name to determine when to use the tool.\n */\n name: string\n /**\n * Set the parameters of the tool. This is the parameters that will be passed to the tool.\n */\n parameters: z.ZodRawShape\n }[]\n }\n overrideApiKeyCollection?: (collection: CollectionConfig) => CollectionConfig\n\n /**\n * Set the users collection that API keys should be associated with.\n */\n userCollection?: CollectionConfig | string\n}\n\n/**\n * MCP Handler options.\n */\nexport type MCPHandlerOptions = {\n /**\n * Set the base path of the MCP handler. This is the path that will be used to access the MCP handler.\n * @default /api\n */\n basePath?: string\n /**\n * Set the maximum duration of the MCP handler. This is the maximum duration that the MCP handler will run for.\n * @default 60\n */\n maxDuration?: number\n /**\n * Set the Redis URL for the MCP handler. This is the URL that will be used to access the Redis server.\n * @default process.env.REDIS_URL\n * INFO: Disabled until developer clarity is reached for server side streaming and we have an auth pattern for all SSE patterns\n */\n // redisUrl?: string\n /**\n * Set verbose logging.\n * @default false\n */\n verboseLogs?: boolean\n}\n\n/**\n * MCP Server options.\n */\nexport type MCPServerOptions = {\n /**\n * Set the server info of the MCP server.\n */\n serverInfo?: {\n /**\n * Set the name of the MCP server.\n * @default 'Payload MCP Server'\n */\n name: string\n /**\n * Set the version of the MCP server.\n * @default '1.0.0'\n */\n version: string\n }\n}\n\nexport type MCPAccessSettings = {\n auth?: {\n auth?: boolean\n forgotPassword?: boolean\n login?: boolean\n resetPassword?: boolean\n unlock?: boolean\n verify?: boolean\n }\n collections?: {\n create?: boolean\n delete?: boolean\n find?: boolean\n update?: boolean\n }\n config?: {\n find?: boolean\n update?: boolean\n }\n jobs?: {\n create?: boolean\n run?: boolean\n update?: boolean\n }\n 'payload-mcp-prompt'?: Record<string, boolean>\n 'payload-mcp-resource'?: Record<string, boolean>\n 'payload-mcp-tool'?: Record<string, boolean>\n} & Record<string, unknown>\n\nexport type FieldDefinition = {\n description?: string\n name: string\n options?: { label: string; value: string }[]\n position?: 'main' | 'sidebar'\n required?: boolean\n type: string\n}\n\nexport type FieldModification = {\n changes: {\n description?: string\n options?: { label: string; value: string }[]\n position?: 'main' | 'sidebar'\n required?: boolean\n type?: string\n }\n fieldName: string\n}\n\nexport type CollectionConfigUpdates = {\n access?: {\n create?: string\n delete?: string\n read?: string\n update?: string\n }\n description?: string\n slug?: string\n timestamps?: boolean\n versioning?: boolean\n}\n\nexport type AdminConfig = {\n avatar?: string\n css?: string\n dateFormat?: string\n inactivityRoute?: string\n livePreview?: {\n breakpoints?: Array<{\n height: number\n label: string\n name: string\n width: number\n }>\n }\n logoutRoute?: string\n meta?: {\n favicon?: string\n ogImage?: string\n titleSuffix?: string\n }\n user?: string\n}\n\nexport type DatabaseConfig = {\n connectOptions?: string\n type?: 'mongodb' | 'postgres'\n url?: string\n}\n\nexport type PluginUpdates = {\n add?: string[]\n remove?: string[]\n}\n\nexport type GeneralConfig = {\n cookiePrefix?: string\n cors?: string\n csrf?: string\n graphQL?: {\n disable?: boolean\n schemaOutputFile?: string\n }\n rateLimit?: {\n max?: number\n skip?: string\n window?: number\n }\n secret?: string\n serverURL?: string\n typescript?: {\n declare?: boolean\n outputFile?: string\n }\n}\n\nexport interface SchemaField {\n description?: string\n name: string\n options?: string[]\n required?: boolean\n type: string\n}\n\nexport interface TaskSequenceItem {\n description?: string\n retries?: number\n taskId: string\n taskSlug: string\n timeout?: number\n}\n\nexport interface JobConfigUpdate {\n description?: string\n queue?: string\n retries?: number\n timeout?: number\n}\n"],"names":[],"mappings":"AAqZA,WAKC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/plugin-mcp",
3
- "version": "3.63.0",
3
+ "version": "3.64.0-internal.23abf20",
4
4
  "description": "MCP (Model Context Protocol) capabilities with Payload",
5
5
  "keywords": [
6
6
  "plugin",
@@ -45,10 +45,10 @@
45
45
  },
46
46
  "devDependencies": {
47
47
  "@payloadcms/eslint-config": "3.28.0",
48
- "payload": "3.63.0"
48
+ "payload": "3.64.0-internal.23abf20"
49
49
  },
50
50
  "peerDependencies": {
51
- "payload": "3.63.0"
51
+ "payload": "3.64.0-internal.23abf20"
52
52
  },
53
53
  "homepage:": "https://payloadcms.com",
54
54
  "scripts": {
@@ -106,6 +106,7 @@ const addEnabledCollectionTools = (collections: PluginMCPServerConfig['collectio
106
106
  ]
107
107
  : []),
108
108
  ],
109
+ label: false as const,
109
110
  },
110
111
  ],
111
112
  label: `${enabledCollectionSlug.charAt(0).toUpperCase() + toCamelCase(enabledCollectionSlug).slice(1)}`,
@@ -116,6 +117,7 @@ export const createAPIKeysCollection = (
116
117
  collections: PluginMCPServerConfig['collections'],
117
118
  customTools: Array<{ description: string; name: string }> = [],
118
119
  experimentalTools: NonNullable<PluginMCPServerConfig['experimental']>['tools'] = {},
120
+ pluginOptions: PluginMCPServerConfig,
119
121
  ): CollectionConfig => {
120
122
  const customToolsFields = customTools.map((tool) => {
121
123
  const camelCasedName = toCamelCase(tool.name)
@@ -130,6 +132,40 @@ export const createAPIKeysCollection = (
130
132
  }
131
133
  })
132
134
 
135
+ const customResourceFields =
136
+ pluginOptions.mcp?.resources?.map((resource) => {
137
+ const camelCasedName = toCamelCase(resource.name)
138
+ return {
139
+ name: camelCasedName,
140
+ type: 'checkbox' as const,
141
+ admin: {
142
+ description: resource.description,
143
+ },
144
+ defaultValue: true,
145
+ label: camelCasedName,
146
+ }
147
+ }) || []
148
+
149
+ const customPromptFields =
150
+ pluginOptions.mcp?.prompts?.map((prompt) => {
151
+ const camelCasedName = toCamelCase(prompt.name)
152
+ return {
153
+ name: camelCasedName,
154
+ type: 'checkbox' as const,
155
+ admin: {
156
+ description: prompt.description,
157
+ },
158
+ defaultValue: true,
159
+ label: camelCasedName,
160
+ }
161
+ }) || []
162
+
163
+ const userCollection = pluginOptions.userCollection
164
+ ? typeof pluginOptions.userCollection === 'string'
165
+ ? pluginOptions.userCollection
166
+ : pluginOptions.userCollection.slug
167
+ : 'users'
168
+
133
169
  return {
134
170
  slug: 'payload-mcp-api-keys',
135
171
  admin: {
@@ -147,7 +183,7 @@ export const createAPIKeysCollection = (
147
183
  admin: {
148
184
  description: 'The user that the API key is associated with.',
149
185
  },
150
- relationTo: 'users',
186
+ relationTo: userCollection,
151
187
  required: true,
152
188
  },
153
189
  {
@@ -176,12 +212,53 @@ export const createAPIKeysCollection = (
176
212
  },
177
213
  fields: [
178
214
  {
179
- name: 'custom',
215
+ name: 'payload-mcp-tool',
180
216
  type: 'group' as const,
181
217
  fields: customToolsFields,
218
+ label: false as const,
219
+ },
220
+ ],
221
+ label: 'Tools',
222
+ },
223
+ ]
224
+ : []),
225
+
226
+ ...(pluginOptions.mcp?.resources && pluginOptions.mcp?.resources.length > 0
227
+ ? [
228
+ {
229
+ type: 'collapsible' as const,
230
+ admin: {
231
+ position: 'sidebar' as const,
232
+ },
233
+ fields: [
234
+ {
235
+ name: 'payload-mcp-resource',
236
+ type: 'group' as const,
237
+ fields: customResourceFields,
238
+ label: false as const,
239
+ },
240
+ ],
241
+ label: 'Resources',
242
+ },
243
+ ]
244
+ : []),
245
+
246
+ ...(pluginOptions.mcp?.prompts && pluginOptions.mcp?.prompts.length > 0
247
+ ? [
248
+ {
249
+ type: 'collapsible' as const,
250
+ admin: {
251
+ position: 'sidebar' as const,
252
+ },
253
+ fields: [
254
+ {
255
+ name: 'payload-mcp-prompt',
256
+ type: 'group' as const,
257
+ fields: customPromptFields,
258
+ label: false as const,
182
259
  },
183
260
  ],
184
- label: 'Custom Tools',
261
+ label: 'Prompts',
185
262
  },
186
263
  ]
187
264
  : []),
@@ -1,7 +1,7 @@
1
1
  import crypto from 'crypto'
2
2
  import { APIError, type PayloadHandler, type Where } from 'payload'
3
3
 
4
- import type { PluginMCPServerConfig, ToolSettings } from '../types.js'
4
+ import type { MCPAccessSettings, PluginMCPServerConfig } from '../types.js'
5
5
 
6
6
  import { createRequestFromPayloadRequest } from '../mcp/createRequest.js'
7
7
  import { getMCPHandler } from '../mcp/getMcpHandler.js'
@@ -46,13 +46,13 @@ export const initializeMCPHandler = (pluginOptions: PluginMCPServerConfig) => {
46
46
  throw new APIError('API Key is invalid', 401)
47
47
  }
48
48
 
49
- const toolSettings = docs[0] as ToolSettings
49
+ const mcpAccessSettings = docs[0] as MCPAccessSettings
50
50
 
51
51
  if (useVerboseLogs) {
52
52
  payload.logger.info('[payload-mcp] API Key is valid')
53
53
  }
54
54
 
55
- const handler = getMCPHandler(pluginOptions, toolSettings, req)
55
+ const handler = getMCPHandler(pluginOptions, mcpAccessSettings, req)
56
56
  const request = createRequestFromPayloadRequest(req)
57
57
  return await handler(request)
58
58
  }
package/src/index.ts CHANGED
@@ -42,7 +42,12 @@ export const mcpPlugin =
42
42
  * - If a custom tool has gone haywire, admins can disallow that tool.
43
43
  *
44
44
  */
45
- const apiKeyCollection = createAPIKeysCollection(collections, customTools, experimentalTools)
45
+ const apiKeyCollection = createAPIKeysCollection(
46
+ collections,
47
+ customTools,
48
+ experimentalTools,
49
+ pluginOptions,
50
+ )
46
51
  if (pluginOptions.overrideApiKeyCollection) {
47
52
  config.collections.push(pluginOptions.overrideApiKeyCollection(apiKeyCollection))
48
53
  } else {