@payloadcms/plugin-mcp 4.0.0-canary.0 → 4.0.0-canary.2
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/collection/getAccessField.d.ts.map +1 -1
- package/dist/collection/getAccessField.js +25 -10
- package/dist/collection/getAccessField.js.map +1 -1
- package/dist/collection/index.d.ts.map +1 -1
- package/dist/collection/index.js +73 -27
- package/dist/collection/index.js.map +1 -1
- package/dist/components/APIKeyField/index.client.d.ts +9 -0
- package/dist/components/APIKeyField/index.client.d.ts.map +1 -0
- package/dist/components/APIKeyField/index.client.js +85 -0
- package/dist/components/APIKeyField/index.client.js.map +1 -0
- package/dist/components/APIKeyField/index.css +105 -0
- package/dist/components/APIKeysEmptyState/index.client.d.ts +4 -0
- package/dist/components/APIKeysEmptyState/index.client.d.ts.map +1 -0
- package/dist/components/APIKeysEmptyState/index.client.js +21 -0
- package/dist/components/APIKeysEmptyState/index.client.js.map +1 -0
- package/dist/components/AccessField/index.client.d.ts.map +1 -1
- package/dist/components/AccessField/index.client.js +149 -207
- package/dist/components/AccessField/index.client.js.map +1 -1
- package/dist/components/AccessField/index.css +50 -44
- package/dist/components/SettingsMenu/index.client.d.ts +8 -0
- package/dist/components/SettingsMenu/index.client.d.ts.map +1 -0
- package/dist/components/SettingsMenu/index.client.js +29 -0
- package/dist/components/SettingsMenu/index.client.js.map +1 -0
- package/dist/endpoint/access.js +21 -5
- package/dist/endpoint/access.js.map +1 -1
- package/dist/exports/client.d.ts +3 -0
- package/dist/exports/client.d.ts.map +1 -1
- package/dist/exports/client.js +3 -0
- package/dist/exports/client.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +46 -3
- package/dist/index.js.map +1 -1
- package/dist/mcp/buildMcpServer.d.ts.map +1 -1
- package/dist/mcp/buildMcpServer.js +100 -64
- package/dist/mcp/buildMcpServer.js.map +1 -1
- package/dist/mcp/builtin/collections/createTool.d.ts +1 -1
- package/dist/mcp/builtin/collections/createTool.d.ts.map +1 -1
- package/dist/mcp/builtin/collections/createTool.js +28 -21
- package/dist/mcp/builtin/collections/createTool.js.map +1 -1
- package/dist/mcp/builtin/collections/deleteTool.d.ts +1 -1
- package/dist/mcp/builtin/collections/deleteTool.d.ts.map +1 -1
- package/dist/mcp/builtin/collections/deleteTool.js +5 -20
- package/dist/mcp/builtin/collections/deleteTool.js.map +1 -1
- package/dist/mcp/builtin/collections/findTool.d.ts +1 -1
- package/dist/mcp/builtin/collections/findTool.d.ts.map +1 -1
- package/dist/mcp/builtin/collections/findTool.js +6 -21
- package/dist/mcp/builtin/collections/findTool.js.map +1 -1
- package/dist/mcp/builtin/collections/formatCollectionError.d.ts +9 -0
- package/dist/mcp/builtin/collections/formatCollectionError.d.ts.map +1 -0
- package/dist/mcp/builtin/collections/formatCollectionError.js +60 -0
- package/dist/mcp/builtin/collections/formatCollectionError.js.map +1 -0
- package/dist/mcp/builtin/collections/getCollectionSchemaTool.d.ts +2 -0
- package/dist/mcp/builtin/collections/getCollectionSchemaTool.d.ts.map +1 -0
- package/dist/mcp/builtin/collections/getCollectionSchemaTool.js +35 -0
- package/dist/mcp/builtin/collections/getCollectionSchemaTool.js.map +1 -0
- package/dist/mcp/builtin/collections/updateTool.d.ts +1 -1
- package/dist/mcp/builtin/collections/updateTool.d.ts.map +1 -1
- package/dist/mcp/builtin/collections/updateTool.js +74 -62
- package/dist/mcp/builtin/collections/updateTool.js.map +1 -1
- package/dist/mcp/builtin/getConfigInfoTool.d.ts +2 -0
- package/dist/mcp/builtin/getConfigInfoTool.d.ts.map +1 -0
- package/dist/mcp/builtin/getConfigInfoTool.js +49 -0
- package/dist/mcp/builtin/getConfigInfoTool.js.map +1 -0
- package/dist/mcp/builtin/globals/findTool.js +1 -1
- package/dist/mcp/builtin/globals/findTool.js.map +1 -1
- package/dist/mcp/builtin/globals/getGlobalSchemaTool.d.ts +2 -0
- package/dist/mcp/builtin/globals/getGlobalSchemaTool.d.ts.map +1 -0
- package/dist/mcp/builtin/globals/getGlobalSchemaTool.js +35 -0
- package/dist/mcp/builtin/globals/getGlobalSchemaTool.js.map +1 -0
- package/dist/mcp/builtin/globals/updateTool.d.ts.map +1 -1
- package/dist/mcp/builtin/globals/updateTool.js +21 -19
- package/dist/mcp/builtin/globals/updateTool.js.map +1 -1
- package/dist/mcp/builtin/validateEntityData.d.ts +14 -0
- package/dist/mcp/builtin/validateEntityData.d.ts.map +1 -0
- package/dist/mcp/builtin/validateEntityData.js +82 -0
- package/dist/mcp/builtin/validateEntityData.js.map +1 -0
- package/dist/mcp/builtinTools.d.ts +84 -16
- package/dist/mcp/builtinTools.d.ts.map +1 -1
- package/dist/mcp/builtinTools.js +54 -11
- package/dist/mcp/builtinTools.js.map +1 -1
- package/dist/mcp/sanitizeMCPConfig.d.ts.map +1 -1
- package/dist/mcp/sanitizeMCPConfig.js +61 -40
- package/dist/mcp/sanitizeMCPConfig.js.map +1 -1
- package/dist/translations/index.d.ts +11 -0
- package/dist/translations/index.d.ts.map +1 -0
- package/dist/translations/index.js +92 -0
- package/dist/translations/index.js.map +1 -0
- package/dist/translations/languages/ar.d.ts +31 -0
- package/dist/translations/languages/ar.d.ts.map +1 -0
- package/dist/translations/languages/ar.js +34 -0
- package/dist/translations/languages/ar.js.map +1 -0
- package/dist/translations/languages/az.d.ts +31 -0
- package/dist/translations/languages/az.d.ts.map +1 -0
- package/dist/translations/languages/az.js +34 -0
- package/dist/translations/languages/az.js.map +1 -0
- package/dist/translations/languages/bg.d.ts +31 -0
- package/dist/translations/languages/bg.d.ts.map +1 -0
- package/dist/translations/languages/bg.js +34 -0
- package/dist/translations/languages/bg.js.map +1 -0
- package/dist/translations/languages/bnBd.d.ts +31 -0
- package/dist/translations/languages/bnBd.d.ts.map +1 -0
- package/dist/translations/languages/bnBd.js +34 -0
- package/dist/translations/languages/bnBd.js.map +1 -0
- package/dist/translations/languages/bnIn.d.ts +31 -0
- package/dist/translations/languages/bnIn.d.ts.map +1 -0
- package/dist/translations/languages/bnIn.js +34 -0
- package/dist/translations/languages/bnIn.js.map +1 -0
- package/dist/translations/languages/ca.d.ts +31 -0
- package/dist/translations/languages/ca.d.ts.map +1 -0
- package/dist/translations/languages/ca.js +34 -0
- package/dist/translations/languages/ca.js.map +1 -0
- package/dist/translations/languages/cs.d.ts +31 -0
- package/dist/translations/languages/cs.d.ts.map +1 -0
- package/dist/translations/languages/cs.js +34 -0
- package/dist/translations/languages/cs.js.map +1 -0
- package/dist/translations/languages/da.d.ts +31 -0
- package/dist/translations/languages/da.d.ts.map +1 -0
- package/dist/translations/languages/da.js +34 -0
- package/dist/translations/languages/da.js.map +1 -0
- package/dist/translations/languages/de.d.ts +31 -0
- package/dist/translations/languages/de.d.ts.map +1 -0
- package/dist/translations/languages/de.js +34 -0
- package/dist/translations/languages/de.js.map +1 -0
- package/dist/translations/languages/en.d.ts +31 -0
- package/dist/translations/languages/en.d.ts.map +1 -0
- package/dist/translations/languages/en.js +34 -0
- package/dist/translations/languages/en.js.map +1 -0
- package/dist/translations/languages/es.d.ts +31 -0
- package/dist/translations/languages/es.d.ts.map +1 -0
- package/dist/translations/languages/es.js +34 -0
- package/dist/translations/languages/es.js.map +1 -0
- package/dist/translations/languages/et.d.ts +31 -0
- package/dist/translations/languages/et.d.ts.map +1 -0
- package/dist/translations/languages/et.js +34 -0
- package/dist/translations/languages/et.js.map +1 -0
- package/dist/translations/languages/fa.d.ts +31 -0
- package/dist/translations/languages/fa.d.ts.map +1 -0
- package/dist/translations/languages/fa.js +34 -0
- package/dist/translations/languages/fa.js.map +1 -0
- package/dist/translations/languages/fr.d.ts +31 -0
- package/dist/translations/languages/fr.d.ts.map +1 -0
- package/dist/translations/languages/fr.js +34 -0
- package/dist/translations/languages/fr.js.map +1 -0
- package/dist/translations/languages/he.d.ts +31 -0
- package/dist/translations/languages/he.d.ts.map +1 -0
- package/dist/translations/languages/he.js +34 -0
- package/dist/translations/languages/he.js.map +1 -0
- package/dist/translations/languages/hr.d.ts +31 -0
- package/dist/translations/languages/hr.d.ts.map +1 -0
- package/dist/translations/languages/hr.js +34 -0
- package/dist/translations/languages/hr.js.map +1 -0
- package/dist/translations/languages/hu.d.ts +31 -0
- package/dist/translations/languages/hu.d.ts.map +1 -0
- package/dist/translations/languages/hu.js +34 -0
- package/dist/translations/languages/hu.js.map +1 -0
- package/dist/translations/languages/hy.d.ts +31 -0
- package/dist/translations/languages/hy.d.ts.map +1 -0
- package/dist/translations/languages/hy.js +34 -0
- package/dist/translations/languages/hy.js.map +1 -0
- package/dist/translations/languages/id.d.ts +31 -0
- package/dist/translations/languages/id.d.ts.map +1 -0
- package/dist/translations/languages/id.js +34 -0
- package/dist/translations/languages/id.js.map +1 -0
- package/dist/translations/languages/is.d.ts +31 -0
- package/dist/translations/languages/is.d.ts.map +1 -0
- package/dist/translations/languages/is.js +34 -0
- package/dist/translations/languages/is.js.map +1 -0
- package/dist/translations/languages/it.d.ts +31 -0
- package/dist/translations/languages/it.d.ts.map +1 -0
- package/dist/translations/languages/it.js +34 -0
- package/dist/translations/languages/it.js.map +1 -0
- package/dist/translations/languages/ja.d.ts +31 -0
- package/dist/translations/languages/ja.d.ts.map +1 -0
- package/dist/translations/languages/ja.js +34 -0
- package/dist/translations/languages/ja.js.map +1 -0
- package/dist/translations/languages/ko.d.ts +31 -0
- package/dist/translations/languages/ko.d.ts.map +1 -0
- package/dist/translations/languages/ko.js +34 -0
- package/dist/translations/languages/ko.js.map +1 -0
- package/dist/translations/languages/lt.d.ts +31 -0
- package/dist/translations/languages/lt.d.ts.map +1 -0
- package/dist/translations/languages/lt.js +34 -0
- package/dist/translations/languages/lt.js.map +1 -0
- package/dist/translations/languages/lv.d.ts +31 -0
- package/dist/translations/languages/lv.d.ts.map +1 -0
- package/dist/translations/languages/lv.js +34 -0
- package/dist/translations/languages/lv.js.map +1 -0
- package/dist/translations/languages/my.d.ts +31 -0
- package/dist/translations/languages/my.d.ts.map +1 -0
- package/dist/translations/languages/my.js +34 -0
- package/dist/translations/languages/my.js.map +1 -0
- package/dist/translations/languages/nb.d.ts +31 -0
- package/dist/translations/languages/nb.d.ts.map +1 -0
- package/dist/translations/languages/nb.js +34 -0
- package/dist/translations/languages/nb.js.map +1 -0
- package/dist/translations/languages/nl.d.ts +31 -0
- package/dist/translations/languages/nl.d.ts.map +1 -0
- package/dist/translations/languages/nl.js +34 -0
- package/dist/translations/languages/nl.js.map +1 -0
- package/dist/translations/languages/pl.d.ts +31 -0
- package/dist/translations/languages/pl.d.ts.map +1 -0
- package/dist/translations/languages/pl.js +34 -0
- package/dist/translations/languages/pl.js.map +1 -0
- package/dist/translations/languages/pt.d.ts +31 -0
- package/dist/translations/languages/pt.d.ts.map +1 -0
- package/dist/translations/languages/pt.js +34 -0
- package/dist/translations/languages/pt.js.map +1 -0
- package/dist/translations/languages/ro.d.ts +31 -0
- package/dist/translations/languages/ro.d.ts.map +1 -0
- package/dist/translations/languages/ro.js +34 -0
- package/dist/translations/languages/ro.js.map +1 -0
- package/dist/translations/languages/rs.d.ts +31 -0
- package/dist/translations/languages/rs.d.ts.map +1 -0
- package/dist/translations/languages/rs.js +34 -0
- package/dist/translations/languages/rs.js.map +1 -0
- package/dist/translations/languages/rsLatin.d.ts +31 -0
- package/dist/translations/languages/rsLatin.d.ts.map +1 -0
- package/dist/translations/languages/rsLatin.js +34 -0
- package/dist/translations/languages/rsLatin.js.map +1 -0
- package/dist/translations/languages/ru.d.ts +31 -0
- package/dist/translations/languages/ru.d.ts.map +1 -0
- package/dist/translations/languages/ru.js +34 -0
- package/dist/translations/languages/ru.js.map +1 -0
- package/dist/translations/languages/sk.d.ts +31 -0
- package/dist/translations/languages/sk.d.ts.map +1 -0
- package/dist/translations/languages/sk.js +34 -0
- package/dist/translations/languages/sk.js.map +1 -0
- package/dist/translations/languages/sl.d.ts +31 -0
- package/dist/translations/languages/sl.d.ts.map +1 -0
- package/dist/translations/languages/sl.js +34 -0
- package/dist/translations/languages/sl.js.map +1 -0
- package/dist/translations/languages/sv.d.ts +31 -0
- package/dist/translations/languages/sv.d.ts.map +1 -0
- package/dist/translations/languages/sv.js +34 -0
- package/dist/translations/languages/sv.js.map +1 -0
- package/dist/translations/languages/ta.d.ts +31 -0
- package/dist/translations/languages/ta.d.ts.map +1 -0
- package/dist/translations/languages/ta.js +34 -0
- package/dist/translations/languages/ta.js.map +1 -0
- package/dist/translations/languages/th.d.ts +31 -0
- package/dist/translations/languages/th.d.ts.map +1 -0
- package/dist/translations/languages/th.js +34 -0
- package/dist/translations/languages/th.js.map +1 -0
- package/dist/translations/languages/tr.d.ts +31 -0
- package/dist/translations/languages/tr.d.ts.map +1 -0
- package/dist/translations/languages/tr.js +34 -0
- package/dist/translations/languages/tr.js.map +1 -0
- package/dist/translations/languages/uk.d.ts +31 -0
- package/dist/translations/languages/uk.d.ts.map +1 -0
- package/dist/translations/languages/uk.js +34 -0
- package/dist/translations/languages/uk.js.map +1 -0
- package/dist/translations/languages/vi.d.ts +31 -0
- package/dist/translations/languages/vi.d.ts.map +1 -0
- package/dist/translations/languages/vi.js +34 -0
- package/dist/translations/languages/vi.js.map +1 -0
- package/dist/translations/languages/zh.d.ts +31 -0
- package/dist/translations/languages/zh.d.ts.map +1 -0
- package/dist/translations/languages/zh.js +34 -0
- package/dist/translations/languages/zh.js.map +1 -0
- package/dist/translations/languages/zhTw.d.ts +31 -0
- package/dist/translations/languages/zhTw.d.ts.map +1 -0
- package/dist/translations/languages/zhTw.js +34 -0
- package/dist/translations/languages/zhTw.js.map +1 -0
- package/dist/translations/types.d.ts +32 -0
- package/dist/translations/types.d.ts.map +1 -0
- package/dist/translations/types.js +3 -0
- package/dist/translations/types.js.map +1 -0
- package/dist/types.d.ts +22 -28
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/schemaConversion/getEntityInputSchema.d.ts +11 -0
- package/dist/utils/schemaConversion/getEntityInputSchema.d.ts.map +1 -0
- package/dist/utils/schemaConversion/getEntityInputSchema.js +34 -0
- package/dist/utils/schemaConversion/getEntityInputSchema.js.map +1 -0
- package/dist/utils/schemaConversion/sanitizeEntitySchema.d.ts +15 -0
- package/dist/utils/schemaConversion/sanitizeEntitySchema.d.ts.map +1 -0
- package/dist/utils/schemaConversion/sanitizeEntitySchema.js +464 -0
- package/dist/utils/schemaConversion/sanitizeEntitySchema.js.map +1 -0
- package/dist/utils/schemaConversion/sanitizeEntitySchema.spec.js +158 -0
- package/dist/utils/schemaConversion/sanitizeEntitySchema.spec.js.map +1 -0
- package/dist/utils/whereSchema.d.ts +9 -0
- package/dist/utils/whereSchema.d.ts.map +1 -0
- package/dist/utils/whereSchema.js +13 -0
- package/dist/utils/whereSchema.js.map +1 -0
- package/package.json +7 -6
- package/src/collection/getAccessField.ts +33 -13
- package/src/collection/index.ts +64 -22
- package/src/components/APIKeyField/index.client.tsx +73 -0
- package/src/components/APIKeyField/index.css +105 -0
- package/src/components/APIKeysEmptyState/index.client.tsx +36 -0
- package/src/components/AccessField/index.client.tsx +175 -220
- package/src/components/AccessField/index.css +50 -44
- package/src/components/SettingsMenu/index.client.tsx +34 -0
- package/src/endpoint/access.ts +17 -5
- package/src/exports/client.ts +3 -0
- package/src/index.ts +49 -3
- package/src/mcp/buildMcpServer.ts +123 -90
- package/src/mcp/builtin/collections/createTool.ts +46 -50
- package/src/mcp/builtin/collections/deleteTool.ts +9 -16
- package/src/mcp/builtin/collections/findTool.ts +7 -17
- package/src/mcp/builtin/collections/formatCollectionError.ts +84 -0
- package/src/mcp/builtin/collections/getCollectionSchemaTool.ts +28 -0
- package/src/mcp/builtin/collections/updateTool.ts +97 -91
- package/src/mcp/builtin/getConfigInfoTool.ts +44 -0
- package/src/mcp/builtin/globals/findTool.ts +1 -1
- package/src/mcp/builtin/globals/getGlobalSchemaTool.ts +28 -0
- package/src/mcp/builtin/globals/updateTool.ts +40 -43
- package/src/mcp/builtin/validateEntityData.ts +132 -0
- package/src/mcp/builtinTools.ts +52 -38
- package/src/mcp/sanitizeMCPConfig.ts +78 -57
- package/src/translations/index.ts +108 -0
- package/src/translations/languages/ar.ts +35 -0
- package/src/translations/languages/az.ts +35 -0
- package/src/translations/languages/bg.ts +35 -0
- package/src/translations/languages/bnBd.ts +35 -0
- package/src/translations/languages/bnIn.ts +35 -0
- package/src/translations/languages/ca.ts +35 -0
- package/src/translations/languages/cs.ts +35 -0
- package/src/translations/languages/da.ts +35 -0
- package/src/translations/languages/de.ts +35 -0
- package/src/translations/languages/en.ts +35 -0
- package/src/translations/languages/es.ts +35 -0
- package/src/translations/languages/et.ts +35 -0
- package/src/translations/languages/fa.ts +35 -0
- package/src/translations/languages/fr.ts +35 -0
- package/src/translations/languages/he.ts +35 -0
- package/src/translations/languages/hr.ts +35 -0
- package/src/translations/languages/hu.ts +35 -0
- package/src/translations/languages/hy.ts +35 -0
- package/src/translations/languages/id.ts +35 -0
- package/src/translations/languages/is.ts +35 -0
- package/src/translations/languages/it.ts +35 -0
- package/src/translations/languages/ja.ts +35 -0
- package/src/translations/languages/ko.ts +35 -0
- package/src/translations/languages/lt.ts +35 -0
- package/src/translations/languages/lv.ts +35 -0
- package/src/translations/languages/my.ts +35 -0
- package/src/translations/languages/nb.ts +35 -0
- package/src/translations/languages/nl.ts +35 -0
- package/src/translations/languages/pl.ts +35 -0
- package/src/translations/languages/pt.ts +35 -0
- package/src/translations/languages/ro.ts +35 -0
- package/src/translations/languages/rs.ts +35 -0
- package/src/translations/languages/rsLatin.ts +35 -0
- package/src/translations/languages/ru.ts +35 -0
- package/src/translations/languages/sk.ts +35 -0
- package/src/translations/languages/sl.ts +35 -0
- package/src/translations/languages/sv.ts +35 -0
- package/src/translations/languages/ta.ts +35 -0
- package/src/translations/languages/th.ts +35 -0
- package/src/translations/languages/tr.ts +35 -0
- package/src/translations/languages/uk.ts +35 -0
- package/src/translations/languages/vi.ts +35 -0
- package/src/translations/languages/zh.ts +35 -0
- package/src/translations/languages/zhTw.ts +35 -0
- package/src/translations/types.ts +34 -0
- package/src/types.ts +30 -30
- package/src/utils/schemaConversion/getEntityInputSchema.ts +78 -0
- package/src/utils/schemaConversion/sanitizeEntitySchema.spec.ts +103 -0
- package/src/utils/schemaConversion/sanitizeEntitySchema.ts +529 -0
- package/src/utils/whereSchema.ts +24 -0
- package/dist/utils/schemaConversion/prepareCollectionSchema.d.ts +0 -7
- package/dist/utils/schemaConversion/prepareCollectionSchema.d.ts.map +0 -1
- package/dist/utils/schemaConversion/prepareCollectionSchema.js +0 -37
- package/dist/utils/schemaConversion/prepareCollectionSchema.js.map +0 -1
- package/dist/utils/schemaConversion/sanitizeJsonSchema.d.ts +0 -13
- package/dist/utils/schemaConversion/sanitizeJsonSchema.d.ts.map +0 -1
- package/dist/utils/schemaConversion/sanitizeJsonSchema.js +0 -56
- package/dist/utils/schemaConversion/sanitizeJsonSchema.js.map +0 -1
- package/dist/utils/schemaConversion/simplifyRelationshipFields.d.ts +0 -20
- package/dist/utils/schemaConversion/simplifyRelationshipFields.d.ts.map +0 -1
- package/dist/utils/schemaConversion/simplifyRelationshipFields.js +0 -56
- package/dist/utils/schemaConversion/simplifyRelationshipFields.js.map +0 -1
- package/dist/utils/schemaConversion/transformPointFields.d.ts +0 -3
- package/dist/utils/schemaConversion/transformPointFields.d.ts.map +0 -1
- package/dist/utils/schemaConversion/transformPointFields.js +0 -57
- package/dist/utils/schemaConversion/transformPointFields.js.map +0 -1
- package/src/utils/schemaConversion/prepareCollectionSchema.ts +0 -39
- package/src/utils/schemaConversion/sanitizeJsonSchema.ts +0 -62
- package/src/utils/schemaConversion/simplifyRelationshipFields.ts +0 -70
- package/src/utils/schemaConversion/transformPointFields.ts +0 -56
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { PluginLanguage } from '../types.js'
|
|
2
|
+
|
|
3
|
+
export const taTranslations = {
|
|
4
|
+
'plugin-mcp': {
|
|
5
|
+
apiKeyDescription: 'MCP கிளையன்ட்கள் எந்த collections, resources, tools மற்றும் prompts-ஐ அணுகலாம் என்பதை API விசைகள் கட்டுப்படுத்துகின்றன.',
|
|
6
|
+
apiKeys: 'API விசைகள்',
|
|
7
|
+
authentication: 'அங்கீகாரம்',
|
|
8
|
+
description: 'விளக்கம்',
|
|
9
|
+
descriptionDescription: 'API விசையின் நோக்கத்தை விளக்குங்கள்.',
|
|
10
|
+
dismiss: 'மூடு',
|
|
11
|
+
keepKeyPrivate: 'உங்கள் விசையை தனிப்பட்டதாக வைத்திருங்கள்.',
|
|
12
|
+
keyPrivateDescription: 'இந்த விசை MCP-க்கு உங்கள் உள்ளடக்கத்தை அணுக அனுமதிக்கிறது. இதை பிறருடன் பகிர வேண்டாம்!',
|
|
13
|
+
lastUsed: 'கடைசியாக பயன்படுத்தியது',
|
|
14
|
+
manageAPIKeys: 'API விசைகளை நிர்வகி',
|
|
15
|
+
mcp: 'MCP',
|
|
16
|
+
noAPIKeys: 'API விசைகள் இல்லை',
|
|
17
|
+
operations: 'செயல்பாடுகள்',
|
|
18
|
+
overrideAccess: 'அணுகல் கட்டுப்பாட்டை மீறு',
|
|
19
|
+
overrideAccessDescription: 'இது தேர்ந்தெடுக்கப்பட்டால், இந்த விசை மேற்கொள்ளும் ஒவ்வொரு செயல்பாட்டிலும் Payload அணுகல் கட்டுப்பாட்டை மீறும். குறிப்பிட்ட காரணம் இல்லையெனில் தேர்வு செய்ய வேண்டாம்.',
|
|
20
|
+
permissions: 'அனுமதிகள்',
|
|
21
|
+
permissionsDescription: 'MCP கிளையன்ட்களுக்கு பின்வரும் collections, tools, resources மற்றும் prompts-ஐ அணுக அனுமதிக்கவும்.',
|
|
22
|
+
prompts: 'Prompts',
|
|
23
|
+
resources: 'Resources',
|
|
24
|
+
server: 'சேவையகம்',
|
|
25
|
+
title: 'தலைப்பு',
|
|
26
|
+
titleDescription: 'API விசைக்கு உதவும் ஒரு குறுநாமம்.',
|
|
27
|
+
tools: 'Tools',
|
|
28
|
+
userDescription: 'MCP செயல்படும் பயனர்.',
|
|
29
|
+
},
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const ta: PluginLanguage = {
|
|
33
|
+
dateFNSKey: 'ta',
|
|
34
|
+
translations: taTranslations,
|
|
35
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { PluginLanguage } from '../types.js'
|
|
2
|
+
|
|
3
|
+
export const thTranslations = {
|
|
4
|
+
'plugin-mcp': {
|
|
5
|
+
apiKeyDescription: 'คีย์ API ควบคุมว่าลูกค้า MCP สามารถเข้าถึงคอลเลกชัน ทรัพยากร เครื่องมือ และพรอมป์ใดได้บ้าง',
|
|
6
|
+
apiKeys: 'คีย์ API',
|
|
7
|
+
authentication: 'การยืนยันตัวตน',
|
|
8
|
+
description: 'คำอธิบาย',
|
|
9
|
+
descriptionDescription: 'อธิบายวัตถุประสงค์ของคีย์ API',
|
|
10
|
+
dismiss: 'ปิด',
|
|
11
|
+
keepKeyPrivate: 'เก็บคีย์ของคุณไว้เป็นความลับ',
|
|
12
|
+
keyPrivateDescription: 'คีย์นี้ให้ MCP เข้าถึงเนื้อหาของคุณ อย่าแชร์กับผู้อื่น!',
|
|
13
|
+
lastUsed: 'ใช้ล่าสุด',
|
|
14
|
+
manageAPIKeys: 'จัดการคีย์ API',
|
|
15
|
+
mcp: 'MCP',
|
|
16
|
+
noAPIKeys: 'ไม่มีคีย์ API',
|
|
17
|
+
operations: 'การดำเนินการ',
|
|
18
|
+
overrideAccess: 'ข้ามการควบคุมการเข้าถึง',
|
|
19
|
+
overrideAccessDescription: 'เมื่อเลือก คีย์นี้จะข้ามการควบคุมการเข้าถึงของ Payload ในทุกการดำเนินการ เว้นไว้หากไม่มีเหตุผลเฉพาะ',
|
|
20
|
+
permissions: 'สิทธิ์',
|
|
21
|
+
permissionsDescription: 'อนุญาตให้ลูกค้า MCP เข้าถึงคอลเลกชัน เครื่องมือ ทรัพยากร และพรอมป์ต่อไปนี้',
|
|
22
|
+
prompts: 'พรอมป์',
|
|
23
|
+
resources: 'ทรัพยากร',
|
|
24
|
+
server: 'เซิร์ฟเวอร์',
|
|
25
|
+
title: 'ชื่อ',
|
|
26
|
+
titleDescription: 'ชื่อเล่นที่ช่วยจำสำหรับคีย์ API',
|
|
27
|
+
tools: 'เครื่องมือ',
|
|
28
|
+
userDescription: 'ผู้ใช้ที่ MCP จะดำเนินการแทน',
|
|
29
|
+
},
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const th: PluginLanguage = {
|
|
33
|
+
dateFNSKey: 'th',
|
|
34
|
+
translations: thTranslations,
|
|
35
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { PluginLanguage } from '../types.js'
|
|
2
|
+
|
|
3
|
+
export const trTranslations = {
|
|
4
|
+
'plugin-mcp': {
|
|
5
|
+
apiKeyDescription: 'API anahtarları, MCP istemcilerinin hangi koleksiyonlara, kaynaklara, araçlara ve promptlara erişebileceğini kontrol eder.',
|
|
6
|
+
apiKeys: 'API anahtarları',
|
|
7
|
+
authentication: 'Kimlik doğrulama',
|
|
8
|
+
description: 'Açıklama',
|
|
9
|
+
descriptionDescription: 'API anahtarının amacını açıklayın.',
|
|
10
|
+
dismiss: 'Kapat',
|
|
11
|
+
keepKeyPrivate: 'Anahtarınızı gizli tutun.',
|
|
12
|
+
keyPrivateDescription: 'Bu anahtar MCP’ye içeriğinize erişim verir. Başkalarıyla paylaşmayın!',
|
|
13
|
+
lastUsed: 'Son kullanım',
|
|
14
|
+
manageAPIKeys: 'API anahtarlarını yönet',
|
|
15
|
+
mcp: 'MCP',
|
|
16
|
+
noAPIKeys: 'API anahtarı yok',
|
|
17
|
+
operations: 'İşlemler',
|
|
18
|
+
overrideAccess: 'Erişim kontrolünü geçersiz kıl',
|
|
19
|
+
overrideAccessDescription: 'İşaretlendiğinde bu anahtar, gerçekleştirdiği her işlemde Payload erişim kontrolünü atlar. Belirli bir nedeniniz yoksa işaretlemeyin.',
|
|
20
|
+
permissions: 'İzinler',
|
|
21
|
+
permissionsDescription: 'MCP istemcilerinin aşağıdaki koleksiyonlara, araçlara, kaynaklara ve promptlara erişmesine izin verin.',
|
|
22
|
+
prompts: 'Promptlar',
|
|
23
|
+
resources: 'Kaynaklar',
|
|
24
|
+
server: 'Sunucu',
|
|
25
|
+
title: 'Başlık',
|
|
26
|
+
titleDescription: 'API anahtarı için kullanışlı bir takma ad.',
|
|
27
|
+
tools: 'Araçlar',
|
|
28
|
+
userDescription: 'MCP’nin adına işlem yapacağı kullanıcı.',
|
|
29
|
+
},
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const tr: PluginLanguage = {
|
|
33
|
+
dateFNSKey: 'tr',
|
|
34
|
+
translations: trTranslations,
|
|
35
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { PluginLanguage } from '../types.js'
|
|
2
|
+
|
|
3
|
+
export const ukTranslations = {
|
|
4
|
+
'plugin-mcp': {
|
|
5
|
+
apiKeyDescription: 'API-ключі керують тим, до яких колекцій, ресурсів, інструментів і промптів можуть мати доступ MCP-клієнти.',
|
|
6
|
+
apiKeys: 'API-ключі',
|
|
7
|
+
authentication: 'Автентифікація',
|
|
8
|
+
description: 'Опис',
|
|
9
|
+
descriptionDescription: 'Опишіть призначення API-ключа.',
|
|
10
|
+
dismiss: 'Закрити',
|
|
11
|
+
keepKeyPrivate: 'Зберігайте ключ приватним.',
|
|
12
|
+
keyPrivateDescription: 'Цей ключ надає MCP доступ до вашого контенту. Не діліться ним з іншими!',
|
|
13
|
+
lastUsed: 'Останнє використання',
|
|
14
|
+
manageAPIKeys: 'Керувати API-ключами',
|
|
15
|
+
mcp: 'MCP',
|
|
16
|
+
noAPIKeys: 'Немає API-ключів',
|
|
17
|
+
operations: 'Операції',
|
|
18
|
+
overrideAccess: 'Перевизначити контроль доступу',
|
|
19
|
+
overrideAccessDescription: 'Якщо увімкнено, цей ключ обходить контроль доступу Payload під час кожної операції. Залиште вимкненим, якщо немає конкретної причини.',
|
|
20
|
+
permissions: 'Дозволи',
|
|
21
|
+
permissionsDescription: 'Дозвольте MCP-клієнтам доступ до таких колекцій, інструментів, ресурсів і промптів.',
|
|
22
|
+
prompts: 'Промпти',
|
|
23
|
+
resources: 'Ресурси',
|
|
24
|
+
server: 'Сервер',
|
|
25
|
+
title: 'Назва',
|
|
26
|
+
titleDescription: 'Зручна назва для API-ключа.',
|
|
27
|
+
tools: 'Інструменти',
|
|
28
|
+
userDescription: 'Користувач, від імені якого діятиме MCP.',
|
|
29
|
+
},
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const uk: PluginLanguage = {
|
|
33
|
+
dateFNSKey: 'uk',
|
|
34
|
+
translations: ukTranslations,
|
|
35
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { PluginLanguage } from '../types.js'
|
|
2
|
+
|
|
3
|
+
export const viTranslations = {
|
|
4
|
+
'plugin-mcp': {
|
|
5
|
+
apiKeyDescription: 'Khóa API kiểm soát các bộ sưu tập, tài nguyên, công cụ và prompt mà client MCP có thể truy cập.',
|
|
6
|
+
apiKeys: 'Khóa API',
|
|
7
|
+
authentication: 'Xác thực',
|
|
8
|
+
description: 'Mô tả',
|
|
9
|
+
descriptionDescription: 'Mô tả mục đích của khóa API.',
|
|
10
|
+
dismiss: 'Đóng',
|
|
11
|
+
keepKeyPrivate: 'Giữ khóa của bạn riêng tư.',
|
|
12
|
+
keyPrivateDescription: 'Khóa này cấp cho MCP quyền truy cập nội dung của bạn. Đừng chia sẻ với người khác!',
|
|
13
|
+
lastUsed: 'Lần dùng cuối',
|
|
14
|
+
manageAPIKeys: 'Quản lý khóa API',
|
|
15
|
+
mcp: 'MCP',
|
|
16
|
+
noAPIKeys: 'Không có khóa API',
|
|
17
|
+
operations: 'Thao tác',
|
|
18
|
+
overrideAccess: 'Ghi đè kiểm soát truy cập',
|
|
19
|
+
overrideAccessDescription: 'Khi bật, khóa này bỏ qua kiểm soát truy cập của Payload trong mọi thao tác. Hãy để tắt trừ khi bạn có lý do cụ thể.',
|
|
20
|
+
permissions: 'Quyền',
|
|
21
|
+
permissionsDescription: 'Cho phép client MCP truy cập các bộ sưu tập, công cụ, tài nguyên và prompt sau.',
|
|
22
|
+
prompts: 'Prompt',
|
|
23
|
+
resources: 'Tài nguyên',
|
|
24
|
+
server: 'Máy chủ',
|
|
25
|
+
title: 'Tiêu đề',
|
|
26
|
+
titleDescription: 'Tên gợi nhớ hữu ích cho khóa API.',
|
|
27
|
+
tools: 'Công cụ',
|
|
28
|
+
userDescription: 'Người dùng mà MCP sẽ đại diện để hành động.',
|
|
29
|
+
},
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const vi: PluginLanguage = {
|
|
33
|
+
dateFNSKey: 'vi',
|
|
34
|
+
translations: viTranslations,
|
|
35
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { PluginLanguage } from '../types.js'
|
|
2
|
+
|
|
3
|
+
export const zhTranslations = {
|
|
4
|
+
'plugin-mcp': {
|
|
5
|
+
apiKeyDescription: 'API 密钥控制 MCP 客户端可以访问哪些集合、资源、工具和提示词。',
|
|
6
|
+
apiKeys: 'API 密钥',
|
|
7
|
+
authentication: '身份验证',
|
|
8
|
+
description: '描述',
|
|
9
|
+
descriptionDescription: '描述 API 密钥的用途。',
|
|
10
|
+
dismiss: '关闭',
|
|
11
|
+
keepKeyPrivate: '请妥善保管你的密钥。',
|
|
12
|
+
keyPrivateDescription: '此密钥会让 MCP 访问你的内容。不要与他人共享!',
|
|
13
|
+
lastUsed: '上次使用',
|
|
14
|
+
manageAPIKeys: '管理 API 密钥',
|
|
15
|
+
mcp: 'MCP',
|
|
16
|
+
noAPIKeys: '没有 API 密钥',
|
|
17
|
+
operations: '操作',
|
|
18
|
+
overrideAccess: '覆盖访问控制',
|
|
19
|
+
overrideAccessDescription: '启用后,此密钥执行的每个操作都会绕过 Payload 访问控制。除非有明确原因,否则请保持关闭。',
|
|
20
|
+
permissions: '权限',
|
|
21
|
+
permissionsDescription: '允许 MCP 客户端访问以下集合、工具、资源和提示词。',
|
|
22
|
+
prompts: '提示词',
|
|
23
|
+
resources: '资源',
|
|
24
|
+
server: '服务器',
|
|
25
|
+
title: '标题',
|
|
26
|
+
titleDescription: 'API 密钥的易识别名称。',
|
|
27
|
+
tools: '工具',
|
|
28
|
+
userDescription: 'MCP 将代表其操作的用户。',
|
|
29
|
+
},
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const zh: PluginLanguage = {
|
|
33
|
+
dateFNSKey: 'zh-CN',
|
|
34
|
+
translations: zhTranslations,
|
|
35
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { PluginLanguage } from '../types.js'
|
|
2
|
+
|
|
3
|
+
export const zhTwTranslations = {
|
|
4
|
+
'plugin-mcp': {
|
|
5
|
+
apiKeyDescription: 'API 金鑰控制 MCP 用戶端可以存取哪些集合、資源、工具和提示詞。',
|
|
6
|
+
apiKeys: 'API 金鑰',
|
|
7
|
+
authentication: '驗證',
|
|
8
|
+
description: '描述',
|
|
9
|
+
descriptionDescription: '描述 API 金鑰的用途。',
|
|
10
|
+
dismiss: '關閉',
|
|
11
|
+
keepKeyPrivate: '請妥善保管你的金鑰。',
|
|
12
|
+
keyPrivateDescription: '此金鑰會讓 MCP 存取你的內容。不要與他人分享!',
|
|
13
|
+
lastUsed: '上次使用',
|
|
14
|
+
manageAPIKeys: '管理 API 金鑰',
|
|
15
|
+
mcp: 'MCP',
|
|
16
|
+
noAPIKeys: '沒有 API 金鑰',
|
|
17
|
+
operations: '操作',
|
|
18
|
+
overrideAccess: '覆寫存取控制',
|
|
19
|
+
overrideAccessDescription: '啟用後,此金鑰執行的每個操作都會略過 Payload 存取控制。除非有明確原因,否則請保持關閉。',
|
|
20
|
+
permissions: '權限',
|
|
21
|
+
permissionsDescription: '允許 MCP 用戶端存取以下集合、工具、資源和提示詞。',
|
|
22
|
+
prompts: '提示詞',
|
|
23
|
+
resources: '資源',
|
|
24
|
+
server: '伺服器',
|
|
25
|
+
title: '標題',
|
|
26
|
+
titleDescription: 'API 金鑰的易識別名稱。',
|
|
27
|
+
tools: '工具',
|
|
28
|
+
userDescription: 'MCP 將代表其操作的使用者。',
|
|
29
|
+
},
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const zhTw: PluginLanguage = {
|
|
33
|
+
dateFNSKey: 'zh-TW',
|
|
34
|
+
translations: zhTwTranslations,
|
|
35
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Language } from '@payloadcms/translations'
|
|
2
|
+
|
|
3
|
+
import type { enTranslations } from './languages/en.js'
|
|
4
|
+
|
|
5
|
+
export type PluginLanguage = Language<{
|
|
6
|
+
'plugin-mcp': {
|
|
7
|
+
apiKeyDescription: string
|
|
8
|
+
apiKeys: string
|
|
9
|
+
authentication: string
|
|
10
|
+
description: string
|
|
11
|
+
descriptionDescription: string
|
|
12
|
+
dismiss: string
|
|
13
|
+
keepKeyPrivate: string
|
|
14
|
+
keyPrivateDescription: string
|
|
15
|
+
lastUsed: string
|
|
16
|
+
manageAPIKeys: string
|
|
17
|
+
mcp: string
|
|
18
|
+
noAPIKeys: string
|
|
19
|
+
operations: string
|
|
20
|
+
overrideAccess: string
|
|
21
|
+
overrideAccessDescription: string
|
|
22
|
+
permissions: string
|
|
23
|
+
permissionsDescription: string
|
|
24
|
+
prompts: string
|
|
25
|
+
resources: string
|
|
26
|
+
server: string
|
|
27
|
+
title: string
|
|
28
|
+
titleDescription: string
|
|
29
|
+
tools: string
|
|
30
|
+
userDescription: string
|
|
31
|
+
}
|
|
32
|
+
}>
|
|
33
|
+
|
|
34
|
+
export type PluginDefaultTranslationsObject = typeof enTranslations
|
package/src/types.ts
CHANGED
|
@@ -46,9 +46,11 @@ export type ToolInputSchema = JsonSchemaType | StandardSchemaWithJSON
|
|
|
46
46
|
export type ClientMCPPluginConfig = {
|
|
47
47
|
items: Array<{
|
|
48
48
|
collectionSlug?: string
|
|
49
|
-
|
|
49
|
+
configKey: string
|
|
50
|
+
description?: string
|
|
50
51
|
globalSlug?: string
|
|
51
|
-
|
|
52
|
+
/** Admin-UI bucket for collection/global tools: built-in CRUD, auth, or custom. */
|
|
53
|
+
group?: 'auth' | 'custom' | 'operations'
|
|
52
54
|
label: string
|
|
53
55
|
type: 'collectionTool' | 'globalTool' | 'prompt' | 'resource' | 'tool'
|
|
54
56
|
}>
|
|
@@ -105,22 +107,17 @@ export type Tool<TSchema extends ToolInputSchema | undefined = ToolInputSchema |
|
|
|
105
107
|
overrideResponse?: MCPResponseOverride
|
|
106
108
|
}
|
|
107
109
|
|
|
108
|
-
/**
|
|
109
|
-
* `TSchema` is the schema itself (Standard Schema, raw JSON Schema, or undefined).
|
|
110
|
-
* The function-form variant of `input` carries a concrete `{ collectionSchema: JsonSchemaType }`
|
|
111
|
-
* parameter type so callers can write `({ collectionSchema }) => …` without annotating it.
|
|
112
|
-
*/
|
|
113
110
|
export type CollectionTool<
|
|
114
111
|
TSchema extends ToolInputSchema | undefined = ToolInputSchema | undefined,
|
|
115
112
|
> = {
|
|
116
113
|
handler: (args: CollectionToolHandlerArgs<TSchema>) => MaybePromise<MCPToolResponse>
|
|
117
|
-
input?:
|
|
114
|
+
input?: TSchema
|
|
118
115
|
} & Pick<Tool, 'description' | 'overrideResponse'>
|
|
119
116
|
|
|
120
117
|
export type GlobalTool<TSchema extends ToolInputSchema | undefined = ToolInputSchema | undefined> =
|
|
121
118
|
{
|
|
122
119
|
handler: (args: GlobalToolHandlerArgs<TSchema>) => MaybePromise<MCPToolResponse>
|
|
123
|
-
input?:
|
|
120
|
+
input?: TSchema
|
|
124
121
|
} & Pick<Tool, 'description' | 'overrideResponse'>
|
|
125
122
|
|
|
126
123
|
/**
|
|
@@ -287,40 +284,41 @@ export type MCPAPIKeysDocAccessTree = {
|
|
|
287
284
|
*/
|
|
288
285
|
export type MCPAPIKeysDoc = {
|
|
289
286
|
access: MCPAPIKeysDocAccessTree
|
|
287
|
+
apiKey?: string
|
|
288
|
+
apiKeyIndex?: string
|
|
290
289
|
id: DefaultDocumentIDType
|
|
290
|
+
lastUsed?: string
|
|
291
291
|
overrideAccess?: boolean
|
|
292
292
|
user: null | TypedUser
|
|
293
293
|
}
|
|
294
294
|
|
|
295
295
|
/**
|
|
296
|
-
* One MCP primitive
|
|
297
|
-
*
|
|
298
|
-
* filtered by `getAuthorizedMCP`, registered by the MCP endpoint.
|
|
296
|
+
* One MCP primitive plus the metadata needed for access checks, admin UI, and
|
|
297
|
+
* registration.
|
|
299
298
|
*
|
|
300
|
-
*
|
|
301
|
-
*
|
|
302
|
-
*
|
|
303
|
-
* registration time.
|
|
304
|
-
* - `label`: human-readable admin-UI display text for the checkbox.
|
|
305
|
-
* - `tool` / `prompt` / `resource`: the live primitive (its own
|
|
306
|
-
* `description` is what both MCP clients and the admin UI surface).
|
|
299
|
+
* - `configKey`: the config/API-key identifier, e.g. `find` or `echo`.
|
|
300
|
+
* - `mcpName`: the MCP wire name, e.g. `findDocuments` or `echo`.
|
|
301
|
+
* - `label`: human-readable admin checkbox text.
|
|
307
302
|
*/
|
|
308
303
|
export type MCPItemBase = {
|
|
309
|
-
|
|
304
|
+
configKey: string
|
|
310
305
|
label: string
|
|
306
|
+
mcpName: string
|
|
311
307
|
}
|
|
312
308
|
|
|
309
|
+
export type CollectionMCPItem = {
|
|
310
|
+
collectionSlug: CollectionSlug
|
|
311
|
+
tool: CollectionTool
|
|
312
|
+
type: 'collectionTool'
|
|
313
|
+
} & MCPItemBase
|
|
314
|
+
|
|
315
|
+
export type GlobalMCPItem = {
|
|
316
|
+
globalSlug: GlobalSlug
|
|
317
|
+
tool: GlobalTool
|
|
318
|
+
type: 'globalTool'
|
|
319
|
+
} & MCPItemBase
|
|
320
|
+
|
|
313
321
|
export type MCPItem =
|
|
314
|
-
| ({
|
|
315
|
-
collectionSlug: CollectionSlug
|
|
316
|
-
tool: CollectionTool
|
|
317
|
-
type: 'collectionTool'
|
|
318
|
-
} & MCPItemBase)
|
|
319
|
-
| ({
|
|
320
|
-
globalSlug: GlobalSlug
|
|
321
|
-
tool: GlobalTool
|
|
322
|
-
type: 'globalTool'
|
|
323
|
-
} & MCPItemBase)
|
|
324
322
|
| ({
|
|
325
323
|
prompt: Prompt
|
|
326
324
|
type: 'prompt'
|
|
@@ -333,6 +331,8 @@ export type MCPItem =
|
|
|
333
331
|
tool: Tool
|
|
334
332
|
type: 'tool'
|
|
335
333
|
} & MCPItemBase)
|
|
334
|
+
| CollectionMCPItem
|
|
335
|
+
| GlobalMCPItem
|
|
336
336
|
|
|
337
337
|
/**
|
|
338
338
|
* The caller's identity + the MCP items they can use for this request. Returned
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type CollectionSlug,
|
|
3
|
+
entityToStandaloneJSONSchema,
|
|
4
|
+
type GlobalSlug,
|
|
5
|
+
type PayloadRequest,
|
|
6
|
+
type SanitizedCollectionConfig,
|
|
7
|
+
type SanitizedGlobalConfig,
|
|
8
|
+
} from 'payload'
|
|
9
|
+
|
|
10
|
+
import type { JsonSchemaType } from '../../types.js'
|
|
11
|
+
|
|
12
|
+
import {
|
|
13
|
+
getCollectionVirtualFieldNames,
|
|
14
|
+
getGlobalVirtualFieldNames,
|
|
15
|
+
} from '../getVirtualFieldNames.js'
|
|
16
|
+
import { removeVirtualFieldsFromSchema } from './removeVirtualFieldsFromSchema.js'
|
|
17
|
+
import { sanitizeEntitySchema } from './sanitizeEntitySchema.js'
|
|
18
|
+
|
|
19
|
+
export const getCollectionInputSchema = ({
|
|
20
|
+
collectionSlug,
|
|
21
|
+
req,
|
|
22
|
+
}: {
|
|
23
|
+
collectionSlug: CollectionSlug
|
|
24
|
+
req: PayloadRequest
|
|
25
|
+
}): JsonSchemaType | null => {
|
|
26
|
+
const collection = req.payload.collections[collectionSlug]?.config
|
|
27
|
+
|
|
28
|
+
if (!collection) {
|
|
29
|
+
return null
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return buildEntityInputSchema({
|
|
33
|
+
entity: collection,
|
|
34
|
+
req,
|
|
35
|
+
virtualFieldNames: getCollectionVirtualFieldNames(req.payload.config, collectionSlug),
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const getGlobalInputSchema = ({
|
|
40
|
+
globalSlug,
|
|
41
|
+
req,
|
|
42
|
+
}: {
|
|
43
|
+
globalSlug: GlobalSlug
|
|
44
|
+
req: PayloadRequest
|
|
45
|
+
}): JsonSchemaType | null => {
|
|
46
|
+
const global = req.payload.config.globals.find((globalConfig) => globalConfig.slug === globalSlug)
|
|
47
|
+
|
|
48
|
+
if (!global) {
|
|
49
|
+
return null
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return buildEntityInputSchema({
|
|
53
|
+
entity: global,
|
|
54
|
+
req,
|
|
55
|
+
virtualFieldNames: getGlobalVirtualFieldNames(req.payload.config, globalSlug),
|
|
56
|
+
})
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const buildEntityInputSchema = ({
|
|
60
|
+
entity,
|
|
61
|
+
req,
|
|
62
|
+
virtualFieldNames,
|
|
63
|
+
}: {
|
|
64
|
+
entity: SanitizedCollectionConfig | SanitizedGlobalConfig
|
|
65
|
+
req: PayloadRequest
|
|
66
|
+
virtualFieldNames: string[]
|
|
67
|
+
}): JsonSchemaType =>
|
|
68
|
+
sanitizeEntitySchema(
|
|
69
|
+
removeVirtualFieldsFromSchema(
|
|
70
|
+
entityToStandaloneJSONSchema({
|
|
71
|
+
config: req.payload.config,
|
|
72
|
+
defaultIDType: req.payload.db.defaultIDType,
|
|
73
|
+
entity,
|
|
74
|
+
i18n: req.i18n,
|
|
75
|
+
}) as unknown as JsonSchemaType,
|
|
76
|
+
virtualFieldNames,
|
|
77
|
+
),
|
|
78
|
+
)
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest'
|
|
2
|
+
|
|
3
|
+
import type { JsonSchemaType } from '../../types.js'
|
|
4
|
+
|
|
5
|
+
import { sanitizeEntitySchema } from './sanitizeEntitySchema.js'
|
|
6
|
+
|
|
7
|
+
describe('sanitizeEntitySchema', () => {
|
|
8
|
+
it('keeps a Lexical node union strict (oneOf) while simplifying relationship values to IDs', () => {
|
|
9
|
+
// Shaped like the schema the MCP server prepares for a collection with a Lexical richText field:
|
|
10
|
+
// a `$defs` node union (a `oneOf` of node shapes) where a relationship node's `value` is either
|
|
11
|
+
// an ID or a `$ref` to the populated related collection.
|
|
12
|
+
const standalone: JsonSchemaType = {
|
|
13
|
+
type: 'object',
|
|
14
|
+
$defs: {
|
|
15
|
+
LexicalNodes_ABCDEF12: {
|
|
16
|
+
oneOf: [
|
|
17
|
+
{
|
|
18
|
+
type: 'object',
|
|
19
|
+
additionalProperties: false,
|
|
20
|
+
properties: { type: { const: 'paragraph' } },
|
|
21
|
+
required: ['type'],
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
type: 'object',
|
|
25
|
+
additionalProperties: false,
|
|
26
|
+
properties: {
|
|
27
|
+
type: { const: 'relationship' },
|
|
28
|
+
value: { oneOf: [{ type: 'string' }, { $ref: '#/$defs/posts' }] },
|
|
29
|
+
},
|
|
30
|
+
required: ['type'],
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
posts: {
|
|
35
|
+
type: 'object',
|
|
36
|
+
additionalProperties: false,
|
|
37
|
+
properties: { id: { type: 'string' }, title: { type: 'string' } },
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
properties: {
|
|
41
|
+
id: { type: 'string' },
|
|
42
|
+
content: {
|
|
43
|
+
type: 'object',
|
|
44
|
+
properties: {
|
|
45
|
+
root: {
|
|
46
|
+
type: 'object',
|
|
47
|
+
properties: {
|
|
48
|
+
children: { type: 'array', items: { $ref: '#/$defs/LexicalNodes_ABCDEF12' } },
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
expect(sanitizeEntitySchema(standalone)).toStrictEqual({
|
|
57
|
+
type: 'object',
|
|
58
|
+
$defs: {
|
|
59
|
+
// The node union is renamed to a short, readable `node`, and stays a strict discriminated
|
|
60
|
+
// `oneOf` - not loosened to `anyOf`...
|
|
61
|
+
node: {
|
|
62
|
+
oneOf: [
|
|
63
|
+
{
|
|
64
|
+
type: 'object',
|
|
65
|
+
additionalProperties: false,
|
|
66
|
+
properties: { type: { const: 'paragraph' } },
|
|
67
|
+
required: ['type'],
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
type: 'object',
|
|
71
|
+
additionalProperties: false,
|
|
72
|
+
properties: {
|
|
73
|
+
type: { const: 'relationship' },
|
|
74
|
+
// ...while the relationship `value` is simplified to a bare ID (the populated-doc `$ref` is dropped).
|
|
75
|
+
value: { type: 'string', description: 'The ID of the related "posts" document.' },
|
|
76
|
+
},
|
|
77
|
+
required: ['type'],
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
},
|
|
81
|
+
posts: {
|
|
82
|
+
type: 'object',
|
|
83
|
+
additionalProperties: false,
|
|
84
|
+
properties: { id: { type: 'string' }, title: { type: 'string' } },
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
properties: {
|
|
88
|
+
// `id` is dropped - it's a Payload-managed field MCP clients never set.
|
|
89
|
+
content: {
|
|
90
|
+
type: 'object',
|
|
91
|
+
properties: {
|
|
92
|
+
root: {
|
|
93
|
+
type: 'object',
|
|
94
|
+
properties: {
|
|
95
|
+
children: { type: 'array', items: { $ref: '#/$defs/node' } },
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
})
|
|
102
|
+
})
|
|
103
|
+
})
|