@payloadcms/plugin-mcp 4.0.0-internal.5b1e7cd → 4.0.0-internal.5d2e3d1

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 (446) hide show
  1. package/LICENSE.md +1 -1
  2. package/bin.js +39 -0
  3. package/dist/defaultAccess.d.ts +3 -0
  4. package/dist/defaultAccess.d.ts.map +1 -0
  5. package/dist/defaultAccess.js +3 -0
  6. package/dist/defaultAccess.js.map +1 -0
  7. package/dist/defineTool.d.ts +26 -0
  8. package/dist/defineTool.d.ts.map +1 -0
  9. package/dist/defineTool.js +37 -0
  10. package/dist/defineTool.js.map +1 -0
  11. package/dist/endpoint/access.d.ts +22 -0
  12. package/dist/endpoint/access.d.ts.map +1 -0
  13. package/dist/endpoint/access.js +130 -0
  14. package/dist/endpoint/access.js.map +1 -0
  15. package/dist/endpoint/index.d.ts +3 -0
  16. package/dist/endpoint/index.d.ts.map +1 -0
  17. package/dist/endpoint/index.js +141 -0
  18. package/dist/endpoint/index.js.map +1 -0
  19. package/dist/endpoint/oauth.d.ts +37 -0
  20. package/dist/endpoint/oauth.d.ts.map +1 -0
  21. package/dist/endpoint/oauth.js +105 -0
  22. package/dist/endpoint/oauth.js.map +1 -0
  23. package/dist/endpoint/oauthLoginToken.d.ts +23 -0
  24. package/dist/endpoint/oauthLoginToken.d.ts.map +1 -0
  25. package/dist/endpoint/oauthLoginToken.js +80 -0
  26. package/dist/endpoint/oauthLoginToken.js.map +1 -0
  27. package/dist/endpoint/oauthServer.d.ts +28 -0
  28. package/dist/endpoint/oauthServer.d.ts.map +1 -0
  29. package/dist/endpoint/oauthServer.js +423 -0
  30. package/dist/endpoint/oauthServer.js.map +1 -0
  31. package/dist/exports/client.d.ts +2 -0
  32. package/dist/exports/client.d.ts.map +1 -0
  33. package/dist/exports/client.js +4 -0
  34. package/dist/exports/client.js.map +1 -0
  35. package/dist/exports/internal.d.ts +2 -0
  36. package/dist/exports/internal.d.ts.map +1 -0
  37. package/dist/exports/internal.js +3 -0
  38. package/dist/exports/internal.js.map +1 -0
  39. package/dist/exports/rsc.d.ts +2 -0
  40. package/dist/exports/rsc.d.ts.map +1 -0
  41. package/dist/exports/rsc.js +3 -0
  42. package/dist/exports/rsc.js.map +1 -0
  43. package/dist/index.d.ts +14 -9
  44. package/dist/index.d.ts.map +1 -1
  45. package/dist/index.js +63 -67
  46. package/dist/index.js.map +1 -1
  47. package/dist/mcp/buildMcpServer.d.ts +19 -0
  48. package/dist/mcp/buildMcpServer.d.ts.map +1 -0
  49. package/dist/mcp/buildMcpServer.js +235 -0
  50. package/dist/mcp/buildMcpServer.js.map +1 -0
  51. package/dist/mcp/builtin/collections/authTools.d.ts +7 -0
  52. package/dist/mcp/builtin/collections/authTools.d.ts.map +1 -0
  53. package/dist/mcp/builtin/collections/authTools.js +312 -0
  54. package/dist/mcp/builtin/collections/authTools.js.map +1 -0
  55. package/dist/mcp/builtin/collections/countTool.d.ts +2 -0
  56. package/dist/mcp/builtin/collections/countTool.d.ts.map +1 -0
  57. package/dist/mcp/builtin/collections/countTool.js +63 -0
  58. package/dist/mcp/builtin/collections/countTool.js.map +1 -0
  59. package/dist/mcp/builtin/collections/countVersionsTool.d.ts +2 -0
  60. package/dist/mcp/builtin/collections/countVersionsTool.d.ts.map +1 -0
  61. package/dist/mcp/builtin/collections/countVersionsTool.js +60 -0
  62. package/dist/mcp/builtin/collections/countVersionsTool.js.map +1 -0
  63. package/dist/mcp/builtin/collections/createTool.d.ts +2 -0
  64. package/dist/mcp/builtin/collections/createTool.d.ts.map +1 -0
  65. package/dist/mcp/builtin/collections/createTool.js +137 -0
  66. package/dist/mcp/builtin/collections/createTool.js.map +1 -0
  67. package/dist/mcp/builtin/collections/deleteTool.d.ts +2 -0
  68. package/dist/mcp/builtin/collections/deleteTool.d.ts.map +1 -0
  69. package/dist/mcp/builtin/collections/deleteTool.js +113 -0
  70. package/dist/mcp/builtin/collections/deleteTool.js.map +1 -0
  71. package/dist/mcp/builtin/collections/duplicateTool.d.ts +2 -0
  72. package/dist/mcp/builtin/collections/duplicateTool.d.ts.map +1 -0
  73. package/dist/mcp/builtin/collections/duplicateTool.js +90 -0
  74. package/dist/mcp/builtin/collections/duplicateTool.js.map +1 -0
  75. package/dist/mcp/builtin/collections/fileInput.d.ts +28 -0
  76. package/dist/mcp/builtin/collections/fileInput.d.ts.map +1 -0
  77. package/dist/mcp/builtin/collections/fileInput.js +88 -0
  78. package/dist/mcp/builtin/collections/fileInput.js.map +1 -0
  79. package/dist/mcp/builtin/collections/findDistinctTool.d.ts +2 -0
  80. package/dist/mcp/builtin/collections/findDistinctTool.d.ts.map +1 -0
  81. package/dist/mcp/builtin/collections/findDistinctTool.js +77 -0
  82. package/dist/mcp/builtin/collections/findDistinctTool.js.map +1 -0
  83. package/dist/mcp/builtin/collections/findTool.d.ts +2 -0
  84. package/dist/mcp/builtin/collections/findTool.d.ts.map +1 -0
  85. package/dist/mcp/builtin/collections/findTool.js +146 -0
  86. package/dist/mcp/builtin/collections/findTool.js.map +1 -0
  87. package/dist/mcp/builtin/collections/findVersionByIDTool.d.ts +2 -0
  88. package/dist/mcp/builtin/collections/findVersionByIDTool.d.ts.map +1 -0
  89. package/dist/mcp/builtin/collections/findVersionByIDTool.js +74 -0
  90. package/dist/mcp/builtin/collections/findVersionByIDTool.js.map +1 -0
  91. package/dist/mcp/builtin/collections/findVersionsTool.d.ts +2 -0
  92. package/dist/mcp/builtin/collections/findVersionsTool.d.ts.map +1 -0
  93. package/dist/mcp/builtin/collections/findVersionsTool.js +84 -0
  94. package/dist/mcp/builtin/collections/findVersionsTool.js.map +1 -0
  95. package/dist/mcp/builtin/collections/getCollectionSchemaTool.d.ts +2 -0
  96. package/dist/mcp/builtin/collections/getCollectionSchemaTool.d.ts.map +1 -0
  97. package/dist/mcp/builtin/collections/getCollectionSchemaTool.js +103 -0
  98. package/dist/mcp/builtin/collections/getCollectionSchemaTool.js.map +1 -0
  99. package/dist/mcp/builtin/collections/restoreVersionTool.d.ts +2 -0
  100. package/dist/mcp/builtin/collections/restoreVersionTool.d.ts.map +1 -0
  101. package/dist/mcp/builtin/collections/restoreVersionTool.js +69 -0
  102. package/dist/mcp/builtin/collections/restoreVersionTool.js.map +1 -0
  103. package/dist/mcp/builtin/collections/updateTool.d.ts +2 -0
  104. package/dist/mcp/builtin/collections/updateTool.d.ts.map +1 -0
  105. package/dist/mcp/builtin/collections/updateTool.js +172 -0
  106. package/dist/mcp/builtin/collections/updateTool.js.map +1 -0
  107. package/dist/mcp/builtin/collections/uploadInstructionsTool.d.ts +2 -0
  108. package/dist/mcp/builtin/collections/uploadInstructionsTool.d.ts.map +1 -0
  109. package/dist/mcp/builtin/collections/uploadInstructionsTool.js +55 -0
  110. package/dist/mcp/builtin/collections/uploadInstructionsTool.js.map +1 -0
  111. package/dist/mcp/builtin/formatEntityError.d.ts +16 -0
  112. package/dist/mcp/builtin/formatEntityError.d.ts.map +1 -0
  113. package/dist/mcp/builtin/formatEntityError.js +55 -0
  114. package/dist/mcp/builtin/formatEntityError.js.map +1 -0
  115. package/dist/mcp/builtin/getConfigInfoTool.d.ts +2 -0
  116. package/dist/mcp/builtin/getConfigInfoTool.d.ts.map +1 -0
  117. package/dist/mcp/builtin/getConfigInfoTool.js +69 -0
  118. package/dist/mcp/builtin/getConfigInfoTool.js.map +1 -0
  119. package/dist/mcp/builtin/globals/countVersionsTool.d.ts +2 -0
  120. package/dist/mcp/builtin/globals/countVersionsTool.d.ts.map +1 -0
  121. package/dist/mcp/builtin/globals/countVersionsTool.js +60 -0
  122. package/dist/mcp/builtin/globals/countVersionsTool.js.map +1 -0
  123. package/dist/mcp/builtin/globals/findTool.d.ts +2 -0
  124. package/dist/mcp/builtin/globals/findTool.d.ts.map +1 -0
  125. package/dist/mcp/builtin/globals/findTool.js +67 -0
  126. package/dist/mcp/builtin/globals/findTool.js.map +1 -0
  127. package/dist/mcp/builtin/globals/findVersionByIDTool.d.ts +2 -0
  128. package/dist/mcp/builtin/globals/findVersionByIDTool.d.ts.map +1 -0
  129. package/dist/mcp/builtin/globals/findVersionByIDTool.js +68 -0
  130. package/dist/mcp/builtin/globals/findVersionByIDTool.js.map +1 -0
  131. package/dist/mcp/builtin/globals/findVersionsTool.d.ts +2 -0
  132. package/dist/mcp/builtin/globals/findVersionsTool.d.ts.map +1 -0
  133. package/dist/mcp/builtin/globals/findVersionsTool.js +78 -0
  134. package/dist/mcp/builtin/globals/findVersionsTool.js.map +1 -0
  135. package/dist/mcp/builtin/globals/getGlobalSchemaTool.d.ts +2 -0
  136. package/dist/mcp/builtin/globals/getGlobalSchemaTool.d.ts.map +1 -0
  137. package/dist/mcp/builtin/globals/getGlobalSchemaTool.js +81 -0
  138. package/dist/mcp/builtin/globals/getGlobalSchemaTool.js.map +1 -0
  139. package/dist/mcp/builtin/globals/restoreVersionTool.d.ts +2 -0
  140. package/dist/mcp/builtin/globals/restoreVersionTool.d.ts.map +1 -0
  141. package/dist/mcp/builtin/globals/restoreVersionTool.js +70 -0
  142. package/dist/mcp/builtin/globals/restoreVersionTool.js.map +1 -0
  143. package/dist/mcp/builtin/globals/updateTool.d.ts +2 -0
  144. package/dist/mcp/builtin/globals/updateTool.d.ts.map +1 -0
  145. package/dist/mcp/builtin/globals/updateTool.js +78 -0
  146. package/dist/mcp/builtin/globals/updateTool.js.map +1 -0
  147. package/dist/mcp/builtinTools.d.ts +168 -0
  148. package/dist/mcp/builtinTools.d.ts.map +1 -0
  149. package/dist/mcp/builtinTools.js +169 -0
  150. package/dist/mcp/builtinTools.js.map +1 -0
  151. package/dist/mcp/sanitizeMCPConfig.d.ts +16 -0
  152. package/dist/mcp/sanitizeMCPConfig.d.ts.map +1 -0
  153. package/dist/mcp/sanitizeMCPConfig.js +236 -0
  154. package/dist/mcp/sanitizeMCPConfig.js.map +1 -0
  155. package/dist/stdio.d.ts +8 -0
  156. package/dist/stdio.d.ts.map +1 -0
  157. package/dist/stdio.js +128 -0
  158. package/dist/stdio.js.map +1 -0
  159. package/dist/types.d.ts +352 -441
  160. package/dist/types.d.ts.map +1 -1
  161. package/dist/types.js +4 -1
  162. package/dist/types.js.map +1 -1
  163. package/dist/utils/getLogger.d.ts +10 -0
  164. package/dist/utils/getLogger.d.ts.map +1 -0
  165. package/dist/utils/getLogger.js +22 -0
  166. package/dist/utils/getLogger.js.map +1 -0
  167. package/dist/utils/getPluginConfig.d.ts +12 -0
  168. package/dist/utils/getPluginConfig.d.ts.map +1 -0
  169. package/dist/utils/getPluginConfig.js +15 -0
  170. package/dist/utils/getPluginConfig.js.map +1 -0
  171. package/dist/utils/resolveProjectRoot.d.ts +7 -0
  172. package/dist/utils/resolveProjectRoot.d.ts.map +1 -0
  173. package/dist/utils/resolveProjectRoot.js +15 -0
  174. package/dist/utils/resolveProjectRoot.js.map +1 -0
  175. package/dist/utils/seal.d.ts +17 -0
  176. package/dist/utils/seal.d.ts.map +1 -0
  177. package/dist/utils/seal.js +24 -0
  178. package/dist/utils/seal.js.map +1 -0
  179. package/dist/utils/toStandardSchema.d.ts +5 -0
  180. package/dist/utils/toStandardSchema.d.ts.map +1 -0
  181. package/dist/utils/toStandardSchema.js +4 -0
  182. package/dist/utils/toStandardSchema.js.map +1 -0
  183. package/dist/views/Authorize/AllowButtons/index.d.ts +18 -0
  184. package/dist/views/Authorize/AllowButtons/index.d.ts.map +1 -0
  185. package/dist/views/Authorize/AllowButtons/index.js +88 -0
  186. package/dist/views/Authorize/AllowButtons/index.js.map +1 -0
  187. package/dist/views/Authorize/index.css +19 -0
  188. package/dist/views/Authorize/index.d.ts +9 -0
  189. package/dist/views/Authorize/index.d.ts.map +1 -0
  190. package/dist/views/Authorize/index.js +86 -0
  191. package/dist/views/Authorize/index.js.map +1 -0
  192. package/package.json +48 -26
  193. package/src/defaultAccess.ts +3 -0
  194. package/src/defineTool.ts +44 -0
  195. package/src/endpoint/access.ts +153 -0
  196. package/src/endpoint/index.ts +123 -0
  197. package/src/endpoint/oauth.ts +108 -0
  198. package/src/endpoint/oauthLoginToken.ts +94 -0
  199. package/src/endpoint/oauthServer.ts +452 -0
  200. package/src/exports/client.ts +3 -0
  201. package/src/exports/internal.ts +1 -0
  202. package/src/exports/rsc.ts +1 -0
  203. package/src/index.ts +74 -88
  204. package/src/mcp/buildMcpServer.ts +294 -0
  205. package/src/mcp/builtin/collections/authTools.ts +280 -0
  206. package/src/mcp/builtin/collections/countTool.ts +61 -0
  207. package/src/mcp/builtin/collections/countVersionsTool.ts +60 -0
  208. package/src/mcp/builtin/collections/createTool.ts +143 -0
  209. package/src/mcp/builtin/collections/deleteTool.ts +99 -0
  210. package/src/mcp/builtin/collections/duplicateTool.ts +84 -0
  211. package/src/mcp/builtin/collections/fileInput.spec.ts +93 -0
  212. package/src/mcp/builtin/collections/fileInput.ts +127 -0
  213. package/src/mcp/builtin/collections/findDistinctTool.ts +67 -0
  214. package/src/mcp/builtin/collections/findTool.ts +134 -0
  215. package/src/mcp/builtin/collections/findVersionByIDTool.ts +66 -0
  216. package/src/mcp/builtin/collections/findVersionsTool.ts +83 -0
  217. package/src/mcp/builtin/collections/getCollectionSchemaTool.ts +91 -0
  218. package/src/mcp/builtin/collections/restoreVersionTool.ts +65 -0
  219. package/src/mcp/builtin/collections/updateTool.ts +173 -0
  220. package/src/mcp/builtin/collections/uploadInstructionsTool.ts +64 -0
  221. package/src/mcp/builtin/formatEntityError.ts +77 -0
  222. package/src/mcp/builtin/getConfigInfoTool.ts +68 -0
  223. package/src/mcp/builtin/globals/countVersionsTool.ts +60 -0
  224. package/src/mcp/builtin/globals/findTool.ts +66 -0
  225. package/src/mcp/builtin/globals/findVersionByIDTool.ts +64 -0
  226. package/src/mcp/builtin/globals/findVersionsTool.ts +69 -0
  227. package/src/mcp/builtin/globals/getGlobalSchemaTool.ts +73 -0
  228. package/src/mcp/builtin/globals/restoreVersionTool.ts +68 -0
  229. package/src/mcp/builtin/globals/updateTool.ts +92 -0
  230. package/src/mcp/builtinTools.ts +161 -0
  231. package/src/mcp/sanitizeMCPConfig.ts +282 -0
  232. package/src/stdio.ts +131 -0
  233. package/src/types.ts +401 -481
  234. package/src/utils/getLogger.ts +22 -0
  235. package/src/utils/getPluginConfig.ts +24 -0
  236. package/src/utils/resolveProjectRoot.ts +17 -0
  237. package/src/utils/seal.ts +46 -0
  238. package/src/utils/toStandardSchema.ts +9 -0
  239. package/src/views/Authorize/AllowButtons/index.tsx +97 -0
  240. package/src/views/Authorize/index.css +19 -0
  241. package/src/views/Authorize/index.tsx +93 -0
  242. package/dist/collections/createApiKeysCollection.d.ts +0 -7
  243. package/dist/collections/createApiKeysCollection.d.ts.map +0 -1
  244. package/dist/collections/createApiKeysCollection.js +0 -317
  245. package/dist/collections/createApiKeysCollection.js.map +0 -1
  246. package/dist/defaults.d.ts +0 -4
  247. package/dist/defaults.d.ts.map +0 -1
  248. package/dist/defaults.js +0 -5
  249. package/dist/defaults.js.map +0 -1
  250. package/dist/endpoints/mcp.d.ts +0 -4
  251. package/dist/endpoints/mcp.d.ts.map +0 -1
  252. package/dist/endpoints/mcp.js +0 -71
  253. package/dist/endpoints/mcp.js.map +0 -1
  254. package/dist/mcp/createRequest.d.ts +0 -3
  255. package/dist/mcp/createRequest.d.ts.map +0 -1
  256. package/dist/mcp/createRequest.js +0 -14
  257. package/dist/mcp/createRequest.js.map +0 -1
  258. package/dist/mcp/getMcpHandler.d.ts +0 -4
  259. package/dist/mcp/getMcpHandler.d.ts.map +0 -1
  260. package/dist/mcp/getMcpHandler.js +0 -231
  261. package/dist/mcp/getMcpHandler.js.map +0 -1
  262. package/dist/mcp/helpers/config.d.ts +0 -22
  263. package/dist/mcp/helpers/config.d.ts.map +0 -1
  264. package/dist/mcp/helpers/config.js +0 -153
  265. package/dist/mcp/helpers/config.js.map +0 -1
  266. package/dist/mcp/helpers/fields.d.ts +0 -19
  267. package/dist/mcp/helpers/fields.d.ts.map +0 -1
  268. package/dist/mcp/helpers/fields.js +0 -102
  269. package/dist/mcp/helpers/fields.js.map +0 -1
  270. package/dist/mcp/helpers/fileValidation.d.ts +0 -67
  271. package/dist/mcp/helpers/fileValidation.d.ts.map +0 -1
  272. package/dist/mcp/helpers/fileValidation.js +0 -267
  273. package/dist/mcp/helpers/fileValidation.js.map +0 -1
  274. package/dist/mcp/registerTool.d.ts +0 -6
  275. package/dist/mcp/registerTool.d.ts.map +0 -1
  276. package/dist/mcp/registerTool.js +0 -18
  277. package/dist/mcp/registerTool.js.map +0 -1
  278. package/dist/mcp/tools/auth/auth.d.ts +0 -4
  279. package/dist/mcp/tools/auth/auth.d.ts.map +0 -1
  280. package/dist/mcp/tools/auth/auth.js +0 -57
  281. package/dist/mcp/tools/auth/auth.js.map +0 -1
  282. package/dist/mcp/tools/auth/forgotPassword.d.ts +0 -4
  283. package/dist/mcp/tools/auth/forgotPassword.d.ts.map +0 -1
  284. package/dist/mcp/tools/auth/forgotPassword.js +0 -48
  285. package/dist/mcp/tools/auth/forgotPassword.js.map +0 -1
  286. package/dist/mcp/tools/auth/login.d.ts +0 -4
  287. package/dist/mcp/tools/auth/login.d.ts.map +0 -1
  288. package/dist/mcp/tools/auth/login.js +0 -51
  289. package/dist/mcp/tools/auth/login.js.map +0 -1
  290. package/dist/mcp/tools/auth/resetPassword.d.ts +0 -4
  291. package/dist/mcp/tools/auth/resetPassword.d.ts.map +0 -1
  292. package/dist/mcp/tools/auth/resetPassword.js +0 -49
  293. package/dist/mcp/tools/auth/resetPassword.js.map +0 -1
  294. package/dist/mcp/tools/auth/unlock.d.ts +0 -4
  295. package/dist/mcp/tools/auth/unlock.d.ts.map +0 -1
  296. package/dist/mcp/tools/auth/unlock.js +0 -48
  297. package/dist/mcp/tools/auth/unlock.js.map +0 -1
  298. package/dist/mcp/tools/auth/verify.d.ts +0 -4
  299. package/dist/mcp/tools/auth/verify.d.ts.map +0 -1
  300. package/dist/mcp/tools/auth/verify.js +0 -45
  301. package/dist/mcp/tools/auth/verify.js.map +0 -1
  302. package/dist/mcp/tools/collection/create.d.ts +0 -10
  303. package/dist/mcp/tools/collection/create.d.ts.map +0 -1
  304. package/dist/mcp/tools/collection/create.js +0 -139
  305. package/dist/mcp/tools/collection/create.js.map +0 -1
  306. package/dist/mcp/tools/collection/delete.d.ts +0 -10
  307. package/dist/mcp/tools/collection/delete.d.ts.map +0 -1
  308. package/dist/mcp/tools/collection/delete.js +0 -154
  309. package/dist/mcp/tools/collection/delete.js.map +0 -1
  310. package/dist/mcp/tools/collection/find.d.ts +0 -10
  311. package/dist/mcp/tools/collection/find.d.ts.map +0 -1
  312. package/dist/mcp/tools/collection/find.js +0 -165
  313. package/dist/mcp/tools/collection/find.js.map +0 -1
  314. package/dist/mcp/tools/collection/update.d.ts +0 -10
  315. package/dist/mcp/tools/collection/update.d.ts.map +0 -1
  316. package/dist/mcp/tools/collection/update.js +0 -209
  317. package/dist/mcp/tools/collection/update.js.map +0 -1
  318. package/dist/mcp/tools/config/find.d.ts +0 -10
  319. package/dist/mcp/tools/config/find.d.ts.map +0 -1
  320. package/dist/mcp/tools/config/find.js +0 -97
  321. package/dist/mcp/tools/config/find.js.map +0 -1
  322. package/dist/mcp/tools/config/update.d.ts +0 -10
  323. package/dist/mcp/tools/config/update.d.ts.map +0 -1
  324. package/dist/mcp/tools/config/update.js +0 -215
  325. package/dist/mcp/tools/config/update.js.map +0 -1
  326. package/dist/mcp/tools/global/find.d.ts +0 -5
  327. package/dist/mcp/tools/global/find.d.ts.map +0 -1
  328. package/dist/mcp/tools/global/find.js +0 -82
  329. package/dist/mcp/tools/global/find.js.map +0 -1
  330. package/dist/mcp/tools/global/update.d.ts +0 -6
  331. package/dist/mcp/tools/global/update.d.ts.map +0 -1
  332. package/dist/mcp/tools/global/update.js +0 -124
  333. package/dist/mcp/tools/global/update.js.map +0 -1
  334. package/dist/mcp/tools/job/create.d.ts +0 -10
  335. package/dist/mcp/tools/job/create.d.ts.map +0 -1
  336. package/dist/mcp/tools/job/create.js +0 -293
  337. package/dist/mcp/tools/job/create.js.map +0 -1
  338. package/dist/mcp/tools/job/run.d.ts +0 -10
  339. package/dist/mcp/tools/job/run.d.ts.map +0 -1
  340. package/dist/mcp/tools/job/run.js +0 -129
  341. package/dist/mcp/tools/job/run.js.map +0 -1
  342. package/dist/mcp/tools/job/update.d.ts +0 -11
  343. package/dist/mcp/tools/job/update.d.ts.map +0 -1
  344. package/dist/mcp/tools/job/update.js +0 -186
  345. package/dist/mcp/tools/job/update.js.map +0 -1
  346. package/dist/mcp/tools/resource/create.d.ts +0 -6
  347. package/dist/mcp/tools/resource/create.d.ts.map +0 -1
  348. package/dist/mcp/tools/resource/create.js +0 -124
  349. package/dist/mcp/tools/resource/create.js.map +0 -1
  350. package/dist/mcp/tools/resource/delete.d.ts +0 -5
  351. package/dist/mcp/tools/resource/delete.d.ts.map +0 -1
  352. package/dist/mcp/tools/resource/delete.js +0 -151
  353. package/dist/mcp/tools/resource/delete.js.map +0 -1
  354. package/dist/mcp/tools/resource/find.d.ts +0 -5
  355. package/dist/mcp/tools/resource/find.d.ts.map +0 -1
  356. package/dist/mcp/tools/resource/find.js +0 -170
  357. package/dist/mcp/tools/resource/find.js.map +0 -1
  358. package/dist/mcp/tools/resource/update.d.ts +0 -6
  359. package/dist/mcp/tools/resource/update.d.ts.map +0 -1
  360. package/dist/mcp/tools/resource/update.js +0 -256
  361. package/dist/mcp/tools/resource/update.js.map +0 -1
  362. package/dist/mcp/tools/schemas.d.ts +0 -457
  363. package/dist/mcp/tools/schemas.d.ts.map +0 -1
  364. package/dist/mcp/tools/schemas.js +0 -243
  365. package/dist/mcp/tools/schemas.js.map +0 -1
  366. package/dist/utils/adminEntitySettings.d.ts +0 -17
  367. package/dist/utils/adminEntitySettings.d.ts.map +0 -1
  368. package/dist/utils/adminEntitySettings.js +0 -41
  369. package/dist/utils/adminEntitySettings.js.map +0 -1
  370. package/dist/utils/createApiKeyFields.d.ts +0 -15
  371. package/dist/utils/createApiKeyFields.d.ts.map +0 -1
  372. package/dist/utils/createApiKeyFields.js +0 -57
  373. package/dist/utils/createApiKeyFields.js.map +0 -1
  374. package/dist/utils/getEnabledSlugs.d.ts +0 -13
  375. package/dist/utils/getEnabledSlugs.d.ts.map +0 -1
  376. package/dist/utils/getEnabledSlugs.js +0 -32
  377. package/dist/utils/getEnabledSlugs.js.map +0 -1
  378. package/dist/utils/getVirtualFieldNames.d.ts +0 -14
  379. package/dist/utils/getVirtualFieldNames.d.ts.map +0 -1
  380. package/dist/utils/getVirtualFieldNames.js +0 -35
  381. package/dist/utils/getVirtualFieldNames.js.map +0 -1
  382. package/dist/utils/schemaConversion/convertCollectionSchemaToZod.d.ts +0 -3
  383. package/dist/utils/schemaConversion/convertCollectionSchemaToZod.d.ts.map +0 -1
  384. package/dist/utils/schemaConversion/convertCollectionSchemaToZod.js +0 -43
  385. package/dist/utils/schemaConversion/convertCollectionSchemaToZod.js.map +0 -1
  386. package/dist/utils/schemaConversion/removeVirtualFieldsFromSchema.d.ts +0 -7
  387. package/dist/utils/schemaConversion/removeVirtualFieldsFromSchema.d.ts.map +0 -1
  388. package/dist/utils/schemaConversion/removeVirtualFieldsFromSchema.js +0 -20
  389. package/dist/utils/schemaConversion/removeVirtualFieldsFromSchema.js.map +0 -1
  390. package/dist/utils/schemaConversion/sanitizeJsonSchema.d.ts +0 -13
  391. package/dist/utils/schemaConversion/sanitizeJsonSchema.d.ts.map +0 -1
  392. package/dist/utils/schemaConversion/sanitizeJsonSchema.js +0 -56
  393. package/dist/utils/schemaConversion/sanitizeJsonSchema.js.map +0 -1
  394. package/dist/utils/schemaConversion/simplifyRelationshipFields.d.ts +0 -20
  395. package/dist/utils/schemaConversion/simplifyRelationshipFields.d.ts.map +0 -1
  396. package/dist/utils/schemaConversion/simplifyRelationshipFields.js +0 -53
  397. package/dist/utils/schemaConversion/simplifyRelationshipFields.js.map +0 -1
  398. package/dist/utils/schemaConversion/transformPointFields.d.ts +0 -3
  399. package/dist/utils/schemaConversion/transformPointFields.d.ts.map +0 -1
  400. package/dist/utils/schemaConversion/transformPointFields.js +0 -51
  401. package/dist/utils/schemaConversion/transformPointFields.js.map +0 -1
  402. package/dist/utils/transformPointDataToPayload.d.ts +0 -7
  403. package/dist/utils/transformPointDataToPayload.d.ts.map +0 -1
  404. package/dist/utils/transformPointDataToPayload.js +0 -28
  405. package/dist/utils/transformPointDataToPayload.js.map +0 -1
  406. package/src/collections/createApiKeysCollection.ts +0 -373
  407. package/src/defaults.ts +0 -3
  408. package/src/endpoints/mcp.ts +0 -91
  409. package/src/mcp/createRequest.ts +0 -13
  410. package/src/mcp/getMcpHandler.ts +0 -545
  411. package/src/mcp/helpers/config.ts +0 -213
  412. package/src/mcp/helpers/fields.ts +0 -154
  413. package/src/mcp/helpers/fileValidation.ts +0 -362
  414. package/src/mcp/registerTool.ts +0 -22
  415. package/src/mcp/tools/auth/auth.ts +0 -71
  416. package/src/mcp/tools/auth/forgotPassword.ts +0 -70
  417. package/src/mcp/tools/auth/login.ts +0 -72
  418. package/src/mcp/tools/auth/resetPassword.ts +0 -61
  419. package/src/mcp/tools/auth/unlock.ts +0 -64
  420. package/src/mcp/tools/auth/verify.ts +0 -57
  421. package/src/mcp/tools/collection/create.ts +0 -210
  422. package/src/mcp/tools/collection/delete.ts +0 -211
  423. package/src/mcp/tools/collection/find.ts +0 -224
  424. package/src/mcp/tools/collection/update.ts +0 -290
  425. package/src/mcp/tools/config/find.ts +0 -128
  426. package/src/mcp/tools/config/update.ts +0 -280
  427. package/src/mcp/tools/global/find.ts +0 -128
  428. package/src/mcp/tools/global/update.ts +0 -207
  429. package/src/mcp/tools/job/create.ts +0 -416
  430. package/src/mcp/tools/job/run.ts +0 -167
  431. package/src/mcp/tools/job/update.ts +0 -274
  432. package/src/mcp/tools/resource/create.ts +0 -211
  433. package/src/mcp/tools/resource/delete.ts +0 -218
  434. package/src/mcp/tools/resource/find.ts +0 -246
  435. package/src/mcp/tools/resource/update.ts +0 -383
  436. package/src/mcp/tools/schemas.ts +0 -520
  437. package/src/utils/adminEntitySettings.ts +0 -40
  438. package/src/utils/createApiKeyFields.ts +0 -72
  439. package/src/utils/getEnabledSlugs.ts +0 -42
  440. package/src/utils/getVirtualFieldNames.ts +0 -53
  441. package/src/utils/schemaConversion/convertCollectionSchemaToZod.ts +0 -52
  442. package/src/utils/schemaConversion/removeVirtualFieldsFromSchema.ts +0 -27
  443. package/src/utils/schemaConversion/sanitizeJsonSchema.ts +0 -62
  444. package/src/utils/schemaConversion/simplifyRelationshipFields.ts +0 -65
  445. package/src/utils/schemaConversion/transformPointFields.ts +0 -55
  446. package/src/utils/transformPointDataToPayload.ts +0 -40
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,cAAc,EACd,SAAS,EACV,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAE5B,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,yCAAyC,CAAA;AAE/E,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CACnB,MAAM,CACJ,cAAc,EACd;QACE;;WAEG;QACH,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB;;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,gBAAgB,CAAC,EAAE,CACjB,QAAQ,EAAE;YACR,OAAO,EAAE,KAAK,CAAC;gBACb,IAAI,EAAE,MAAM,CAAA;gBACZ,IAAI,EAAE,MAAM,CAAA;aACb,CAAC,CAAA;SACH,EACD,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,GAAG,EAAE,cAAc,KA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AE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,cAAc,EAAE,cAAc,CAAA;IAC9B,IAAI,EAAE,cAAc,CAAA;IACpB,IAAI,EAAE,gBAAgB,CAAA;CACvB,GAAG,WAAW,CAAA;AAEf,MAAM,MAAM,aAAa,GAAG;IAC1B,UAAU,EAAE,UAAU,CAAA;IACtB,IAAI,EAAE,UAAU,CAAA;IAChB,IAAI,EAAE,YAAY,CAAA;CACnB,GAAG,WAAW,CAAA;AAEf,MAAM,MAAM,OAAO,GACf,CAAC;IACC,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,QAAQ,CAAA;CACf,GAAG,WAAW,CAAC,GAChB,CAAC;IACC,QAAQ,EAAE,QAAQ,CAAA;IAClB,IAAI,EAAE,UAAU,CAAA;CACjB,GAAG,WAAW,CAAC,GAChB,CAAC;IACC,IAAI,EAAE,IAAI,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;CACb,GAAG,WAAW,CAAC,GAChB,iBAAiB,GACjB,aAAa,CAAA;AAEjB;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,OAAO,EAAE,CAAA;IAChB,cAAc,EAAE,OAAO,CAAA;CACxB,CAAA"}
package/dist/types.js CHANGED
@@ -1,3 +1,6 @@
1
- export { };
1
+ /**
2
+ * The MCP items and access mode authorized for this request. The authenticated user is available
3
+ * as `req.user`.
4
+ */ export { };
2
5
 
3
6
  //# sourceMappingURL=types.js.map
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type {\n CollectionConfig,\n CollectionSlug,\n GlobalSlug,\n PayloadRequest,\n TypedUser,\n} from 'payload'\nimport type { z } from 'zod'\n\nimport { type ResourceTemplate } from '@modelcontextprotocol/sdk/server/mcp.js'\n\nexport type MCPPluginConfig = {\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 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 * Set the globals that should be available as resources via MCP.\n * Globals are singleton configuration objects (e.g., site settings, navigation).\n * Note: Globals only support find and update operations.\n */\n globals?: Partial<\n Record<\n GlobalSlug,\n {\n /**\n * Set the description of the global. This is used by MCP clients to determine when to use the global as a resource.\n */\n description?: string\n /**\n * Set the enabled capabilities of the global. Admins can then allow or disallow the use of the capability by MCP clients.\n * Note: Globals only support find and update operations as they are singletons.\n */\n enabled:\n | {\n find?: boolean\n update?: boolean\n }\n | boolean\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 * 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: (\n args: Record<string, unknown>,\n req: PayloadRequest,\n _extra: unknown,\n ) =>\n | {\n messages: Array<{\n content: {\n text: string\n type: 'text'\n }\n role: 'assistant' | 'user'\n }>\n }\n | Promise<{\n messages: Array<{\n content: {\n text: string\n type: 'text'\n }\n role: 'assistant' | 'user'\n }>\n }>\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 * The handler can have either 3 arguments (when no args are passed) or 4 arguments (when args are passed).\n */\n handler: (...args: any[]) =>\n | {\n contents: Array<{\n text: string\n uri: string\n }>\n }\n | Promise<{\n contents: Array<{\n text: string\n uri: string\n }>\n }>\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: (\n args: Record<string, unknown>,\n req: PayloadRequest,\n _extra: unknown,\n ) =>\n | {\n content: Array<{\n text: string\n type: 'text'\n }>\n role?: string\n }\n | Promise<{\n content: Array<{\n text: string\n type: 'text'\n }>\n role?: string\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\n /**\n * Override the API key collection.\n * This allows you to add fields to the API key collection or modify the collection in any way you want.\n * @param collection - The API key collection.\n * @returns The modified API key collection.\n */\n overrideApiKeyCollection?: (collection: CollectionConfig) => CollectionConfig\n\n /**\n * Override the authentication method.\n * This allows you to use a custom authentication method instead of the default API key authentication.\n * @param req - The request object.\n * @returns The MCP access settings.\n */\n overrideAuth?: (\n req: PayloadRequest,\n getDefaultMcpAccessSettings: (overrideApiKey?: null | string) => Promise<MCPAccessSettings>,\n ) => MCPAccessSettings | Promise<MCPAccessSettings>\n\n /**\n * Set the users collection that API keys should be associated with.\n */\n userCollection?: CollectionSlug\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 * If true, disables the SSE endpoint. Only Streamable HTTP will be available.\n * @default true\n */\n disableSse?: boolean\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 * Callback function that receives MCP events.\n * This can be used to track analytics, debug issues, or implement custom behaviors.\n */\n onEvent?: (event: unknown) => void\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 */\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 * Optional instructions describing how to use the server and its features.\n */\n instructions?: string\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 custom?: Record<string, boolean>\n globals?: {\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 user: TypedUser\n} & Record<string, unknown>\n\nexport type EntityConfig = MCPPluginConfig['collections'] | MCPPluginConfig['globals']\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":"AAwhBA,WAKC"}
1
+ {"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type {\n CallToolResult,\n ContentBlock,\n Implementation,\n JsonSchemaType,\n McpServerOptions,\n ResourceTemplate,\n ServerContext,\n StandardSchemaWithJSON,\n ToolAnnotations,\n} from '@modelcontextprotocol/server'\nimport type {\n AuthCollectionSlug,\n CollectionSlug,\n GlobalSlug,\n MaybePromise,\n PayloadRequest,\n SanitizedPermissions,\n} from 'payload'\n\nimport type { GetAuthorizedMCPArgs } from './endpoint/access.js'\nimport type {\n MCPCollectionAuthToolName,\n MCPCollectionBuiltinName,\n MCPGlobalBuiltinName,\n} from './mcp/builtinTools.js'\n\nexport type { MCPCollectionAuthToolName, MCPCollectionBuiltinName, MCPGlobalBuiltinName }\n\n/** Re-exported from `@modelcontextprotocol/server` — common MCP types used in plugin config. */\nexport type { JsonSchemaType, StandardSchemaWithJSON, ToolAnnotations }\n\n/**\n * What a tool's `input` (or a prompt's `argsSchema`) can be — either a raw\n * JSON Schema 2020-12 literal, or a Standard Schema instance (Zod, Valibot, …).\n * Raw schemas may omit `$schema`; when present it must declare the 2020-12 dialect.\n */\nexport type ToolInputSchema = JsonSchemaType | StandardSchemaWithJSON\n\nexport type MCPToolResponse = {\n content: ContentBlock[]\n /**\n * If available, return the document fetched within the\n * mcp tool. This is threaded as an additional argument to\n * overrideResponse functions and stripped before going on the wire.\n */\n doc?: Record<string, unknown>\n} & Pick<CallToolResult, '_meta' | 'isError' | 'structuredContent'>\n\nexport type MCPResponseOverride = (\n response: MCPToolResponse,\n doc: Record<string, unknown>,\n req: PayloadRequest,\n) => MCPToolResponse\n\nexport type MCPAfterToolCallHook = (args: {\n input: unknown\n req: PayloadRequest\n response: MCPToolResponse\n toolName: string\n}) => MaybePromise<MCPToolResponse>\n\n/**\n * The handler's `input` type. A specific Standard Schema (Zod, Valibot, …) gets\n * its inferred output; anything else falls back to `Record<string, unknown>`.\n */\nexport type TypedInput<TSchema> = TSchema extends StandardSchemaWithJSON\n ? StandardSchemaWithJSON extends TSchema\n ? Record<string, unknown>\n : StandardSchemaWithJSON.InferOutput<TSchema>\n : Record<string, unknown>\n\nexport type MCPAccessArgs = {\n permissions?: SanitizedPermissions\n req: PayloadRequest\n}\n\nexport type CollectionMCPAccessArgs = {\n slug: CollectionSlug\n} & MCPAccessArgs\n\nexport type GlobalMCPAccessArgs = {\n slug: GlobalSlug\n} & MCPAccessArgs\n\nexport type ToolHandlerArgs<TSchema = undefined> = {\n authorizedMCP: AuthorizedMCP\n input: TypedInput<TSchema>\n req: PayloadRequest\n serverContext: ServerContext\n}\n\nexport type CollectionToolHandlerArgs<TSchema = undefined> = {\n slug: CollectionSlug\n} & ToolHandlerArgs<TSchema>\n\nexport type GlobalToolHandlerArgs<TSchema = undefined> = {\n slug: GlobalSlug\n} & ToolHandlerArgs<TSchema>\n\nexport type Tool<TSchema extends ToolInputSchema | undefined = ToolInputSchema | undefined> = {\n /**\n * Runs while authorizing each MCP request, before the tool is advertised or called. Return\n * `false` to make the tool unavailable for that request. This is skipped when `overrideAccess`\n * is enabled.\n */\n access?: (args: MCPAccessArgs) => MaybePromise<boolean>\n annotations?: ToolAnnotations\n description: string\n handler: (args: ToolHandlerArgs<TSchema>) => MaybePromise<MCPToolResponse>\n input?: TSchema\n /**\n * Override the return value of the tool handler\n */\n overrideResponse?: MCPResponseOverride\n}\n\nexport type CollectionTool<\n TSchema extends ToolInputSchema | undefined = ToolInputSchema | undefined,\n> = {\n /**\n * Runs while authorizing each MCP request for this collection. Return `false` to reject calls\n * to this tool for the collection. The shared tool is not advertised when no collections allow\n * it, but can remain advertised when it is available for another collection. This is skipped\n * when `overrideAccess` is enabled.\n */\n access?: (args: CollectionMCPAccessArgs) => MaybePromise<boolean>\n handler: (args: CollectionToolHandlerArgs<TSchema>) => MaybePromise<MCPToolResponse>\n input?: TSchema\n} & Pick<Tool, 'annotations' | 'description' | 'overrideResponse'>\n\nexport type GlobalTool<TSchema extends ToolInputSchema | undefined = ToolInputSchema | undefined> =\n {\n /**\n * Runs while authorizing each MCP request for this global. Return `false` to reject calls to\n * this tool for the global. The shared tool is not advertised when no globals allow it, but\n * can remain advertised when it is available for another global. This is skipped when\n * `overrideAccess` is enabled.\n */\n access?: (args: GlobalMCPAccessArgs) => MaybePromise<boolean>\n handler: (args: GlobalToolHandlerArgs<TSchema>) => MaybePromise<MCPToolResponse>\n input?: TSchema\n } & Pick<Tool, 'annotations' | 'description' | 'overrideResponse'>\n\n/**\n * Configures (or disables) a built-in tool without replacing it.\n * `handler?: never` prevents a full `CollectionTool`/`GlobalTool` (which has a\n * required handler) from being silently accepted at a built-in key slot.\n */\nexport type MCPBuiltInCollectionToolOverride = {\n /**\n * Replaces the built-in tool's access check. Return `false` to make the tool unavailable for\n * this collection. This is skipped when `overrideAccess` is enabled.\n */\n access?: (args: CollectionMCPAccessArgs) => MaybePromise<boolean>\n annotations?: ToolAnnotations\n description?: string\n handler?: never\n overrideResponse?: MCPResponseOverride\n}\n\nexport type MCPBuiltInGlobalToolOverride = {\n /**\n * Replaces the built-in tool's access check. Return `false` to make the tool unavailable for\n * this global. This is skipped when `overrideAccess` is enabled.\n */\n access?: (args: GlobalMCPAccessArgs) => MaybePromise<boolean>\n annotations?: ToolAnnotations\n description?: string\n handler?: never\n overrideResponse?: MCPResponseOverride\n}\n\n/**\n * Value at a custom (non-built-in) tool key. Either the tool itself, or `false`\n * to disable it (useful when one plugin defines a custom tool and another\n * wants to opt out per-collection).\n */\nexport type MCPTopLevelToolEntry = Tool\n\nexport type MCPCollectionToolsMap = {\n [customToolName: string]: boolean | CollectionTool | MCPBuiltInCollectionToolOverride | undefined\n} & {\n [K in MCPCollectionBuiltinName]?: false | MCPBuiltInCollectionToolOverride\n}\n\nexport type MCPAuthCollectionToolsMap = {\n [K in MCPCollectionAuthToolName]?: MCPBuiltInCollectionToolOverride | true\n} & MCPCollectionToolsMap\n\n/** Auth-enabled collections get auth-tool name autocomplete; others get CRUD-only. */\nexport type MCPToolsMapForCollection<Slug extends CollectionSlug> = Slug extends AuthCollectionSlug\n ? MCPAuthCollectionToolsMap\n : MCPCollectionToolsMap\n\nexport type MCPGlobalToolsMap = {\n [customToolName: string]: boolean | GlobalTool | MCPBuiltInGlobalToolOverride | undefined\n} & {\n [K in MCPGlobalBuiltinName]?: false | MCPBuiltInGlobalToolOverride\n}\n\nexport type MCPTopLevelToolsMap = Record<string, Tool>\n\nexport type PromptHandlerArgs<TSchema = undefined> = {\n input: TypedInput<TSchema>\n req: PayloadRequest\n serverContext: ServerContext\n}\n\nexport type Prompt<TSchema extends ToolInputSchema = ToolInputSchema> = {\n /**\n * Runs while authorizing each MCP request, before the prompt is advertised or used. Return\n * `false` to make the prompt unavailable for that request. This is skipped when\n * `overrideAccess` is enabled.\n */\n access?: (args: MCPAccessArgs) => MaybePromise<boolean>\n argsSchema: TSchema\n description: string\n handler: (args: PromptHandlerArgs<TSchema>) => MaybePromise<{\n messages: Array<{ content: { text: string; type: 'text' }; role: 'assistant' | 'user' }>\n }>\n title: string\n}\n\nexport type ResourceHandlerArgs = {\n /** Variables extracted from a `ResourceTemplate` URI. Empty for static-URI resources. */\n params: Record<string, string>\n req: PayloadRequest\n serverContext: ServerContext\n uri: URL\n}\n\nexport type Resource = {\n /**\n * Runs while authorizing each MCP request, before the resource is advertised or read. Return\n * `false` to make the resource unavailable for that request. This is skipped when\n * `overrideAccess` is enabled.\n */\n access?: (args: MCPAccessArgs) => MaybePromise<boolean>\n description: string\n handler: (args: ResourceHandlerArgs) => MaybePromise<{\n contents: Array<{ text: string; uri: string }>\n }>\n mimeType: string\n title: string\n uri: ResourceTemplate | string\n}\n\nexport type MCPPluginCollectionConfig<TSlug extends CollectionSlug> = {\n description?: string\n /** Fallback for built-in tools that don't set their own `overrideResponse`. */\n overrideResponse?: MCPResponseOverride\n tools?: MCPToolsMapForCollection<TSlug>\n}\n\nexport type MCPPluginGlobalConfig = {\n description?: string\n overrideResponse?: MCPResponseOverride\n tools?: MCPGlobalToolsMap\n}\n\n/**\n * The user-facing config shape passed to `mcpPlugin({ ... })`. Tools, prompts,\n * resources, and per-collection/global tool maps live in their own nested\n * fields. `sanitizeMCPConfig` flattens those into `items` and applies defaults\n * to produce a `SanitizedMCPPluginConfig` — the form every internal consumer\n * actually works with.\n */\nexport type MCPPluginConfig = {\n collections?: {\n [Slug in CollectionSlug]?: MCPPluginCollectionConfig<Slug>\n }\n /** Skip MCP endpoint registration. */\n disabled?: boolean\n globals?: {\n [Slug in GlobalSlug]?: MCPPluginGlobalConfig\n }\n hooks?: {\n /** Transform a tool response after its handler returns */\n afterToolCall?: MCPAfterToolCallHook[]\n }\n mcp?: {\n /**\n * Largest HTTP request body, in bytes, that the MCP endpoint accepts. Larger requests\n * are answered with `413`. Base64 file uploads count toward this limit.\n *\n * @default 4194304 (4 MiB, the MCP SDK default)\n */\n maxRequestBodySize?: number\n serverOptions?: MCPServerOptions\n verboseLogs?: boolean\n }\n /**\n * How MCP clients sign in. MCP requests without an authenticated user get a `401` that points\n * to the protected resource metadata (RFC 9728). Set to `false` to only accept API keys and\n * anonymous requests.\n *\n * @default { type: 'builtin' }\n */\n oauth?: false | MCPOAuthConfig\n /**\n * Replace the default MCP authorization resolver.\n *\n * This hook replaces the default authentication flow. It must set `req.user` to the\n * authenticated Payload user, or to `null` for an anonymous caller, before returning.\n */\n overrideGetAuthorizedMCP?: (\n args: {\n pluginConfig: SanitizedMCPPluginConfig\n } & GetAuthorizedMCPArgs,\n ) => MaybePromise<AuthorizedMCP>\n prompts?: Record<string, Prompt>\n resources?: Record<string, Resource>\n /** Cross-cutting tools (not scoped to any collection or global). */\n tools?: MCPTopLevelToolsMap\n}\n\nexport type MCPOAuthConfig = MCPBuiltinOAuthConfig | MCPExternalOAuthConfig\n\n/**\n * This Payload app is the authorization server. Users sign in to the admin panel and allow the\n * MCP client, which then gets an access token for them.\n */\nexport type MCPBuiltinOAuthConfig = {\n /**\n * Creates the tokens the MCP client gets when the user clicks Allow. `req` is the user's own\n * browser request, so `req.user` is the user who allowed it. Pass `authenticate` too if\n * Payload's auth strategies don't accept the access token.\n *\n * @default a Payload login token for that user that only works for MCP, with a refresh token when\n * the collection uses sessions\n */\n issueToken?: (args: { req: PayloadRequest }) => MaybePromise<MCPOAuthTokens>\n /**\n * Trades a refresh token from `issueToken`, or from an earlier refresh, for new tokens. Return\n * `null` when it's no longer valid, and the client sends the user through sign-in again. `req`\n * is the MCP client's request, without a user. Only used together with `issueToken`.\n *\n * OAuth requires noticing copied refresh tokens: return a new refresh token every time, and\n * revoke the tokens when an already used refresh token comes back.\n *\n * It also runs when the client trades its authorization code, on the refresh token from\n * `issueToken`, with `reuseInterval: 0`. OAuth requires a code to work only once, so refuse that\n * refresh token if it was used before, even moments ago.\n */\n refreshToken?: (args: {\n refreshToken: string\n req: PayloadRequest\n /**\n * How long a refresh token that was just used may still be accepted, in milliseconds, e.g. for\n * clients that refresh twice at once. `0` means not at all. When it's missing, use your usual\n * leeway.\n */\n reuseInterval?: number\n }) => MaybePromise<MCPOAuthTokens | null>\n type: 'builtin'\n} & MCPOAuthSharedConfig\n\nexport type MCPOAuthTokens = {\n accessToken: string\n /** Seconds until the access token expires. */\n expiresIn?: number\n /** Lets the client get new tokens without the user, through `refreshToken`. */\n refreshToken?: string\n}\n\n/** Another service, e.g. your identity provider, is the authorization server. */\nexport type MCPExternalOAuthConfig = {\n /**\n * The authorization servers that issue access tokens for MCP clients. Clients require each one\n * to exactly match the `issuer` in that server's metadata, so pass a function when the exact\n * value is only known at runtime, e.g. from the server's OpenID configuration or per host.\n */\n authorizationServers: ((args: { req: PayloadRequest }) => MaybePromise<string[]>) | string[]\n /**\n * Scopes MCP clients should request, e.g. `['openid', 'email', 'profile']`. Without them,\n * clients request none, which some authorization servers reject or answer with a token that\n * doesn't identify the user.\n */\n scopes?: string[]\n type: 'external'\n} & MCPOAuthSharedConfig\n\ntype MCPOAuthSharedConfig = {\n /**\n * Called on MCP requests with a bearer token that Payload's auth strategies didn't accept.\n * Return the Payload user, including its `collection`, or `null` to answer with the OAuth challenge.\n */\n authenticate?: (args: {\n req: PayloadRequest\n token: string\n }) => MaybePromise<PayloadRequest['user']>\n /**\n * The URL clients call to reach the MCP endpoint. The metadata link and the built-in\n * authorization server's issuer are based on it.\n *\n * @default the absolute URL of `/api/mcp`, based on `serverURL` or the request URL\n */\n resource?: ((args: { req: PayloadRequest }) => string) | string\n}\n\nexport type SanitizedMCPPluginConfig = {\n items: MCPItem[]\n /** `undefined` when OAuth is turned off. */\n oauth?: MCPOAuthConfig\n} & Pick<MCPPluginConfig, 'disabled' | 'hooks' | 'mcp' | 'overrideGetAuthorizedMCP'>\n\nexport type MCPServerOptions = {\n options?: McpServerOptions\n serverInfo?: Partial<Implementation>\n}\n\n/**\n * One MCP primitive plus the metadata needed for config-driven filtering and\n * registration.\n *\n * - `configKey`: the config identifier, e.g. `find` or `echo`.\n * - `mcpName`: the MCP wire name, e.g. `findDocuments` or `echo`.\n * - `label`: human-readable display text.\n */\nexport type MCPItemBase = {\n configKey: string\n label: string\n mcpName: string\n}\n\nexport type CollectionMCPItem = {\n collectionSlug: CollectionSlug\n tool: CollectionTool\n type: 'collectionTool'\n} & MCPItemBase\n\nexport type GlobalMCPItem = {\n globalSlug: GlobalSlug\n tool: GlobalTool\n type: 'globalTool'\n} & MCPItemBase\n\nexport type MCPItem =\n | ({\n prompt: Prompt\n type: 'prompt'\n } & MCPItemBase)\n | ({\n resource: Resource\n type: 'resource'\n } & MCPItemBase)\n | ({\n tool: Tool\n type: 'tool'\n } & MCPItemBase)\n | CollectionMCPItem\n | GlobalMCPItem\n\n/**\n * The MCP items and access mode authorized for this request. The authenticated user is available\n * as `req.user`.\n */\nexport type AuthorizedMCP = {\n items: MCPItem[]\n overrideAccess: boolean\n}\n"],"names":[],"mappings":"AAscA;;;CAGC,GACD,WAGC"}
@@ -0,0 +1,10 @@
1
+ import type { Payload } from 'payload';
2
+ /**
3
+ * Get the logger for the MCP plugin. Child of the main Payload logger, prefixed with `[plugin-mcp]`
4
+ * and tagged with a structured `plugin: 'mcp'` field. When `verboseLogs` is off, info/debug calls
5
+ * are silenced; warn/error still surface so operators don't lose error signal.
6
+ */
7
+ export declare const getLogger: (args: {
8
+ payload: Payload;
9
+ }) => Payload['logger'];
10
+ //# sourceMappingURL=getLogger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getLogger.d.ts","sourceRoot":"","sources":["../../src/utils/getLogger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAItC;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,CAAC,IAAI,EAAE;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,KAAK,OAAO,CAAC,QAAQ,CAYvE,CAAA"}
@@ -0,0 +1,22 @@
1
+ import { getPluginConfig } from './getPluginConfig.js';
2
+ /**
3
+ * Get the logger for the MCP plugin. Child of the main Payload logger, prefixed with `[plugin-mcp]`
4
+ * and tagged with a structured `plugin: 'mcp'` field. When `verboseLogs` is off, info/debug calls
5
+ * are silenced; warn/error still surface so operators don't lose error signal.
6
+ */ export const getLogger = ({ payload })=>{
7
+ const pluginConfig = getPluginConfig({
8
+ config: payload.config
9
+ });
10
+ const useVerboseLogs = pluginConfig?.mcp?.verboseLogs ?? false;
11
+ const logger = payload.logger.child({
12
+ plugin: 'mcp'
13
+ }, {
14
+ msgPrefix: '[plugin-mcp] '
15
+ });
16
+ if (!useVerboseLogs) {
17
+ logger.level = 'warn';
18
+ }
19
+ return logger;
20
+ };
21
+
22
+ //# sourceMappingURL=getLogger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/getLogger.ts"],"sourcesContent":["import type { Payload } from 'payload'\n\nimport { getPluginConfig } from './getPluginConfig.js'\n\n/**\n * Get the logger for the MCP plugin. Child of the main Payload logger, prefixed with `[plugin-mcp]`\n * and tagged with a structured `plugin: 'mcp'` field. When `verboseLogs` is off, info/debug calls\n * are silenced; warn/error still surface so operators don't lose error signal.\n */\nexport const getLogger: (args: { payload: Payload }) => Payload['logger'] = ({ payload }) => {\n const pluginConfig = getPluginConfig({ config: payload.config })\n\n const useVerboseLogs = pluginConfig?.mcp?.verboseLogs ?? false\n\n const logger = payload.logger.child({ plugin: 'mcp' }, { msgPrefix: '[plugin-mcp] ' })\n\n if (!useVerboseLogs) {\n logger.level = 'warn'\n }\n\n return logger\n}\n"],"names":["getPluginConfig","getLogger","payload","pluginConfig","config","useVerboseLogs","mcp","verboseLogs","logger","child","plugin","msgPrefix","level"],"mappings":"AAEA,SAASA,eAAe,QAAQ,uBAAsB;AAEtD;;;;CAIC,GACD,OAAO,MAAMC,YAA+D,CAAC,EAAEC,OAAO,EAAE;IACtF,MAAMC,eAAeH,gBAAgB;QAAEI,QAAQF,QAAQE,MAAM;IAAC;IAE9D,MAAMC,iBAAiBF,cAAcG,KAAKC,eAAe;IAEzD,MAAMC,SAASN,QAAQM,MAAM,CAACC,KAAK,CAAC;QAAEC,QAAQ;IAAM,GAAG;QAAEC,WAAW;IAAgB;IAEpF,IAAI,CAACN,gBAAgB;QACnBG,OAAOI,KAAK,GAAG;IACjB;IAEA,OAAOJ;AACT,EAAC"}
@@ -0,0 +1,12 @@
1
+ import type { SanitizedConfig } from 'payload';
2
+ import type { SanitizedMCPPluginConfig } from '../types.js';
3
+ /**
4
+ * Returns the sanitized plugin config — the form produced by
5
+ * `sanitizeMCPConfig` and stashed back on the plugin's `options` during init.
6
+ * Callers downstream of plugin init can rely on `items` and other defaults
7
+ * being fully resolved.
8
+ */
9
+ export declare const getPluginConfig: (args: {
10
+ config: SanitizedConfig;
11
+ }) => SanitizedMCPPluginConfig;
12
+ //# sourceMappingURL=getPluginConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getPluginConfig.d.ts","sourceRoot":"","sources":["../../src/utils/getPluginConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,eAAe,EAAE,MAAM,SAAS,CAAA;AAE1D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AAE3D;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,CAAC,IAAI,EAAE;IAAE,MAAM,EAAE,eAAe,CAAA;CAAE,KAAK,wBAapE,CAAA"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Returns the sanitized plugin config — the form produced by
3
+ * `sanitizeMCPConfig` and stashed back on the plugin's `options` during init.
4
+ * Callers downstream of plugin init can rely on `items` and other defaults
5
+ * being fully resolved.
6
+ */ export const getPluginConfig = ({ config })=>{
7
+ const plugin = config.plugins?.find((plugin)=>plugin.slug === '@payloadcms/plugin-mcp');
8
+ if (!plugin) {
9
+ throw new Error('MCP Plugin not found in config.plugins.');
10
+ }
11
+ // @ts-expect-error
12
+ return plugin.sanitizedOptions;
13
+ };
14
+
15
+ //# sourceMappingURL=getPluginConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/getPluginConfig.ts"],"sourcesContent":["import type { PluginsMap, SanitizedConfig } from 'payload'\n\nimport type { SanitizedMCPPluginConfig } from '../types.js'\n\n/**\n * Returns the sanitized plugin config — the form produced by\n * `sanitizeMCPConfig` and stashed back on the plugin's `options` during init.\n * Callers downstream of plugin init can rely on `items` and other defaults\n * being fully resolved.\n */\nexport const getPluginConfig: (args: { config: SanitizedConfig }) => SanitizedMCPPluginConfig = ({\n config,\n}) => {\n const plugin = config.plugins?.find(\n (plugin) => plugin.slug === '@payloadcms/plugin-mcp',\n ) as PluginsMap['@payloadcms/plugin-mcp']\n\n if (!plugin) {\n throw new Error('MCP Plugin not found in config.plugins.')\n }\n\n // @ts-expect-error\n return plugin.sanitizedOptions\n}\n"],"names":["getPluginConfig","config","plugin","plugins","find","slug","Error","sanitizedOptions"],"mappings":"AAIA;;;;;CAKC,GACD,OAAO,MAAMA,kBAAmF,CAAC,EAC/FC,MAAM,EACP;IACC,MAAMC,SAASD,OAAOE,OAAO,EAAEC,KAC7B,CAACF,SAAWA,OAAOG,IAAI,KAAK;IAG9B,IAAI,CAACH,QAAQ;QACX,MAAM,IAAII,MAAM;IAClB;IAEA,mBAAmB;IACnB,OAAOJ,OAAOK,gBAAgB;AAChC,EAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Returns the project root: the parent of the outermost `node_modules` segment in
3
+ * `fromPath`. Returns `null` when the path has no `node_modules` (e.g. running from
4
+ * source inside the Payload monorepo).
5
+ */
6
+ export declare const resolveProjectRoot: (fromPath: string) => null | string;
7
+ //# sourceMappingURL=resolveProjectRoot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveProjectRoot.d.ts","sourceRoot":"","sources":["../../src/utils/resolveProjectRoot.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,aAAc,MAAM,KAAG,IAAI,GAAG,MAS5D,CAAA"}
@@ -0,0 +1,15 @@
1
+ import path from 'path';
2
+ /**
3
+ * Returns the project root: the parent of the outermost `node_modules` segment in
4
+ * `fromPath`. Returns `null` when the path has no `node_modules` (e.g. running from
5
+ * source inside the Payload monorepo).
6
+ */ export const resolveProjectRoot = (fromPath)=>{
7
+ const segments = fromPath.split(path.sep);
8
+ const nodeModulesIndex = segments.indexOf('node_modules');
9
+ if (nodeModulesIndex <= 0) {
10
+ return null;
11
+ }
12
+ return segments.slice(0, nodeModulesIndex).join(path.sep) || null;
13
+ };
14
+
15
+ //# sourceMappingURL=resolveProjectRoot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/resolveProjectRoot.ts"],"sourcesContent":["import path from 'path'\n\n/**\n * Returns the project root: the parent of the outermost `node_modules` segment in\n * `fromPath`. Returns `null` when the path has no `node_modules` (e.g. running from\n * source inside the Payload monorepo).\n */\nexport const resolveProjectRoot = (fromPath: string): null | string => {\n const segments = fromPath.split(path.sep)\n const nodeModulesIndex = segments.indexOf('node_modules')\n\n if (nodeModulesIndex <= 0) {\n return null\n }\n\n return segments.slice(0, nodeModulesIndex).join(path.sep) || null\n}\n"],"names":["path","resolveProjectRoot","fromPath","segments","split","sep","nodeModulesIndex","indexOf","slice","join"],"mappings":"AAAA,OAAOA,UAAU,OAAM;AAEvB;;;;CAIC,GACD,OAAO,MAAMC,qBAAqB,CAACC;IACjC,MAAMC,WAAWD,SAASE,KAAK,CAACJ,KAAKK,GAAG;IACxC,MAAMC,mBAAmBH,SAASI,OAAO,CAAC;IAE1C,IAAID,oBAAoB,GAAG;QACzB,OAAO;IACT;IAEA,OAAOH,SAASK,KAAK,CAAC,GAAGF,kBAAkBG,IAAI,CAACT,KAAKK,GAAG,KAAK;AAC/D,EAAC"}
@@ -0,0 +1,17 @@
1
+ import type { PayloadRequest } from 'payload';
2
+ /**
3
+ * Encrypts data for the client to hold, so it doesn't need to be stored. `type` keeps one kind
4
+ * from being used as another, e.g. a client ID as an authorization code.
5
+ */
6
+ export declare const seal: ({ type, data, expiresInSeconds, req, }: {
7
+ data: object;
8
+ expiresInSeconds?: number;
9
+ req: PayloadRequest;
10
+ type: string;
11
+ }) => string;
12
+ export declare const unseal: <T>({ type, req, value, }: {
13
+ req: PayloadRequest;
14
+ type: string;
15
+ value: null | string;
16
+ }) => T | undefined;
17
+ //# sourceMappingURL=seal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"seal.d.ts","sourceRoot":"","sources":["../../src/utils/seal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C;;;GAGG;AACH,eAAO,MAAM,IAAI,2CAKd;IACD,IAAI,EAAE,MAAM,CAAA;IACZ,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,GAAG,EAAE,cAAc,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;CACb,KAAG,MAOD,CAAA;AAEH,eAAO,MAAM,MAAM,GAAI,CAAC,yBAIrB;IACD,GAAG,EAAE,cAAc,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,IAAI,GAAG,MAAM,CAAA;CACrB,KAAG,CAAC,GAAG,SAYP,CAAA"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Encrypts data for the client to hold, so it doesn't need to be stored. `type` keeps one kind
3
+ * from being used as another, e.g. a client ID as an authorization code.
4
+ */ export const seal = ({ type, data, expiresInSeconds, req })=>req.payload.encrypt(JSON.stringify({
5
+ ...data,
6
+ type,
7
+ exp: expiresInSeconds && Date.now() + expiresInSeconds * 1000
8
+ }));
9
+ export const unseal = ({ type, req, value })=>{
10
+ // Only the v1 format is authenticated. Older formats decrypt anything without an error.
11
+ if (!value?.startsWith('v1:')) {
12
+ return undefined;
13
+ }
14
+ try {
15
+ const data = JSON.parse(req.payload.decrypt(value, {
16
+ secret: req.payload.config.secret
17
+ }));
18
+ return data.type === type && (!data.exp || data.exp > Date.now()) ? data : undefined;
19
+ } catch {
20
+ return undefined;
21
+ }
22
+ };
23
+
24
+ //# sourceMappingURL=seal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/seal.ts"],"sourcesContent":["import type { PayloadRequest } from 'payload'\n\n/**\n * Encrypts data for the client to hold, so it doesn't need to be stored. `type` keeps one kind\n * from being used as another, e.g. a client ID as an authorization code.\n */\nexport const seal = ({\n type,\n data,\n expiresInSeconds,\n req,\n}: {\n data: object\n expiresInSeconds?: number\n req: PayloadRequest\n type: string\n}): string =>\n req.payload.encrypt(\n JSON.stringify({\n ...data,\n type,\n exp: expiresInSeconds && Date.now() + expiresInSeconds * 1000,\n }),\n )\n\nexport const unseal = <T>({\n type,\n req,\n value,\n}: {\n req: PayloadRequest\n type: string\n value: null | string\n}): T | undefined => {\n // Only the v1 format is authenticated. Older formats decrypt anything without an error.\n if (!value?.startsWith('v1:')) {\n return undefined\n }\n\n try {\n const data = JSON.parse(req.payload.decrypt(value, { secret: req.payload.config.secret }))\n return data.type === type && (!data.exp || data.exp > Date.now()) ? data : undefined\n } catch {\n return undefined\n }\n}\n"],"names":["seal","type","data","expiresInSeconds","req","payload","encrypt","JSON","stringify","exp","Date","now","unseal","value","startsWith","undefined","parse","decrypt","secret","config"],"mappings":"AAEA;;;CAGC,GACD,OAAO,MAAMA,OAAO,CAAC,EACnBC,IAAI,EACJC,IAAI,EACJC,gBAAgB,EAChBC,GAAG,EAMJ,GACCA,IAAIC,OAAO,CAACC,OAAO,CACjBC,KAAKC,SAAS,CAAC;QACb,GAAGN,IAAI;QACPD;QACAQ,KAAKN,oBAAoBO,KAAKC,GAAG,KAAKR,mBAAmB;IAC3D,IACD;AAEH,OAAO,MAAMS,SAAS,CAAI,EACxBX,IAAI,EACJG,GAAG,EACHS,KAAK,EAKN;IACC,wFAAwF;IACxF,IAAI,CAACA,OAAOC,WAAW,QAAQ;QAC7B,OAAOC;IACT;IAEA,IAAI;QACF,MAAMb,OAAOK,KAAKS,KAAK,CAACZ,IAAIC,OAAO,CAACY,OAAO,CAACJ,OAAO;YAAEK,QAAQd,IAAIC,OAAO,CAACc,MAAM,CAACD,MAAM;QAAC;QACvF,OAAOhB,KAAKD,IAAI,KAAKA,QAAS,CAAA,CAACC,KAAKO,GAAG,IAAIP,KAAKO,GAAG,GAAGC,KAAKC,GAAG,EAAC,IAAKT,OAAOa;IAC7E,EAAE,OAAM;QACN,OAAOA;IACT;AACF,EAAC"}
@@ -0,0 +1,5 @@
1
+ import { type StandardSchemaWithJSON } from '@modelcontextprotocol/server';
2
+ import type { ToolInputSchema } from '../types.js';
3
+ /** Normalize a tool/prompt input to a Standard Schema. Raw JSON Schema gets wrapped; Standard Schema instances pass through. */
4
+ export declare const toStandardSchema: (schema: ToolInputSchema) => StandardSchemaWithJSON;
5
+ //# sourceMappingURL=toStandardSchema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toStandardSchema.d.ts","sourceRoot":"","sources":["../../src/utils/toStandardSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AAE1F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAElD,gIAAgI;AAChI,eAAO,MAAM,gBAAgB,WAAY,eAAe,KAAG,sBAG/B,CAAA"}
@@ -0,0 +1,4 @@
1
+ import { fromJsonSchema } from '@modelcontextprotocol/server';
2
+ /** Normalize a tool/prompt input to a Standard Schema. Raw JSON Schema gets wrapped; Standard Schema instances pass through. */ export const toStandardSchema = (schema)=>typeof schema === 'object' && schema !== null && '~standard' in schema ? schema : fromJsonSchema(schema);
3
+
4
+ //# sourceMappingURL=toStandardSchema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/toStandardSchema.ts"],"sourcesContent":["import { fromJsonSchema, type StandardSchemaWithJSON } from '@modelcontextprotocol/server'\n\nimport type { ToolInputSchema } from '../types.js'\n\n/** Normalize a tool/prompt input to a Standard Schema. Raw JSON Schema gets wrapped; Standard Schema instances pass through. */\nexport const toStandardSchema = (schema: ToolInputSchema): StandardSchemaWithJSON =>\n typeof schema === 'object' && schema !== null && '~standard' in schema\n ? schema\n : fromJsonSchema(schema)\n"],"names":["fromJsonSchema","toStandardSchema","schema"],"mappings":"AAAA,SAASA,cAAc,QAAqC,+BAA8B;AAI1F,8HAA8H,GAC9H,OAAO,MAAMC,mBAAmB,CAACC,SAC/B,OAAOA,WAAW,YAAYA,WAAW,QAAQ,eAAeA,SAC5DA,SACAF,eAAeE,QAAO"}
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ /**
3
+ * The Allow and Deny buttons, protected against clicks the user didn't mean for this page:
4
+ *
5
+ * - Inside a frame they aren't shown, so other sites can't frame the page and trick users into
6
+ * clicking them. The server can't tell, so they're missing until the browser has checked.
7
+ * - They're disabled until the page has been visible and focused for a moment. Otherwise another
8
+ * site could open the page under the user's cursor while they double-click something else, so
9
+ * the second click lands on Allow. Leaving the page disables them again. Waiting works for every
10
+ * way of clicking, unlike requiring a mouse movement or key press first.
11
+ *
12
+ * @see https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-17#section-7.11 for why the
13
+ * OAuth server must prevent clickjacking
14
+ * @see https://cheatsheetseries.owasp.org/cheatsheets/Clickjacking_Defense_Cheat_Sheet.html#defending-against-doubleclickjacking
15
+ * for the double-click attack and its mitigation
16
+ */
17
+ export declare function AllowButtons(): React.JSX.Element | null;
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/Authorize/AllowButtons/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAoD,MAAM,OAAO,CAAA;AAUxE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,6BAoE3B"}
@@ -0,0 +1,88 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Button } from '@payloadcms/ui';
4
+ import React, { useEffect, useState, useSyncExternalStore } from 'react';
5
+ const baseClass = 'mcp-authorize';
6
+ /** How long the page must have been in front of the user before the buttons work, in ms. */ const enableDelay = 1000;
7
+ // Whether the page is inside a frame never changes, so there's nothing to subscribe to
8
+ const subscribe = ()=>()=>{};
9
+ /**
10
+ * The Allow and Deny buttons, protected against clicks the user didn't mean for this page:
11
+ *
12
+ * - Inside a frame they aren't shown, so other sites can't frame the page and trick users into
13
+ * clicking them. The server can't tell, so they're missing until the browser has checked.
14
+ * - They're disabled until the page has been visible and focused for a moment. Otherwise another
15
+ * site could open the page under the user's cursor while they double-click something else, so
16
+ * the second click lands on Allow. Leaving the page disables them again. Waiting works for every
17
+ * way of clicking, unlike requiring a mouse movement or key press first.
18
+ *
19
+ * @see https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-17#section-7.11 for why the
20
+ * OAuth server must prevent clickjacking
21
+ * @see https://cheatsheetseries.owasp.org/cheatsheets/Clickjacking_Defense_Cheat_Sheet.html#defending-against-doubleclickjacking
22
+ * for the double-click attack and its mitigation
23
+ */ export function AllowButtons() {
24
+ const isTopLevel = useSyncExternalStore(subscribe, ()=>window.top === window.self, ()=>false);
25
+ const [isEnabled, setIsEnabled] = useState(false);
26
+ useEffect(()=>{
27
+ let timeout;
28
+ const enableAfterDelay = ()=>{
29
+ clearTimeout(timeout);
30
+ if (document.visibilityState === 'visible' && document.hasFocus()) {
31
+ timeout = setTimeout(()=>setIsEnabled(true), enableDelay);
32
+ }
33
+ };
34
+ const disable = ()=>{
35
+ clearTimeout(timeout);
36
+ setIsEnabled(false);
37
+ };
38
+ const onVisibilityChange = ()=>{
39
+ if (document.visibilityState === 'visible') {
40
+ enableAfterDelay();
41
+ } else {
42
+ disable();
43
+ }
44
+ };
45
+ enableAfterDelay();
46
+ window.addEventListener('focus', enableAfterDelay);
47
+ window.addEventListener('blur', disable);
48
+ document.addEventListener('visibilitychange', onVisibilityChange);
49
+ return ()=>{
50
+ clearTimeout(timeout);
51
+ window.removeEventListener('focus', enableAfterDelay);
52
+ window.removeEventListener('blur', disable);
53
+ document.removeEventListener('visibilitychange', onVisibilityChange);
54
+ };
55
+ }, []);
56
+ if (!isTopLevel) {
57
+ return null;
58
+ }
59
+ return /*#__PURE__*/ _jsxs("div", {
60
+ className: `${baseClass}__actions`,
61
+ children: [
62
+ /*#__PURE__*/ _jsx(Button, {
63
+ buttonStyle: "primary",
64
+ disabled: !isEnabled,
65
+ extraButtonProps: {
66
+ name: 'decision',
67
+ value: 'allow'
68
+ },
69
+ margin: false,
70
+ type: "submit",
71
+ children: "Allow"
72
+ }),
73
+ /*#__PURE__*/ _jsx(Button, {
74
+ buttonStyle: "secondary",
75
+ disabled: !isEnabled,
76
+ extraButtonProps: {
77
+ name: 'decision',
78
+ value: 'deny'
79
+ },
80
+ margin: false,
81
+ type: "submit",
82
+ children: "Deny"
83
+ })
84
+ ]
85
+ });
86
+ }
87
+
88
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/views/Authorize/AllowButtons/index.tsx"],"sourcesContent":["'use client'\n\nimport { Button } from '@payloadcms/ui'\nimport React, { useEffect, useState, useSyncExternalStore } from 'react'\n\nconst baseClass = 'mcp-authorize'\n\n/** How long the page must have been in front of the user before the buttons work, in ms. */\nconst enableDelay = 1000\n\n// Whether the page is inside a frame never changes, so there's nothing to subscribe to\nconst subscribe = () => () => {}\n\n/**\n * The Allow and Deny buttons, protected against clicks the user didn't mean for this page:\n *\n * - Inside a frame they aren't shown, so other sites can't frame the page and trick users into\n * clicking them. The server can't tell, so they're missing until the browser has checked.\n * - They're disabled until the page has been visible and focused for a moment. Otherwise another\n * site could open the page under the user's cursor while they double-click something else, so\n * the second click lands on Allow. Leaving the page disables them again. Waiting works for every\n * way of clicking, unlike requiring a mouse movement or key press first.\n *\n * @see https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-17#section-7.11 for why the\n * OAuth server must prevent clickjacking\n * @see https://cheatsheetseries.owasp.org/cheatsheets/Clickjacking_Defense_Cheat_Sheet.html#defending-against-doubleclickjacking\n * for the double-click attack and its mitigation\n */\nexport function AllowButtons() {\n const isTopLevel = useSyncExternalStore(\n subscribe,\n () => window.top === window.self,\n () => false,\n )\n const [isEnabled, setIsEnabled] = useState(false)\n\n useEffect(() => {\n let timeout: ReturnType<typeof setTimeout> | undefined\n\n const enableAfterDelay = () => {\n clearTimeout(timeout)\n if (document.visibilityState === 'visible' && document.hasFocus()) {\n timeout = setTimeout(() => setIsEnabled(true), enableDelay)\n }\n }\n const disable = () => {\n clearTimeout(timeout)\n setIsEnabled(false)\n }\n const onVisibilityChange = () => {\n if (document.visibilityState === 'visible') {\n enableAfterDelay()\n } else {\n disable()\n }\n }\n\n enableAfterDelay()\n window.addEventListener('focus', enableAfterDelay)\n window.addEventListener('blur', disable)\n document.addEventListener('visibilitychange', onVisibilityChange)\n\n return () => {\n clearTimeout(timeout)\n window.removeEventListener('focus', enableAfterDelay)\n window.removeEventListener('blur', disable)\n document.removeEventListener('visibilitychange', onVisibilityChange)\n }\n }, [])\n\n if (!isTopLevel) {\n return null\n }\n\n return (\n <div className={`${baseClass}__actions`}>\n <Button\n buttonStyle=\"primary\"\n disabled={!isEnabled}\n extraButtonProps={{ name: 'decision', value: 'allow' }}\n margin={false}\n type=\"submit\"\n >\n Allow\n </Button>\n <Button\n buttonStyle=\"secondary\"\n disabled={!isEnabled}\n extraButtonProps={{ name: 'decision', value: 'deny' }}\n margin={false}\n type=\"submit\"\n >\n Deny\n </Button>\n </div>\n )\n}\n"],"names":["Button","React","useEffect","useState","useSyncExternalStore","baseClass","enableDelay","subscribe","AllowButtons","isTopLevel","window","top","self","isEnabled","setIsEnabled","timeout","enableAfterDelay","clearTimeout","document","visibilityState","hasFocus","setTimeout","disable","onVisibilityChange","addEventListener","removeEventListener","div","className","buttonStyle","disabled","extraButtonProps","name","value","margin","type"],"mappings":"AAAA;;AAEA,SAASA,MAAM,QAAQ,iBAAgB;AACvC,OAAOC,SAASC,SAAS,EAAEC,QAAQ,EAAEC,oBAAoB,QAAQ,QAAO;AAExE,MAAMC,YAAY;AAElB,0FAA0F,GAC1F,MAAMC,cAAc;AAEpB,uFAAuF;AACvF,MAAMC,YAAY,IAAM,KAAO;AAE/B;;;;;;;;;;;;;;CAcC,GACD,OAAO,SAASC;IACd,MAAMC,aAAaL,qBACjBG,WACA,IAAMG,OAAOC,GAAG,KAAKD,OAAOE,IAAI,EAChC,IAAM;IAER,MAAM,CAACC,WAAWC,aAAa,GAAGX,SAAS;IAE3CD,UAAU;QACR,IAAIa;QAEJ,MAAMC,mBAAmB;YACvBC,aAAaF;YACb,IAAIG,SAASC,eAAe,KAAK,aAAaD,SAASE,QAAQ,IAAI;gBACjEL,UAAUM,WAAW,IAAMP,aAAa,OAAOR;YACjD;QACF;QACA,MAAMgB,UAAU;YACdL,aAAaF;YACbD,aAAa;QACf;QACA,MAAMS,qBAAqB;YACzB,IAAIL,SAASC,eAAe,KAAK,WAAW;gBAC1CH;YACF,OAAO;gBACLM;YACF;QACF;QAEAN;QACAN,OAAOc,gBAAgB,CAAC,SAASR;QACjCN,OAAOc,gBAAgB,CAAC,QAAQF;QAChCJ,SAASM,gBAAgB,CAAC,oBAAoBD;QAE9C,OAAO;YACLN,aAAaF;YACbL,OAAOe,mBAAmB,CAAC,SAAST;YACpCN,OAAOe,mBAAmB,CAAC,QAAQH;YACnCJ,SAASO,mBAAmB,CAAC,oBAAoBF;QACnD;IACF,GAAG,EAAE;IAEL,IAAI,CAACd,YAAY;QACf,OAAO;IACT;IAEA,qBACE,MAACiB;QAAIC,WAAW,GAAGtB,UAAU,SAAS,CAAC;;0BACrC,KAACL;gBACC4B,aAAY;gBACZC,UAAU,CAAChB;gBACXiB,kBAAkB;oBAAEC,MAAM;oBAAYC,OAAO;gBAAQ;gBACrDC,QAAQ;gBACRC,MAAK;0BACN;;0BAGD,KAAClC;gBACC4B,aAAY;gBACZC,UAAU,CAAChB;gBACXiB,kBAAkB;oBAAEC,MAAM;oBAAYC,OAAO;gBAAO;gBACpDC,QAAQ;gBACRC,MAAK;0BACN;;;;AAKP"}
@@ -0,0 +1,19 @@
1
+ @layer payload-default {
2
+ .mcp-authorize {
3
+ overflow-wrap: anywhere;
4
+ }
5
+
6
+ .mcp-authorize__brand {
7
+ display: flex;
8
+ justify-content: center;
9
+ width: 100%;
10
+ margin-block-end: var(--spacer-5);
11
+ }
12
+
13
+ .mcp-authorize__actions {
14
+ display: flex;
15
+ flex-wrap: wrap;
16
+ justify-content: center;
17
+ gap: var(--spacer-2);
18
+ }
19
+ }
@@ -0,0 +1,9 @@
1
+ import type { AdminViewServerProps } from 'payload';
2
+ import React from 'react';
3
+ import './index.css';
4
+ /**
5
+ * The admin page where users allow an MCP client to use their account, for the built-in OAuth
6
+ * server. Its authorize endpoint sends users here with the consent to show, or with an error.
7
+ */
8
+ export declare function MCPAuthorizeView({ initPageResult, params, searchParams, server, user, }: AdminViewServerProps): React.JSX.Element;
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/views/Authorize/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAInD,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,OAAO,aAAa,CAAA;AASpB;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,cAAc,EACd,MAAM,EACN,YAAY,EACZ,MAAM,EACN,IAAI,GACL,EAAE,oBAAoB,qBA2DtB"}