@modelcontextprotocol/sdk 1.18.2 → 1.20.0

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 (332) hide show
  1. package/README.md +1010 -824
  2. package/dist/cjs/cli.js +35 -37
  3. package/dist/cjs/cli.js.map +1 -1
  4. package/dist/cjs/client/auth.d.ts +12 -12
  5. package/dist/cjs/client/auth.d.ts.map +1 -1
  6. package/dist/cjs/client/auth.js +81 -93
  7. package/dist/cjs/client/auth.js.map +1 -1
  8. package/dist/cjs/client/index.d.ts +186 -123
  9. package/dist/cjs/client/index.d.ts.map +1 -1
  10. package/dist/cjs/client/index.js +40 -41
  11. package/dist/cjs/client/index.js.map +1 -1
  12. package/dist/cjs/client/middleware.d.ts +2 -2
  13. package/dist/cjs/client/middleware.d.ts.map +1 -1
  14. package/dist/cjs/client/middleware.js +22 -27
  15. package/dist/cjs/client/middleware.js.map +1 -1
  16. package/dist/cjs/client/sse.d.ts +4 -4
  17. package/dist/cjs/client/sse.d.ts.map +1 -1
  18. package/dist/cjs/client/sse.js +34 -21
  19. package/dist/cjs/client/sse.js.map +1 -1
  20. package/dist/cjs/client/stdio.d.ts +4 -4
  21. package/dist/cjs/client/stdio.d.ts.map +1 -1
  22. package/dist/cjs/client/stdio.js +32 -32
  23. package/dist/cjs/client/stdio.js.map +1 -1
  24. package/dist/cjs/client/streamableHttp.d.ts +7 -6
  25. package/dist/cjs/client/streamableHttp.d.ts.map +1 -1
  26. package/dist/cjs/client/streamableHttp.js +55 -38
  27. package/dist/cjs/client/streamableHttp.js.map +1 -1
  28. package/dist/cjs/client/websocket.d.ts +2 -2
  29. package/dist/cjs/client/websocket.d.ts.map +1 -1
  30. package/dist/cjs/client/websocket.js +5 -7
  31. package/dist/cjs/client/websocket.js.map +1 -1
  32. package/dist/cjs/examples/client/multipleClientsParallel.js +2 -2
  33. package/dist/cjs/examples/client/multipleClientsParallel.js.map +1 -1
  34. package/dist/cjs/examples/client/parallelToolCallsClient.js +6 -5
  35. package/dist/cjs/examples/client/parallelToolCallsClient.js.map +1 -1
  36. package/dist/cjs/examples/client/simpleOAuthClient.js +15 -13
  37. package/dist/cjs/examples/client/simpleOAuthClient.js.map +1 -1
  38. package/dist/cjs/examples/client/simpleStreamableHttp.js +15 -11
  39. package/dist/cjs/examples/client/simpleStreamableHttp.js.map +1 -1
  40. package/dist/cjs/examples/client/streamableHttpWithSseFallbackClient.js +2 -2
  41. package/dist/cjs/examples/client/streamableHttpWithSseFallbackClient.js.map +1 -1
  42. package/dist/cjs/examples/server/demoInMemoryOAuthProvider.d.ts +1 -1
  43. package/dist/cjs/examples/server/demoInMemoryOAuthProvider.d.ts.map +1 -1
  44. package/dist/cjs/examples/server/demoInMemoryOAuthProvider.js +18 -16
  45. package/dist/cjs/examples/server/demoInMemoryOAuthProvider.js.map +1 -1
  46. package/dist/cjs/examples/server/jsonResponseStreamableHttp.js +18 -18
  47. package/dist/cjs/examples/server/jsonResponseStreamableHttp.js.map +1 -1
  48. package/dist/cjs/examples/server/mcpServerOutputSchema.js +19 -17
  49. package/dist/cjs/examples/server/mcpServerOutputSchema.js.map +1 -1
  50. package/dist/cjs/examples/server/simpleSseServer.js +8 -8
  51. package/dist/cjs/examples/server/simpleSseServer.js.map +1 -1
  52. package/dist/cjs/examples/server/simpleStatelessStreamableHttp.js +22 -22
  53. package/dist/cjs/examples/server/simpleStatelessStreamableHttp.js.map +1 -1
  54. package/dist/cjs/examples/server/simpleStreamableHttp.js +78 -78
  55. package/dist/cjs/examples/server/simpleStreamableHttp.js.map +1 -1
  56. package/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.js +18 -18
  57. package/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.js.map +1 -1
  58. package/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.js +8 -8
  59. package/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.js.map +1 -1
  60. package/dist/cjs/examples/server/toolWithSampleServer.js +19 -19
  61. package/dist/cjs/examples/server/toolWithSampleServer.js.map +1 -1
  62. package/dist/cjs/examples/shared/inMemoryEventStore.d.ts.map +1 -1
  63. package/dist/cjs/examples/shared/inMemoryEventStore.js.map +1 -1
  64. package/dist/cjs/inMemory.d.ts +3 -3
  65. package/dist/cjs/inMemory.d.ts.map +1 -1
  66. package/dist/cjs/inMemory.js +1 -1
  67. package/dist/cjs/inMemory.js.map +1 -1
  68. package/dist/cjs/server/auth/clients.d.ts +2 -2
  69. package/dist/cjs/server/auth/clients.d.ts.map +1 -1
  70. package/dist/cjs/server/auth/errors.d.ts +1 -1
  71. package/dist/cjs/server/auth/errors.d.ts.map +1 -1
  72. package/dist/cjs/server/auth/errors.js +17 -17
  73. package/dist/cjs/server/auth/errors.js.map +1 -1
  74. package/dist/cjs/server/auth/handlers/authorize.d.ts +3 -3
  75. package/dist/cjs/server/auth/handlers/authorize.d.ts.map +1 -1
  76. package/dist/cjs/server/auth/handlers/authorize.js +21 -18
  77. package/dist/cjs/server/auth/handlers/authorize.js.map +1 -1
  78. package/dist/cjs/server/auth/handlers/metadata.d.ts +2 -2
  79. package/dist/cjs/server/auth/handlers/metadata.js +1 -1
  80. package/dist/cjs/server/auth/handlers/metadata.js.map +1 -1
  81. package/dist/cjs/server/auth/handlers/register.d.ts +4 -4
  82. package/dist/cjs/server/auth/handlers/register.d.ts.map +1 -1
  83. package/dist/cjs/server/auth/handlers/register.js +7 -9
  84. package/dist/cjs/server/auth/handlers/register.js.map +1 -1
  85. package/dist/cjs/server/auth/handlers/revoke.d.ts +4 -4
  86. package/dist/cjs/server/auth/handlers/revoke.d.ts.map +1 -1
  87. package/dist/cjs/server/auth/handlers/revoke.js +9 -9
  88. package/dist/cjs/server/auth/handlers/revoke.js.map +1 -1
  89. package/dist/cjs/server/auth/handlers/token.d.ts +3 -3
  90. package/dist/cjs/server/auth/handlers/token.d.ts.map +1 -1
  91. package/dist/cjs/server/auth/handlers/token.js +14 -14
  92. package/dist/cjs/server/auth/handlers/token.js.map +1 -1
  93. package/dist/cjs/server/auth/middleware/allowedMethods.d.ts +1 -1
  94. package/dist/cjs/server/auth/middleware/allowedMethods.d.ts.map +1 -1
  95. package/dist/cjs/server/auth/middleware/allowedMethods.js +1 -3
  96. package/dist/cjs/server/auth/middleware/allowedMethods.js.map +1 -1
  97. package/dist/cjs/server/auth/middleware/bearerAuth.d.ts +4 -4
  98. package/dist/cjs/server/auth/middleware/bearerAuth.d.ts.map +1 -1
  99. package/dist/cjs/server/auth/middleware/bearerAuth.js +7 -7
  100. package/dist/cjs/server/auth/middleware/bearerAuth.js.map +1 -1
  101. package/dist/cjs/server/auth/middleware/clientAuth.d.ts +4 -4
  102. package/dist/cjs/server/auth/middleware/clientAuth.d.ts.map +1 -1
  103. package/dist/cjs/server/auth/middleware/clientAuth.js +6 -6
  104. package/dist/cjs/server/auth/middleware/clientAuth.js.map +1 -1
  105. package/dist/cjs/server/auth/provider.d.ts +4 -4
  106. package/dist/cjs/server/auth/provider.d.ts.map +1 -1
  107. package/dist/cjs/server/auth/providers/proxyProvider.d.ts +10 -10
  108. package/dist/cjs/server/auth/providers/proxyProvider.d.ts.map +1 -1
  109. package/dist/cjs/server/auth/providers/proxyProvider.js +34 -34
  110. package/dist/cjs/server/auth/providers/proxyProvider.js.map +1 -1
  111. package/dist/cjs/server/auth/router.d.ts +11 -11
  112. package/dist/cjs/server/auth/router.d.ts.map +1 -1
  113. package/dist/cjs/server/auth/router.js +16 -18
  114. package/dist/cjs/server/auth/router.js.map +1 -1
  115. package/dist/cjs/server/auth/types.d.ts +1 -1
  116. package/dist/cjs/server/auth/types.d.ts.map +1 -1
  117. package/dist/cjs/server/completable.d.ts +5 -5
  118. package/dist/cjs/server/completable.d.ts.map +1 -1
  119. package/dist/cjs/server/completable.js +5 -5
  120. package/dist/cjs/server/completable.js.map +1 -1
  121. package/dist/cjs/server/index.d.ts +9 -9
  122. package/dist/cjs/server/index.d.ts.map +1 -1
  123. package/dist/cjs/server/index.js +38 -42
  124. package/dist/cjs/server/index.js.map +1 -1
  125. package/dist/cjs/server/mcp.d.ts +8 -8
  126. package/dist/cjs/server/mcp.d.ts.map +1 -1
  127. package/dist/cjs/server/mcp.js +87 -82
  128. package/dist/cjs/server/mcp.js.map +1 -1
  129. package/dist/cjs/server/sse.d.ts +4 -4
  130. package/dist/cjs/server/sse.d.ts.map +1 -1
  131. package/dist/cjs/server/sse.js +16 -15
  132. package/dist/cjs/server/sse.js.map +1 -1
  133. package/dist/cjs/server/stdio.d.ts +3 -3
  134. package/dist/cjs/server/stdio.d.ts.map +1 -1
  135. package/dist/cjs/server/stdio.js +7 -7
  136. package/dist/cjs/server/stdio.js.map +1 -1
  137. package/dist/cjs/server/streamableHttp.d.ts +5 -5
  138. package/dist/cjs/server/streamableHttp.d.ts.map +1 -1
  139. package/dist/cjs/server/streamableHttp.js +63 -64
  140. package/dist/cjs/server/streamableHttp.js.map +1 -1
  141. package/dist/cjs/shared/auth-utils.d.ts.map +1 -1
  142. package/dist/cjs/shared/auth-utils.js +3 -3
  143. package/dist/cjs/shared/auth-utils.js.map +1 -1
  144. package/dist/cjs/shared/auth.d.ts +1 -1
  145. package/dist/cjs/shared/auth.d.ts.map +1 -1
  146. package/dist/cjs/shared/auth.js +42 -46
  147. package/dist/cjs/shared/auth.js.map +1 -1
  148. package/dist/cjs/shared/metadataUtils.d.ts +1 -1
  149. package/dist/cjs/shared/metadataUtils.js.map +1 -1
  150. package/dist/cjs/shared/protocol.d.ts +6 -6
  151. package/dist/cjs/shared/protocol.d.ts.map +1 -1
  152. package/dist/cjs/shared/protocol.js +42 -43
  153. package/dist/cjs/shared/protocol.js.map +1 -1
  154. package/dist/cjs/shared/stdio.d.ts +1 -1
  155. package/dist/cjs/shared/stdio.d.ts.map +1 -1
  156. package/dist/cjs/shared/stdio.js +3 -3
  157. package/dist/cjs/shared/stdio.js.map +1 -1
  158. package/dist/cjs/shared/transport.d.ts +1 -1
  159. package/dist/cjs/shared/transport.d.ts.map +1 -1
  160. package/dist/cjs/shared/uriTemplate.d.ts.map +1 -1
  161. package/dist/cjs/shared/uriTemplate.js +69 -71
  162. package/dist/cjs/shared/uriTemplate.js.map +1 -1
  163. package/dist/cjs/types.d.ts +9650 -4790
  164. package/dist/cjs/types.d.ts.map +1 -1
  165. package/dist/cjs/types.js +199 -234
  166. package/dist/cjs/types.js.map +1 -1
  167. package/dist/esm/cli.js +45 -47
  168. package/dist/esm/cli.js.map +1 -1
  169. package/dist/esm/client/auth.d.ts +12 -12
  170. package/dist/esm/client/auth.d.ts.map +1 -1
  171. package/dist/esm/client/auth.js +87 -99
  172. package/dist/esm/client/auth.js.map +1 -1
  173. package/dist/esm/client/index.d.ts +186 -123
  174. package/dist/esm/client/index.d.ts.map +1 -1
  175. package/dist/esm/client/index.js +43 -44
  176. package/dist/esm/client/index.js.map +1 -1
  177. package/dist/esm/client/middleware.d.ts +2 -2
  178. package/dist/esm/client/middleware.d.ts.map +1 -1
  179. package/dist/esm/client/middleware.js +23 -28
  180. package/dist/esm/client/middleware.js.map +1 -1
  181. package/dist/esm/client/sse.d.ts +4 -4
  182. package/dist/esm/client/sse.d.ts.map +1 -1
  183. package/dist/esm/client/sse.js +37 -24
  184. package/dist/esm/client/sse.js.map +1 -1
  185. package/dist/esm/client/stdio.d.ts +4 -4
  186. package/dist/esm/client/stdio.d.ts.map +1 -1
  187. package/dist/esm/client/stdio.js +36 -36
  188. package/dist/esm/client/stdio.js.map +1 -1
  189. package/dist/esm/client/streamableHttp.d.ts +7 -6
  190. package/dist/esm/client/streamableHttp.d.ts.map +1 -1
  191. package/dist/esm/client/streamableHttp.js +58 -41
  192. package/dist/esm/client/streamableHttp.js.map +1 -1
  193. package/dist/esm/client/websocket.d.ts +2 -2
  194. package/dist/esm/client/websocket.d.ts.map +1 -1
  195. package/dist/esm/client/websocket.js +6 -8
  196. package/dist/esm/client/websocket.js.map +1 -1
  197. package/dist/esm/examples/client/multipleClientsParallel.js +3 -3
  198. package/dist/esm/examples/client/multipleClientsParallel.js.map +1 -1
  199. package/dist/esm/examples/client/parallelToolCallsClient.js +7 -6
  200. package/dist/esm/examples/client/parallelToolCallsClient.js.map +1 -1
  201. package/dist/esm/examples/client/simpleOAuthClient.js +15 -13
  202. package/dist/esm/examples/client/simpleOAuthClient.js.map +1 -1
  203. package/dist/esm/examples/client/simpleStreamableHttp.js +17 -13
  204. package/dist/esm/examples/client/simpleStreamableHttp.js.map +1 -1
  205. package/dist/esm/examples/client/streamableHttpWithSseFallbackClient.js +3 -3
  206. package/dist/esm/examples/client/streamableHttpWithSseFallbackClient.js.map +1 -1
  207. package/dist/esm/examples/server/demoInMemoryOAuthProvider.d.ts +1 -1
  208. package/dist/esm/examples/server/demoInMemoryOAuthProvider.d.ts.map +1 -1
  209. package/dist/esm/examples/server/demoInMemoryOAuthProvider.js +19 -17
  210. package/dist/esm/examples/server/demoInMemoryOAuthProvider.js.map +1 -1
  211. package/dist/esm/examples/server/jsonResponseStreamableHttp.js +18 -18
  212. package/dist/esm/examples/server/jsonResponseStreamableHttp.js.map +1 -1
  213. package/dist/esm/examples/server/mcpServerOutputSchema.js +22 -20
  214. package/dist/esm/examples/server/mcpServerOutputSchema.js.map +1 -1
  215. package/dist/esm/examples/server/simpleSseServer.js +8 -8
  216. package/dist/esm/examples/server/simpleSseServer.js.map +1 -1
  217. package/dist/esm/examples/server/simpleStatelessStreamableHttp.js +22 -22
  218. package/dist/esm/examples/server/simpleStatelessStreamableHttp.js.map +1 -1
  219. package/dist/esm/examples/server/simpleStreamableHttp.js +78 -78
  220. package/dist/esm/examples/server/simpleStreamableHttp.js.map +1 -1
  221. package/dist/esm/examples/server/sseAndStreamableHttpCompatibleServer.js +19 -19
  222. package/dist/esm/examples/server/sseAndStreamableHttpCompatibleServer.js.map +1 -1
  223. package/dist/esm/examples/server/standaloneSseWithGetStreamableHttp.js +8 -8
  224. package/dist/esm/examples/server/standaloneSseWithGetStreamableHttp.js.map +1 -1
  225. package/dist/esm/examples/server/toolWithSampleServer.js +22 -22
  226. package/dist/esm/examples/server/toolWithSampleServer.js.map +1 -1
  227. package/dist/esm/examples/shared/inMemoryEventStore.d.ts.map +1 -1
  228. package/dist/esm/examples/shared/inMemoryEventStore.js.map +1 -1
  229. package/dist/esm/inMemory.d.ts +3 -3
  230. package/dist/esm/inMemory.d.ts.map +1 -1
  231. package/dist/esm/inMemory.js +1 -1
  232. package/dist/esm/inMemory.js.map +1 -1
  233. package/dist/esm/server/auth/clients.d.ts +2 -2
  234. package/dist/esm/server/auth/clients.d.ts.map +1 -1
  235. package/dist/esm/server/auth/errors.d.ts +1 -1
  236. package/dist/esm/server/auth/errors.d.ts.map +1 -1
  237. package/dist/esm/server/auth/errors.js +17 -17
  238. package/dist/esm/server/auth/errors.js.map +1 -1
  239. package/dist/esm/server/auth/handlers/authorize.d.ts +3 -3
  240. package/dist/esm/server/auth/handlers/authorize.d.ts.map +1 -1
  241. package/dist/esm/server/auth/handlers/authorize.js +26 -23
  242. package/dist/esm/server/auth/handlers/authorize.js.map +1 -1
  243. package/dist/esm/server/auth/handlers/metadata.d.ts +2 -2
  244. package/dist/esm/server/auth/handlers/metadata.js +3 -3
  245. package/dist/esm/server/auth/handlers/metadata.js.map +1 -1
  246. package/dist/esm/server/auth/handlers/register.d.ts +4 -4
  247. package/dist/esm/server/auth/handlers/register.d.ts.map +1 -1
  248. package/dist/esm/server/auth/handlers/register.js +12 -14
  249. package/dist/esm/server/auth/handlers/register.js.map +1 -1
  250. package/dist/esm/server/auth/handlers/revoke.d.ts +4 -4
  251. package/dist/esm/server/auth/handlers/revoke.d.ts.map +1 -1
  252. package/dist/esm/server/auth/handlers/revoke.js +16 -16
  253. package/dist/esm/server/auth/handlers/revoke.js.map +1 -1
  254. package/dist/esm/server/auth/handlers/token.d.ts +3 -3
  255. package/dist/esm/server/auth/handlers/token.d.ts.map +1 -1
  256. package/dist/esm/server/auth/handlers/token.js +22 -22
  257. package/dist/esm/server/auth/handlers/token.js.map +1 -1
  258. package/dist/esm/server/auth/middleware/allowedMethods.d.ts +1 -1
  259. package/dist/esm/server/auth/middleware/allowedMethods.d.ts.map +1 -1
  260. package/dist/esm/server/auth/middleware/allowedMethods.js +2 -4
  261. package/dist/esm/server/auth/middleware/allowedMethods.js.map +1 -1
  262. package/dist/esm/server/auth/middleware/bearerAuth.d.ts +4 -4
  263. package/dist/esm/server/auth/middleware/bearerAuth.d.ts.map +1 -1
  264. package/dist/esm/server/auth/middleware/bearerAuth.js +8 -8
  265. package/dist/esm/server/auth/middleware/bearerAuth.js.map +1 -1
  266. package/dist/esm/server/auth/middleware/clientAuth.d.ts +4 -4
  267. package/dist/esm/server/auth/middleware/clientAuth.d.ts.map +1 -1
  268. package/dist/esm/server/auth/middleware/clientAuth.js +8 -8
  269. package/dist/esm/server/auth/middleware/clientAuth.js.map +1 -1
  270. package/dist/esm/server/auth/provider.d.ts +4 -4
  271. package/dist/esm/server/auth/provider.d.ts.map +1 -1
  272. package/dist/esm/server/auth/providers/proxyProvider.d.ts +10 -10
  273. package/dist/esm/server/auth/providers/proxyProvider.d.ts.map +1 -1
  274. package/dist/esm/server/auth/providers/proxyProvider.js +36 -36
  275. package/dist/esm/server/auth/providers/proxyProvider.js.map +1 -1
  276. package/dist/esm/server/auth/router.d.ts +11 -11
  277. package/dist/esm/server/auth/router.d.ts.map +1 -1
  278. package/dist/esm/server/auth/router.js +22 -24
  279. package/dist/esm/server/auth/router.js.map +1 -1
  280. package/dist/esm/server/auth/types.d.ts +1 -1
  281. package/dist/esm/server/auth/types.d.ts.map +1 -1
  282. package/dist/esm/server/completable.d.ts +5 -5
  283. package/dist/esm/server/completable.d.ts.map +1 -1
  284. package/dist/esm/server/completable.js +6 -6
  285. package/dist/esm/server/completable.js.map +1 -1
  286. package/dist/esm/server/index.d.ts +9 -9
  287. package/dist/esm/server/index.d.ts.map +1 -1
  288. package/dist/esm/server/index.js +41 -45
  289. package/dist/esm/server/index.js.map +1 -1
  290. package/dist/esm/server/mcp.d.ts +8 -8
  291. package/dist/esm/server/mcp.d.ts.map +1 -1
  292. package/dist/esm/server/mcp.js +93 -88
  293. package/dist/esm/server/mcp.js.map +1 -1
  294. package/dist/esm/server/sse.d.ts +4 -4
  295. package/dist/esm/server/sse.d.ts.map +1 -1
  296. package/dist/esm/server/sse.js +20 -19
  297. package/dist/esm/server/sse.js.map +1 -1
  298. package/dist/esm/server/stdio.d.ts +3 -3
  299. package/dist/esm/server/stdio.d.ts.map +1 -1
  300. package/dist/esm/server/stdio.js +9 -9
  301. package/dist/esm/server/stdio.js.map +1 -1
  302. package/dist/esm/server/streamableHttp.d.ts +5 -5
  303. package/dist/esm/server/streamableHttp.d.ts.map +1 -1
  304. package/dist/esm/server/streamableHttp.js +67 -68
  305. package/dist/esm/server/streamableHttp.js.map +1 -1
  306. package/dist/esm/shared/auth-utils.d.ts.map +1 -1
  307. package/dist/esm/shared/auth-utils.js +3 -3
  308. package/dist/esm/shared/auth-utils.js.map +1 -1
  309. package/dist/esm/shared/auth.d.ts +1 -1
  310. package/dist/esm/shared/auth.d.ts.map +1 -1
  311. package/dist/esm/shared/auth.js +43 -47
  312. package/dist/esm/shared/auth.js.map +1 -1
  313. package/dist/esm/shared/metadataUtils.d.ts +1 -1
  314. package/dist/esm/shared/metadataUtils.js.map +1 -1
  315. package/dist/esm/shared/protocol.d.ts +6 -6
  316. package/dist/esm/shared/protocol.d.ts.map +1 -1
  317. package/dist/esm/shared/protocol.js +43 -44
  318. package/dist/esm/shared/protocol.js.map +1 -1
  319. package/dist/esm/shared/stdio.d.ts +1 -1
  320. package/dist/esm/shared/stdio.d.ts.map +1 -1
  321. package/dist/esm/shared/stdio.js +4 -4
  322. package/dist/esm/shared/stdio.js.map +1 -1
  323. package/dist/esm/shared/transport.d.ts +1 -1
  324. package/dist/esm/shared/transport.d.ts.map +1 -1
  325. package/dist/esm/shared/uriTemplate.d.ts.map +1 -1
  326. package/dist/esm/shared/uriTemplate.js +69 -71
  327. package/dist/esm/shared/uriTemplate.js.map +1 -1
  328. package/dist/esm/types.d.ts +9650 -4790
  329. package/dist/esm/types.d.ts.map +1 -1
  330. package/dist/esm/types.js +197 -232
  331. package/dist/esm/types.js.map +1 -1
  332. package/package.json +101 -98
package/dist/cjs/types.js CHANGED
@@ -1,19 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SubscribeRequestSchema = exports.ResourceListChangedNotificationSchema = exports.ReadResourceResultSchema = exports.ReadResourceRequestSchema = exports.ListResourceTemplatesResultSchema = exports.ListResourceTemplatesRequestSchema = exports.ListResourcesResultSchema = exports.ListResourcesRequestSchema = exports.ResourceTemplateSchema = exports.ResourceSchema = exports.BlobResourceContentsSchema = exports.TextResourceContentsSchema = exports.ResourceContentsSchema = exports.PaginatedResultSchema = exports.PaginatedRequestSchema = exports.ProgressNotificationSchema = exports.ProgressSchema = exports.PingRequestSchema = exports.isInitializedNotification = exports.InitializedNotificationSchema = exports.InitializeResultSchema = exports.ServerCapabilitiesSchema = exports.isInitializeRequest = exports.InitializeRequestSchema = exports.ClientCapabilitiesSchema = exports.ImplementationSchema = exports.BaseMetadataSchema = exports.IconSchema = exports.CancelledNotificationSchema = exports.EmptyResultSchema = exports.JSONRPCMessageSchema = exports.isJSONRPCError = exports.JSONRPCErrorSchema = exports.ErrorCode = exports.isJSONRPCResponse = exports.JSONRPCResponseSchema = exports.isJSONRPCNotification = exports.JSONRPCNotificationSchema = exports.isJSONRPCRequest = exports.JSONRPCRequestSchema = exports.RequestIdSchema = exports.ResultSchema = exports.NotificationSchema = exports.RequestSchema = exports.CursorSchema = exports.ProgressTokenSchema = exports.JSONRPC_VERSION = exports.SUPPORTED_PROTOCOL_VERSIONS = exports.DEFAULT_NEGOTIATED_PROTOCOL_VERSION = exports.LATEST_PROTOCOL_VERSION = void 0;
4
- exports.ClientNotificationSchema = exports.ClientRequestSchema = exports.RootsListChangedNotificationSchema = exports.ListRootsResultSchema = exports.ListRootsRequestSchema = exports.RootSchema = exports.CompleteResultSchema = exports.CompleteRequestSchema = exports.PromptReferenceSchema = exports.ResourceReferenceSchema = exports.ResourceTemplateReferenceSchema = exports.ElicitResultSchema = exports.ElicitRequestSchema = exports.PrimitiveSchemaDefinitionSchema = exports.EnumSchemaSchema = exports.NumberSchemaSchema = exports.StringSchemaSchema = exports.BooleanSchemaSchema = exports.CreateMessageResultSchema = exports.CreateMessageRequestSchema = exports.SamplingMessageSchema = exports.ModelPreferencesSchema = exports.ModelHintSchema = exports.LoggingMessageNotificationSchema = exports.SetLevelRequestSchema = exports.LoggingLevelSchema = exports.ToolListChangedNotificationSchema = exports.CallToolRequestSchema = exports.CompatibilityCallToolResultSchema = exports.CallToolResultSchema = exports.ListToolsResultSchema = exports.ListToolsRequestSchema = exports.ToolSchema = exports.ToolAnnotationsSchema = exports.PromptListChangedNotificationSchema = exports.GetPromptResultSchema = exports.PromptMessageSchema = exports.ContentBlockSchema = exports.ResourceLinkSchema = exports.EmbeddedResourceSchema = exports.AudioContentSchema = exports.ImageContentSchema = exports.TextContentSchema = exports.GetPromptRequestSchema = exports.ListPromptsResultSchema = exports.ListPromptsRequestSchema = exports.PromptSchema = exports.PromptArgumentSchema = exports.ResourceUpdatedNotificationSchema = exports.UnsubscribeRequestSchema = void 0;
5
- exports.McpError = exports.ServerResultSchema = exports.ServerNotificationSchema = exports.ServerRequestSchema = exports.ClientResultSchema = void 0;
3
+ exports.ResourceListChangedNotificationSchema = exports.ReadResourceResultSchema = exports.ReadResourceRequestSchema = exports.ListResourceTemplatesResultSchema = exports.ListResourceTemplatesRequestSchema = exports.ListResourcesResultSchema = exports.ListResourcesRequestSchema = exports.ResourceTemplateSchema = exports.ResourceSchema = exports.BlobResourceContentsSchema = exports.TextResourceContentsSchema = exports.ResourceContentsSchema = exports.PaginatedResultSchema = exports.PaginatedRequestSchema = exports.ProgressNotificationSchema = exports.ProgressSchema = exports.PingRequestSchema = exports.isInitializedNotification = exports.InitializedNotificationSchema = exports.InitializeResultSchema = exports.ServerCapabilitiesSchema = exports.isInitializeRequest = exports.InitializeRequestSchema = exports.ClientCapabilitiesSchema = exports.ImplementationSchema = exports.BaseMetadataSchema = exports.IconsSchema = exports.IconSchema = exports.CancelledNotificationSchema = exports.EmptyResultSchema = exports.JSONRPCMessageSchema = exports.isJSONRPCError = exports.JSONRPCErrorSchema = exports.ErrorCode = exports.isJSONRPCResponse = exports.JSONRPCResponseSchema = exports.isJSONRPCNotification = exports.JSONRPCNotificationSchema = exports.isJSONRPCRequest = exports.JSONRPCRequestSchema = exports.RequestIdSchema = exports.ResultSchema = exports.NotificationSchema = exports.RequestSchema = exports.CursorSchema = exports.ProgressTokenSchema = exports.JSONRPC_VERSION = exports.SUPPORTED_PROTOCOL_VERSIONS = exports.DEFAULT_NEGOTIATED_PROTOCOL_VERSION = exports.LATEST_PROTOCOL_VERSION = void 0;
4
+ exports.ClientRequestSchema = exports.RootsListChangedNotificationSchema = exports.ListRootsResultSchema = exports.ListRootsRequestSchema = exports.RootSchema = exports.CompleteResultSchema = exports.CompleteRequestSchema = exports.PromptReferenceSchema = exports.ResourceReferenceSchema = exports.ResourceTemplateReferenceSchema = exports.ElicitResultSchema = exports.ElicitRequestSchema = exports.PrimitiveSchemaDefinitionSchema = exports.EnumSchemaSchema = exports.NumberSchemaSchema = exports.StringSchemaSchema = exports.BooleanSchemaSchema = exports.CreateMessageResultSchema = exports.CreateMessageRequestSchema = exports.SamplingMessageSchema = exports.ModelPreferencesSchema = exports.ModelHintSchema = exports.LoggingMessageNotificationSchema = exports.SetLevelRequestSchema = exports.LoggingLevelSchema = exports.ToolListChangedNotificationSchema = exports.CallToolRequestSchema = exports.CompatibilityCallToolResultSchema = exports.CallToolResultSchema = exports.ListToolsResultSchema = exports.ListToolsRequestSchema = exports.ToolSchema = exports.ToolAnnotationsSchema = exports.PromptListChangedNotificationSchema = exports.GetPromptResultSchema = exports.PromptMessageSchema = exports.ContentBlockSchema = exports.ResourceLinkSchema = exports.EmbeddedResourceSchema = exports.AudioContentSchema = exports.ImageContentSchema = exports.TextContentSchema = exports.GetPromptRequestSchema = exports.ListPromptsResultSchema = exports.ListPromptsRequestSchema = exports.PromptSchema = exports.PromptArgumentSchema = exports.ResourceUpdatedNotificationSchema = exports.UnsubscribeRequestSchema = exports.SubscribeRequestSchema = void 0;
5
+ exports.McpError = exports.ServerResultSchema = exports.ServerNotificationSchema = exports.ServerRequestSchema = exports.ClientResultSchema = exports.ClientNotificationSchema = void 0;
6
6
  const zod_1 = require("zod");
7
- exports.LATEST_PROTOCOL_VERSION = "2025-06-18";
8
- exports.DEFAULT_NEGOTIATED_PROTOCOL_VERSION = "2025-03-26";
9
- exports.SUPPORTED_PROTOCOL_VERSIONS = [
10
- exports.LATEST_PROTOCOL_VERSION,
11
- "2025-03-26",
12
- "2024-11-05",
13
- "2024-10-07",
14
- ];
7
+ exports.LATEST_PROTOCOL_VERSION = '2025-06-18';
8
+ exports.DEFAULT_NEGOTIATED_PROTOCOL_VERSION = '2025-03-26';
9
+ exports.SUPPORTED_PROTOCOL_VERSIONS = [exports.LATEST_PROTOCOL_VERSION, '2025-03-26', '2024-11-05', '2024-10-07'];
15
10
  /* JSON-RPC types */
16
- exports.JSONRPC_VERSION = "2.0";
11
+ exports.JSONRPC_VERSION = '2.0';
17
12
  /**
18
13
  * A progress token, used to associate progress notifications with the original request.
19
14
  */
@@ -27,17 +22,17 @@ const RequestMetaSchema = zod_1.z
27
22
  /**
28
23
  * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.
29
24
  */
30
- progressToken: zod_1.z.optional(exports.ProgressTokenSchema),
25
+ progressToken: zod_1.z.optional(exports.ProgressTokenSchema)
31
26
  })
32
27
  .passthrough();
33
28
  const BaseRequestParamsSchema = zod_1.z
34
29
  .object({
35
- _meta: zod_1.z.optional(RequestMetaSchema),
30
+ _meta: zod_1.z.optional(RequestMetaSchema)
36
31
  })
37
32
  .passthrough();
38
33
  exports.RequestSchema = zod_1.z.object({
39
34
  method: zod_1.z.string(),
40
- params: zod_1.z.optional(BaseRequestParamsSchema),
35
+ params: zod_1.z.optional(BaseRequestParamsSchema)
41
36
  });
42
37
  const BaseNotificationParamsSchema = zod_1.z
43
38
  .object({
@@ -45,12 +40,12 @@ const BaseNotificationParamsSchema = zod_1.z
45
40
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
46
41
  * for notes on _meta usage.
47
42
  */
48
- _meta: zod_1.z.optional(zod_1.z.object({}).passthrough()),
43
+ _meta: zod_1.z.optional(zod_1.z.object({}).passthrough())
49
44
  })
50
45
  .passthrough();
51
46
  exports.NotificationSchema = zod_1.z.object({
52
47
  method: zod_1.z.string(),
53
- params: zod_1.z.optional(BaseNotificationParamsSchema),
48
+ params: zod_1.z.optional(BaseNotificationParamsSchema)
54
49
  });
55
50
  exports.ResultSchema = zod_1.z
56
51
  .object({
@@ -58,7 +53,7 @@ exports.ResultSchema = zod_1.z
58
53
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
59
54
  * for notes on _meta usage.
60
55
  */
61
- _meta: zod_1.z.optional(zod_1.z.object({}).passthrough()),
56
+ _meta: zod_1.z.optional(zod_1.z.object({}).passthrough())
62
57
  })
63
58
  .passthrough();
64
59
  /**
@@ -71,7 +66,7 @@ exports.RequestIdSchema = zod_1.z.union([zod_1.z.string(), zod_1.z.number().int(
71
66
  exports.JSONRPCRequestSchema = zod_1.z
72
67
  .object({
73
68
  jsonrpc: zod_1.z.literal(exports.JSONRPC_VERSION),
74
- id: exports.RequestIdSchema,
69
+ id: exports.RequestIdSchema
75
70
  })
76
71
  .merge(exports.RequestSchema)
77
72
  .strict();
@@ -82,7 +77,7 @@ exports.isJSONRPCRequest = isJSONRPCRequest;
82
77
  */
83
78
  exports.JSONRPCNotificationSchema = zod_1.z
84
79
  .object({
85
- jsonrpc: zod_1.z.literal(exports.JSONRPC_VERSION),
80
+ jsonrpc: zod_1.z.literal(exports.JSONRPC_VERSION)
86
81
  })
87
82
  .merge(exports.NotificationSchema)
88
83
  .strict();
@@ -95,7 +90,7 @@ exports.JSONRPCResponseSchema = zod_1.z
95
90
  .object({
96
91
  jsonrpc: zod_1.z.literal(exports.JSONRPC_VERSION),
97
92
  id: exports.RequestIdSchema,
98
- result: exports.ResultSchema,
93
+ result: exports.ResultSchema
99
94
  })
100
95
  .strict();
101
96
  const isJSONRPCResponse = (value) => exports.JSONRPCResponseSchema.safeParse(value).success;
@@ -134,18 +129,13 @@ exports.JSONRPCErrorSchema = zod_1.z
134
129
  /**
135
130
  * Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).
136
131
  */
137
- data: zod_1.z.optional(zod_1.z.unknown()),
138
- }),
132
+ data: zod_1.z.optional(zod_1.z.unknown())
133
+ })
139
134
  })
140
135
  .strict();
141
136
  const isJSONRPCError = (value) => exports.JSONRPCErrorSchema.safeParse(value).success;
142
137
  exports.isJSONRPCError = isJSONRPCError;
143
- exports.JSONRPCMessageSchema = zod_1.z.union([
144
- exports.JSONRPCRequestSchema,
145
- exports.JSONRPCNotificationSchema,
146
- exports.JSONRPCResponseSchema,
147
- exports.JSONRPCErrorSchema,
148
- ]);
138
+ exports.JSONRPCMessageSchema = zod_1.z.union([exports.JSONRPCRequestSchema, exports.JSONRPCNotificationSchema, exports.JSONRPCResponseSchema, exports.JSONRPCErrorSchema]);
149
139
  /* Empty result */
150
140
  /**
151
141
  * A response that indicates success but carries no data.
@@ -162,7 +152,7 @@ exports.EmptyResultSchema = exports.ResultSchema.strict();
162
152
  * A client MUST NOT attempt to cancel its `initialize` request.
163
153
  */
164
154
  exports.CancelledNotificationSchema = exports.NotificationSchema.extend({
165
- method: zod_1.z.literal("notifications/cancelled"),
155
+ method: zod_1.z.literal('notifications/cancelled'),
166
156
  params: BaseNotificationParamsSchema.extend({
167
157
  /**
168
158
  * The ID of the request to cancel.
@@ -173,8 +163,8 @@ exports.CancelledNotificationSchema = exports.NotificationSchema.extend({
173
163
  /**
174
164
  * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.
175
165
  */
176
- reason: zod_1.z.string().optional(),
177
- }),
166
+ reason: zod_1.z.string().optional()
167
+ })
178
168
  });
179
169
  /* Base Metadata */
180
170
  /**
@@ -191,9 +181,32 @@ exports.IconSchema = zod_1.z
191
181
  */
192
182
  mimeType: zod_1.z.optional(zod_1.z.string()),
193
183
  /**
194
- * Optional string specifying icon dimensions (e.g., "48x48 96x96").
184
+ * Optional array of strings that specify sizes at which the icon can be used.
185
+ * Each string should be in WxH format (e.g., `"48x48"`, `"96x96"`) or `"any"` for scalable formats like SVG.
186
+ *
187
+ * If not provided, the client should assume that the icon can be used at any size.
188
+ */
189
+ sizes: zod_1.z.optional(zod_1.z.array(zod_1.z.string()))
190
+ })
191
+ .passthrough();
192
+ /**
193
+ * Base schema to add `icons` property.
194
+ *
195
+ */
196
+ exports.IconsSchema = zod_1.z
197
+ .object({
198
+ /**
199
+ * Optional set of sized icons that the client can display in a user interface.
200
+ *
201
+ * Clients that support rendering icons MUST support at least the following MIME types:
202
+ * - `image/png` - PNG images (safe, universal compatibility)
203
+ * - `image/jpeg` (and `image/jpg`) - JPEG images (safe, universal compatibility)
204
+ *
205
+ * Clients that support rendering icons SHOULD also support:
206
+ * - `image/svg+xml` - SVG images (scalable but requires security precautions)
207
+ * - `image/webp` - WebP images (modern, efficient format)
195
208
  */
196
- sizes: zod_1.z.optional(zod_1.z.string()),
209
+ icons: zod_1.z.array(exports.IconSchema).optional()
197
210
  })
198
211
  .passthrough();
199
212
  /**
@@ -204,14 +217,14 @@ exports.BaseMetadataSchema = zod_1.z
204
217
  /** Intended for programmatic or logical use, but used as a display name in past specs or fallback */
205
218
  name: zod_1.z.string(),
206
219
  /**
207
- * Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
208
- * even by those unfamiliar with domain-specific terminology.
209
- *
210
- * If not provided, the name should be used for display (except for Tool,
211
- * where `annotations.title` should be given precedence over using `name`,
212
- * if present).
213
- */
214
- title: zod_1.z.optional(zod_1.z.string()),
220
+ * Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
221
+ * even by those unfamiliar with domain-specific terminology.
222
+ *
223
+ * If not provided, the name should be used for display (except for Tool,
224
+ * where `annotations.title` should be given precedence over using `name`,
225
+ * if present).
226
+ */
227
+ title: zod_1.z.optional(zod_1.z.string())
215
228
  })
216
229
  .passthrough();
217
230
  /* Initialization */
@@ -223,17 +236,8 @@ exports.ImplementationSchema = exports.BaseMetadataSchema.extend({
223
236
  /**
224
237
  * An optional URL of the website for this implementation.
225
238
  */
226
- websiteUrl: zod_1.z.optional(zod_1.z.string()),
227
- /**
228
- * An optional list of icons for this implementation.
229
- * This can be used by clients to display the implementation in a user interface.
230
- * Each icon should have a `kind` property that specifies whether it is a data representation or a URL source, a `src` property that points to the icon file or data representation, and may also include a `mimeType` and `sizes` property.
231
- * The `mimeType` property should be a valid MIME type for the icon file, such as "image/png" or "image/svg+xml".
232
- * The `sizes` property should be a string that specifies one or more sizes at which the icon file can be used, such as "48x48" or "any" for scalable formats like SVG.
233
- * The `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.
234
- */
235
- icons: zod_1.z.optional(zod_1.z.array(exports.IconSchema)),
236
- });
239
+ websiteUrl: zod_1.z.optional(zod_1.z.string())
240
+ }).merge(exports.IconsSchema);
237
241
  /**
238
242
  * Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities.
239
243
  */
@@ -259,24 +263,24 @@ exports.ClientCapabilitiesSchema = zod_1.z
259
263
  /**
260
264
  * Whether the client supports issuing notifications for changes to the roots list.
261
265
  */
262
- listChanged: zod_1.z.optional(zod_1.z.boolean()),
266
+ listChanged: zod_1.z.optional(zod_1.z.boolean())
263
267
  })
264
- .passthrough()),
268
+ .passthrough())
265
269
  })
266
270
  .passthrough();
267
271
  /**
268
272
  * This request is sent from the client to the server when it first connects, asking it to begin initialization.
269
273
  */
270
274
  exports.InitializeRequestSchema = exports.RequestSchema.extend({
271
- method: zod_1.z.literal("initialize"),
275
+ method: zod_1.z.literal('initialize'),
272
276
  params: BaseRequestParamsSchema.extend({
273
277
  /**
274
278
  * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.
275
279
  */
276
280
  protocolVersion: zod_1.z.string(),
277
281
  capabilities: exports.ClientCapabilitiesSchema,
278
- clientInfo: exports.ImplementationSchema,
279
- }),
282
+ clientInfo: exports.ImplementationSchema
283
+ })
280
284
  });
281
285
  const isInitializeRequest = (value) => exports.InitializeRequestSchema.safeParse(value).success;
282
286
  exports.isInitializeRequest = isInitializeRequest;
@@ -305,7 +309,7 @@ exports.ServerCapabilitiesSchema = zod_1.z
305
309
  /**
306
310
  * Whether this server supports issuing notifications for changes to the prompt list.
307
311
  */
308
- listChanged: zod_1.z.optional(zod_1.z.boolean()),
312
+ listChanged: zod_1.z.optional(zod_1.z.boolean())
309
313
  })
310
314
  .passthrough()),
311
315
  /**
@@ -320,7 +324,7 @@ exports.ServerCapabilitiesSchema = zod_1.z
320
324
  /**
321
325
  * Whether this server supports issuing notifications for changes to the resource list.
322
326
  */
323
- listChanged: zod_1.z.optional(zod_1.z.boolean()),
327
+ listChanged: zod_1.z.optional(zod_1.z.boolean())
324
328
  })
325
329
  .passthrough()),
326
330
  /**
@@ -331,9 +335,9 @@ exports.ServerCapabilitiesSchema = zod_1.z
331
335
  /**
332
336
  * Whether this server supports issuing notifications for changes to the tool list.
333
337
  */
334
- listChanged: zod_1.z.optional(zod_1.z.boolean()),
338
+ listChanged: zod_1.z.optional(zod_1.z.boolean())
335
339
  })
336
- .passthrough()),
340
+ .passthrough())
337
341
  })
338
342
  .passthrough();
339
343
  /**
@@ -351,13 +355,13 @@ exports.InitializeResultSchema = exports.ResultSchema.extend({
351
355
  *
352
356
  * This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a "hint" to the model. For example, this information MAY be added to the system prompt.
353
357
  */
354
- instructions: zod_1.z.optional(zod_1.z.string()),
358
+ instructions: zod_1.z.optional(zod_1.z.string())
355
359
  });
356
360
  /**
357
361
  * This notification is sent from the client to the server after initialization has finished.
358
362
  */
359
363
  exports.InitializedNotificationSchema = exports.NotificationSchema.extend({
360
- method: zod_1.z.literal("notifications/initialized"),
364
+ method: zod_1.z.literal('notifications/initialized')
361
365
  });
362
366
  const isInitializedNotification = (value) => exports.InitializedNotificationSchema.safeParse(value).success;
363
367
  exports.isInitializedNotification = isInitializedNotification;
@@ -366,7 +370,7 @@ exports.isInitializedNotification = isInitializedNotification;
366
370
  * A ping, issued by either the server or the client, to check that the other party is still alive. The receiver must promptly respond, or else may be disconnected.
367
371
  */
368
372
  exports.PingRequestSchema = exports.RequestSchema.extend({
369
- method: zod_1.z.literal("ping"),
373
+ method: zod_1.z.literal('ping')
370
374
  });
371
375
  /* Progress notifications */
372
376
  exports.ProgressSchema = zod_1.z
@@ -382,20 +386,20 @@ exports.ProgressSchema = zod_1.z
382
386
  /**
383
387
  * An optional message describing the current progress.
384
388
  */
385
- message: zod_1.z.optional(zod_1.z.string()),
389
+ message: zod_1.z.optional(zod_1.z.string())
386
390
  })
387
391
  .passthrough();
388
392
  /**
389
393
  * An out-of-band notification used to inform the receiver of a progress update for a long-running request.
390
394
  */
391
395
  exports.ProgressNotificationSchema = exports.NotificationSchema.extend({
392
- method: zod_1.z.literal("notifications/progress"),
396
+ method: zod_1.z.literal('notifications/progress'),
393
397
  params: BaseNotificationParamsSchema.merge(exports.ProgressSchema).extend({
394
398
  /**
395
399
  * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding.
396
400
  */
397
- progressToken: exports.ProgressTokenSchema,
398
- }),
401
+ progressToken: exports.ProgressTokenSchema
402
+ })
399
403
  });
400
404
  /* Pagination */
401
405
  exports.PaginatedRequestSchema = exports.RequestSchema.extend({
@@ -404,15 +408,15 @@ exports.PaginatedRequestSchema = exports.RequestSchema.extend({
404
408
  * An opaque token representing the current pagination position.
405
409
  * If provided, the server should return results starting after this cursor.
406
410
  */
407
- cursor: zod_1.z.optional(exports.CursorSchema),
408
- }).optional(),
411
+ cursor: zod_1.z.optional(exports.CursorSchema)
412
+ }).optional()
409
413
  });
410
414
  exports.PaginatedResultSchema = exports.ResultSchema.extend({
411
415
  /**
412
416
  * An opaque token representing the pagination position after the last returned result.
413
417
  * If present, there may be more results available.
414
418
  */
415
- nextCursor: zod_1.z.optional(exports.CursorSchema),
419
+ nextCursor: zod_1.z.optional(exports.CursorSchema)
416
420
  });
417
421
  /* Resources */
418
422
  /**
@@ -432,21 +436,21 @@ exports.ResourceContentsSchema = zod_1.z
432
436
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
433
437
  * for notes on _meta usage.
434
438
  */
435
- _meta: zod_1.z.optional(zod_1.z.object({}).passthrough()),
439
+ _meta: zod_1.z.optional(zod_1.z.object({}).passthrough())
436
440
  })
437
441
  .passthrough();
438
442
  exports.TextResourceContentsSchema = exports.ResourceContentsSchema.extend({
439
443
  /**
440
444
  * The text of the item. This must only be set if the item can actually be represented as text (not binary data).
441
445
  */
442
- text: zod_1.z.string(),
446
+ text: zod_1.z.string()
443
447
  });
444
448
  /**
445
449
  * A Zod schema for validating Base64 strings that is more performant and
446
450
  * robust for very large inputs than the default regex-based check. It avoids
447
451
  * stack overflows by using the native `atob` function for validation.
448
452
  */
449
- const Base64Schema = zod_1.z.string().refine((val) => {
453
+ const Base64Schema = zod_1.z.string().refine(val => {
450
454
  try {
451
455
  // atob throws a DOMException if the string contains characters
452
456
  // that are not part of the Base64 character set.
@@ -456,12 +460,12 @@ const Base64Schema = zod_1.z.string().refine((val) => {
456
460
  catch (_a) {
457
461
  return false;
458
462
  }
459
- }, { message: "Invalid Base64 string" });
463
+ }, { message: 'Invalid Base64 string' });
460
464
  exports.BlobResourceContentsSchema = exports.ResourceContentsSchema.extend({
461
465
  /**
462
466
  * A base64-encoded string representing the binary data of the item.
463
467
  */
464
- blob: Base64Schema,
468
+ blob: Base64Schema
465
469
  });
466
470
  /**
467
471
  * A known resource that the server is capable of reading.
@@ -481,16 +485,12 @@ exports.ResourceSchema = exports.BaseMetadataSchema.extend({
481
485
  * The MIME type of this resource, if known.
482
486
  */
483
487
  mimeType: zod_1.z.optional(zod_1.z.string()),
484
- /**
485
- * An optional list of icons for this resource.
486
- */
487
- icons: zod_1.z.optional(zod_1.z.array(exports.IconSchema)),
488
488
  /**
489
489
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
490
490
  * for notes on _meta usage.
491
491
  */
492
- _meta: zod_1.z.optional(zod_1.z.object({}).passthrough()),
493
- });
492
+ _meta: zod_1.z.optional(zod_1.z.object({}).passthrough())
493
+ }).merge(exports.IconsSchema);
494
494
  /**
495
495
  * A template description for resources available on the server.
496
496
  */
@@ -513,91 +513,91 @@ exports.ResourceTemplateSchema = exports.BaseMetadataSchema.extend({
513
513
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
514
514
  * for notes on _meta usage.
515
515
  */
516
- _meta: zod_1.z.optional(zod_1.z.object({}).passthrough()),
517
- });
516
+ _meta: zod_1.z.optional(zod_1.z.object({}).passthrough())
517
+ }).merge(exports.IconsSchema);
518
518
  /**
519
519
  * Sent from the client to request a list of resources the server has.
520
520
  */
521
521
  exports.ListResourcesRequestSchema = exports.PaginatedRequestSchema.extend({
522
- method: zod_1.z.literal("resources/list"),
522
+ method: zod_1.z.literal('resources/list')
523
523
  });
524
524
  /**
525
525
  * The server's response to a resources/list request from the client.
526
526
  */
527
527
  exports.ListResourcesResultSchema = exports.PaginatedResultSchema.extend({
528
- resources: zod_1.z.array(exports.ResourceSchema),
528
+ resources: zod_1.z.array(exports.ResourceSchema)
529
529
  });
530
530
  /**
531
531
  * Sent from the client to request a list of resource templates the server has.
532
532
  */
533
533
  exports.ListResourceTemplatesRequestSchema = exports.PaginatedRequestSchema.extend({
534
- method: zod_1.z.literal("resources/templates/list"),
534
+ method: zod_1.z.literal('resources/templates/list')
535
535
  });
536
536
  /**
537
537
  * The server's response to a resources/templates/list request from the client.
538
538
  */
539
539
  exports.ListResourceTemplatesResultSchema = exports.PaginatedResultSchema.extend({
540
- resourceTemplates: zod_1.z.array(exports.ResourceTemplateSchema),
540
+ resourceTemplates: zod_1.z.array(exports.ResourceTemplateSchema)
541
541
  });
542
542
  /**
543
543
  * Sent from the client to the server, to read a specific resource URI.
544
544
  */
545
545
  exports.ReadResourceRequestSchema = exports.RequestSchema.extend({
546
- method: zod_1.z.literal("resources/read"),
546
+ method: zod_1.z.literal('resources/read'),
547
547
  params: BaseRequestParamsSchema.extend({
548
548
  /**
549
549
  * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it.
550
550
  */
551
- uri: zod_1.z.string(),
552
- }),
551
+ uri: zod_1.z.string()
552
+ })
553
553
  });
554
554
  /**
555
555
  * The server's response to a resources/read request from the client.
556
556
  */
557
557
  exports.ReadResourceResultSchema = exports.ResultSchema.extend({
558
- contents: zod_1.z.array(zod_1.z.union([exports.TextResourceContentsSchema, exports.BlobResourceContentsSchema])),
558
+ contents: zod_1.z.array(zod_1.z.union([exports.TextResourceContentsSchema, exports.BlobResourceContentsSchema]))
559
559
  });
560
560
  /**
561
561
  * An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client.
562
562
  */
563
563
  exports.ResourceListChangedNotificationSchema = exports.NotificationSchema.extend({
564
- method: zod_1.z.literal("notifications/resources/list_changed"),
564
+ method: zod_1.z.literal('notifications/resources/list_changed')
565
565
  });
566
566
  /**
567
567
  * Sent from the client to request resources/updated notifications from the server whenever a particular resource changes.
568
568
  */
569
569
  exports.SubscribeRequestSchema = exports.RequestSchema.extend({
570
- method: zod_1.z.literal("resources/subscribe"),
570
+ method: zod_1.z.literal('resources/subscribe'),
571
571
  params: BaseRequestParamsSchema.extend({
572
572
  /**
573
573
  * The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it.
574
574
  */
575
- uri: zod_1.z.string(),
576
- }),
575
+ uri: zod_1.z.string()
576
+ })
577
577
  });
578
578
  /**
579
579
  * Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request.
580
580
  */
581
581
  exports.UnsubscribeRequestSchema = exports.RequestSchema.extend({
582
- method: zod_1.z.literal("resources/unsubscribe"),
582
+ method: zod_1.z.literal('resources/unsubscribe'),
583
583
  params: BaseRequestParamsSchema.extend({
584
584
  /**
585
585
  * The URI of the resource to unsubscribe from.
586
586
  */
587
- uri: zod_1.z.string(),
588
- }),
587
+ uri: zod_1.z.string()
588
+ })
589
589
  });
590
590
  /**
591
591
  * A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a resources/subscribe request.
592
592
  */
593
593
  exports.ResourceUpdatedNotificationSchema = exports.NotificationSchema.extend({
594
- method: zod_1.z.literal("notifications/resources/updated"),
594
+ method: zod_1.z.literal('notifications/resources/updated'),
595
595
  params: BaseNotificationParamsSchema.extend({
596
596
  /**
597
597
  * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.
598
598
  */
599
- uri: zod_1.z.string(),
600
- }),
599
+ uri: zod_1.z.string()
600
+ })
601
601
  });
602
602
  /* Prompts */
603
603
  /**
@@ -616,7 +616,7 @@ exports.PromptArgumentSchema = zod_1.z
616
616
  /**
617
617
  * Whether this argument must be provided.
618
618
  */
619
- required: zod_1.z.optional(zod_1.z.boolean()),
619
+ required: zod_1.z.optional(zod_1.z.boolean())
620
620
  })
621
621
  .passthrough();
622
622
  /**
@@ -631,33 +631,29 @@ exports.PromptSchema = exports.BaseMetadataSchema.extend({
631
631
  * A list of arguments to use for templating the prompt.
632
632
  */
633
633
  arguments: zod_1.z.optional(zod_1.z.array(exports.PromptArgumentSchema)),
634
- /**
635
- * An optional list of icons for this prompt.
636
- */
637
- icons: zod_1.z.optional(zod_1.z.array(exports.IconSchema)),
638
634
  /**
639
635
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
640
636
  * for notes on _meta usage.
641
637
  */
642
- _meta: zod_1.z.optional(zod_1.z.object({}).passthrough()),
643
- });
638
+ _meta: zod_1.z.optional(zod_1.z.object({}).passthrough())
639
+ }).merge(exports.IconsSchema);
644
640
  /**
645
641
  * Sent from the client to request a list of prompts and prompt templates the server has.
646
642
  */
647
643
  exports.ListPromptsRequestSchema = exports.PaginatedRequestSchema.extend({
648
- method: zod_1.z.literal("prompts/list"),
644
+ method: zod_1.z.literal('prompts/list')
649
645
  });
650
646
  /**
651
647
  * The server's response to a prompts/list request from the client.
652
648
  */
653
649
  exports.ListPromptsResultSchema = exports.PaginatedResultSchema.extend({
654
- prompts: zod_1.z.array(exports.PromptSchema),
650
+ prompts: zod_1.z.array(exports.PromptSchema)
655
651
  });
656
652
  /**
657
653
  * Used by the client to get a prompt provided by the server.
658
654
  */
659
655
  exports.GetPromptRequestSchema = exports.RequestSchema.extend({
660
- method: zod_1.z.literal("prompts/get"),
656
+ method: zod_1.z.literal('prompts/get'),
661
657
  params: BaseRequestParamsSchema.extend({
662
658
  /**
663
659
  * The name of the prompt or prompt template.
@@ -666,15 +662,15 @@ exports.GetPromptRequestSchema = exports.RequestSchema.extend({
666
662
  /**
667
663
  * Arguments to use for templating the prompt.
668
664
  */
669
- arguments: zod_1.z.optional(zod_1.z.record(zod_1.z.string())),
670
- }),
665
+ arguments: zod_1.z.optional(zod_1.z.record(zod_1.z.string()))
666
+ })
671
667
  });
672
668
  /**
673
669
  * Text provided to or from an LLM.
674
670
  */
675
671
  exports.TextContentSchema = zod_1.z
676
672
  .object({
677
- type: zod_1.z.literal("text"),
673
+ type: zod_1.z.literal('text'),
678
674
  /**
679
675
  * The text content of the message.
680
676
  */
@@ -683,7 +679,7 @@ exports.TextContentSchema = zod_1.z
683
679
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
684
680
  * for notes on _meta usage.
685
681
  */
686
- _meta: zod_1.z.optional(zod_1.z.object({}).passthrough()),
682
+ _meta: zod_1.z.optional(zod_1.z.object({}).passthrough())
687
683
  })
688
684
  .passthrough();
689
685
  /**
@@ -691,7 +687,7 @@ exports.TextContentSchema = zod_1.z
691
687
  */
692
688
  exports.ImageContentSchema = zod_1.z
693
689
  .object({
694
- type: zod_1.z.literal("image"),
690
+ type: zod_1.z.literal('image'),
695
691
  /**
696
692
  * The base64-encoded image data.
697
693
  */
@@ -704,7 +700,7 @@ exports.ImageContentSchema = zod_1.z
704
700
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
705
701
  * for notes on _meta usage.
706
702
  */
707
- _meta: zod_1.z.optional(zod_1.z.object({}).passthrough()),
703
+ _meta: zod_1.z.optional(zod_1.z.object({}).passthrough())
708
704
  })
709
705
  .passthrough();
710
706
  /**
@@ -712,7 +708,7 @@ exports.ImageContentSchema = zod_1.z
712
708
  */
713
709
  exports.AudioContentSchema = zod_1.z
714
710
  .object({
715
- type: zod_1.z.literal("audio"),
711
+ type: zod_1.z.literal('audio'),
716
712
  /**
717
713
  * The base64-encoded audio data.
718
714
  */
@@ -725,7 +721,7 @@ exports.AudioContentSchema = zod_1.z
725
721
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
726
722
  * for notes on _meta usage.
727
723
  */
728
- _meta: zod_1.z.optional(zod_1.z.object({}).passthrough()),
724
+ _meta: zod_1.z.optional(zod_1.z.object({}).passthrough())
729
725
  })
730
726
  .passthrough();
731
727
  /**
@@ -733,13 +729,13 @@ exports.AudioContentSchema = zod_1.z
733
729
  */
734
730
  exports.EmbeddedResourceSchema = zod_1.z
735
731
  .object({
736
- type: zod_1.z.literal("resource"),
732
+ type: zod_1.z.literal('resource'),
737
733
  resource: zod_1.z.union([exports.TextResourceContentsSchema, exports.BlobResourceContentsSchema]),
738
734
  /**
739
735
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
740
736
  * for notes on _meta usage.
741
737
  */
742
- _meta: zod_1.z.optional(zod_1.z.object({}).passthrough()),
738
+ _meta: zod_1.z.optional(zod_1.z.object({}).passthrough())
743
739
  })
744
740
  .passthrough();
745
741
  /**
@@ -748,7 +744,7 @@ exports.EmbeddedResourceSchema = zod_1.z
748
744
  * Note: resource links returned by tools are not guaranteed to appear in the results of `resources/list` requests.
749
745
  */
750
746
  exports.ResourceLinkSchema = exports.ResourceSchema.extend({
751
- type: zod_1.z.literal("resource_link"),
747
+ type: zod_1.z.literal('resource_link')
752
748
  });
753
749
  /**
754
750
  * A content block that can be used in prompts and tool results.
@@ -758,15 +754,15 @@ exports.ContentBlockSchema = zod_1.z.union([
758
754
  exports.ImageContentSchema,
759
755
  exports.AudioContentSchema,
760
756
  exports.ResourceLinkSchema,
761
- exports.EmbeddedResourceSchema,
757
+ exports.EmbeddedResourceSchema
762
758
  ]);
763
759
  /**
764
760
  * Describes a message returned as part of a prompt.
765
761
  */
766
762
  exports.PromptMessageSchema = zod_1.z
767
763
  .object({
768
- role: zod_1.z.enum(["user", "assistant"]),
769
- content: exports.ContentBlockSchema,
764
+ role: zod_1.z.enum(['user', 'assistant']),
765
+ content: exports.ContentBlockSchema
770
766
  })
771
767
  .passthrough();
772
768
  /**
@@ -777,13 +773,13 @@ exports.GetPromptResultSchema = exports.ResultSchema.extend({
777
773
  * An optional description for the prompt.
778
774
  */
779
775
  description: zod_1.z.optional(zod_1.z.string()),
780
- messages: zod_1.z.array(exports.PromptMessageSchema),
776
+ messages: zod_1.z.array(exports.PromptMessageSchema)
781
777
  });
782
778
  /**
783
779
  * An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client.
784
780
  */
785
781
  exports.PromptListChangedNotificationSchema = exports.NotificationSchema.extend({
786
- method: zod_1.z.literal("notifications/prompts/list_changed"),
782
+ method: zod_1.z.literal('notifications/prompts/list_changed')
787
783
  });
788
784
  /* Tools */
789
785
  /**
@@ -834,7 +830,7 @@ exports.ToolAnnotationsSchema = zod_1.z
834
830
  *
835
831
  * Default: true
836
832
  */
837
- openWorldHint: zod_1.z.optional(zod_1.z.boolean()),
833
+ openWorldHint: zod_1.z.optional(zod_1.z.boolean())
838
834
  })
839
835
  .passthrough();
840
836
  /**
@@ -850,46 +846,43 @@ exports.ToolSchema = exports.BaseMetadataSchema.extend({
850
846
  */
851
847
  inputSchema: zod_1.z
852
848
  .object({
853
- type: zod_1.z.literal("object"),
849
+ type: zod_1.z.literal('object'),
854
850
  properties: zod_1.z.optional(zod_1.z.object({}).passthrough()),
855
- required: zod_1.z.optional(zod_1.z.array(zod_1.z.string())),
851
+ required: zod_1.z.optional(zod_1.z.array(zod_1.z.string()))
856
852
  })
857
853
  .passthrough(),
858
854
  /**
859
855
  * An optional JSON Schema object defining the structure of the tool's output returned in
860
856
  * the structuredContent field of a CallToolResult.
861
857
  */
862
- outputSchema: zod_1.z.optional(zod_1.z.object({
863
- type: zod_1.z.literal("object"),
858
+ outputSchema: zod_1.z.optional(zod_1.z
859
+ .object({
860
+ type: zod_1.z.literal('object'),
864
861
  properties: zod_1.z.optional(zod_1.z.object({}).passthrough()),
865
- required: zod_1.z.optional(zod_1.z.array(zod_1.z.string())),
862
+ required: zod_1.z.optional(zod_1.z.array(zod_1.z.string()))
866
863
  })
867
864
  .passthrough()),
868
865
  /**
869
866
  * Optional additional tool information.
870
867
  */
871
868
  annotations: zod_1.z.optional(exports.ToolAnnotationsSchema),
872
- /**
873
- * An optional list of icons for this tool.
874
- */
875
- icons: zod_1.z.optional(zod_1.z.array(exports.IconSchema)),
876
869
  /**
877
870
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
878
871
  * for notes on _meta usage.
879
872
  */
880
- _meta: zod_1.z.optional(zod_1.z.object({}).passthrough()),
881
- });
873
+ _meta: zod_1.z.optional(zod_1.z.object({}).passthrough())
874
+ }).merge(exports.IconsSchema);
882
875
  /**
883
876
  * Sent from the client to request a list of tools the server has.
884
877
  */
885
878
  exports.ListToolsRequestSchema = exports.PaginatedRequestSchema.extend({
886
- method: zod_1.z.literal("tools/list"),
879
+ method: zod_1.z.literal('tools/list')
887
880
  });
888
881
  /**
889
882
  * The server's response to a tools/list request from the client.
890
883
  */
891
884
  exports.ListToolsResultSchema = exports.PaginatedResultSchema.extend({
892
- tools: zod_1.z.array(exports.ToolSchema),
885
+ tools: zod_1.z.array(exports.ToolSchema)
893
886
  });
894
887
  /**
895
888
  * The server's response to a tool call.
@@ -922,61 +915,52 @@ exports.CallToolResultSchema = exports.ResultSchema.extend({
922
915
  * server does not support tool calls, or any other exceptional conditions,
923
916
  * should be reported as an MCP error response.
924
917
  */
925
- isError: zod_1.z.optional(zod_1.z.boolean()),
918
+ isError: zod_1.z.optional(zod_1.z.boolean())
926
919
  });
927
920
  /**
928
921
  * CallToolResultSchema extended with backwards compatibility to protocol version 2024-10-07.
929
922
  */
930
923
  exports.CompatibilityCallToolResultSchema = exports.CallToolResultSchema.or(exports.ResultSchema.extend({
931
- toolResult: zod_1.z.unknown(),
924
+ toolResult: zod_1.z.unknown()
932
925
  }));
933
926
  /**
934
927
  * Used by the client to invoke a tool provided by the server.
935
928
  */
936
929
  exports.CallToolRequestSchema = exports.RequestSchema.extend({
937
- method: zod_1.z.literal("tools/call"),
930
+ method: zod_1.z.literal('tools/call'),
938
931
  params: BaseRequestParamsSchema.extend({
939
932
  name: zod_1.z.string(),
940
- arguments: zod_1.z.optional(zod_1.z.record(zod_1.z.unknown())),
941
- }),
933
+ arguments: zod_1.z.optional(zod_1.z.record(zod_1.z.unknown()))
934
+ })
942
935
  });
943
936
  /**
944
937
  * An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client.
945
938
  */
946
939
  exports.ToolListChangedNotificationSchema = exports.NotificationSchema.extend({
947
- method: zod_1.z.literal("notifications/tools/list_changed"),
940
+ method: zod_1.z.literal('notifications/tools/list_changed')
948
941
  });
949
942
  /* Logging */
950
943
  /**
951
944
  * The severity of a log message.
952
945
  */
953
- exports.LoggingLevelSchema = zod_1.z.enum([
954
- "debug",
955
- "info",
956
- "notice",
957
- "warning",
958
- "error",
959
- "critical",
960
- "alert",
961
- "emergency",
962
- ]);
946
+ exports.LoggingLevelSchema = zod_1.z.enum(['debug', 'info', 'notice', 'warning', 'error', 'critical', 'alert', 'emergency']);
963
947
  /**
964
948
  * A request from the client to the server, to enable or adjust logging.
965
949
  */
966
950
  exports.SetLevelRequestSchema = exports.RequestSchema.extend({
967
- method: zod_1.z.literal("logging/setLevel"),
951
+ method: zod_1.z.literal('logging/setLevel'),
968
952
  params: BaseRequestParamsSchema.extend({
969
953
  /**
970
954
  * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message.
971
955
  */
972
- level: exports.LoggingLevelSchema,
973
- }),
956
+ level: exports.LoggingLevelSchema
957
+ })
974
958
  });
975
959
  /**
976
960
  * Notification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically.
977
961
  */
978
962
  exports.LoggingMessageNotificationSchema = exports.NotificationSchema.extend({
979
- method: zod_1.z.literal("notifications/message"),
963
+ method: zod_1.z.literal('notifications/message'),
980
964
  params: BaseNotificationParamsSchema.extend({
981
965
  /**
982
966
  * The severity of this log message.
@@ -989,8 +973,8 @@ exports.LoggingMessageNotificationSchema = exports.NotificationSchema.extend({
989
973
  /**
990
974
  * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here.
991
975
  */
992
- data: zod_1.z.unknown(),
993
- }),
976
+ data: zod_1.z.unknown()
977
+ })
994
978
  });
995
979
  /* Sampling */
996
980
  /**
@@ -1001,7 +985,7 @@ exports.ModelHintSchema = zod_1.z
1001
985
  /**
1002
986
  * A hint for a model name.
1003
987
  */
1004
- name: zod_1.z.string().optional(),
988
+ name: zod_1.z.string().optional()
1005
989
  })
1006
990
  .passthrough();
1007
991
  /**
@@ -1024,7 +1008,7 @@ exports.ModelPreferencesSchema = zod_1.z
1024
1008
  /**
1025
1009
  * How much to prioritize intelligence and capabilities when selecting a model.
1026
1010
  */
1027
- intelligencePriority: zod_1.z.optional(zod_1.z.number().min(0).max(1)),
1011
+ intelligencePriority: zod_1.z.optional(zod_1.z.number().min(0).max(1))
1028
1012
  })
1029
1013
  .passthrough();
1030
1014
  /**
@@ -1032,15 +1016,15 @@ exports.ModelPreferencesSchema = zod_1.z
1032
1016
  */
1033
1017
  exports.SamplingMessageSchema = zod_1.z
1034
1018
  .object({
1035
- role: zod_1.z.enum(["user", "assistant"]),
1036
- content: zod_1.z.union([exports.TextContentSchema, exports.ImageContentSchema, exports.AudioContentSchema]),
1019
+ role: zod_1.z.enum(['user', 'assistant']),
1020
+ content: zod_1.z.union([exports.TextContentSchema, exports.ImageContentSchema, exports.AudioContentSchema])
1037
1021
  })
1038
1022
  .passthrough();
1039
1023
  /**
1040
1024
  * A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it.
1041
1025
  */
1042
1026
  exports.CreateMessageRequestSchema = exports.RequestSchema.extend({
1043
- method: zod_1.z.literal("sampling/createMessage"),
1027
+ method: zod_1.z.literal('sampling/createMessage'),
1044
1028
  params: BaseRequestParamsSchema.extend({
1045
1029
  messages: zod_1.z.array(exports.SamplingMessageSchema),
1046
1030
  /**
@@ -1050,7 +1034,7 @@ exports.CreateMessageRequestSchema = exports.RequestSchema.extend({
1050
1034
  /**
1051
1035
  * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request.
1052
1036
  */
1053
- includeContext: zod_1.z.optional(zod_1.z.enum(["none", "thisServer", "allServers"])),
1037
+ includeContext: zod_1.z.optional(zod_1.z.enum(['none', 'thisServer', 'allServers'])),
1054
1038
  temperature: zod_1.z.optional(zod_1.z.number()),
1055
1039
  /**
1056
1040
  * The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested.
@@ -1064,8 +1048,8 @@ exports.CreateMessageRequestSchema = exports.RequestSchema.extend({
1064
1048
  /**
1065
1049
  * The server's preferences for which model to select.
1066
1050
  */
1067
- modelPreferences: zod_1.z.optional(exports.ModelPreferencesSchema),
1068
- }),
1051
+ modelPreferences: zod_1.z.optional(exports.ModelPreferencesSchema)
1052
+ })
1069
1053
  });
1070
1054
  /**
1071
1055
  * The client's response to a sampling/create_message request from the server. The client should inform the user before returning the sampled message, to allow them to inspect the response (human in the loop) and decide whether to allow the server to see it.
@@ -1078,13 +1062,9 @@ exports.CreateMessageResultSchema = exports.ResultSchema.extend({
1078
1062
  /**
1079
1063
  * The reason why sampling stopped.
1080
1064
  */
1081
- stopReason: zod_1.z.optional(zod_1.z.enum(["endTurn", "stopSequence", "maxTokens"]).or(zod_1.z.string())),
1082
- role: zod_1.z.enum(["user", "assistant"]),
1083
- content: zod_1.z.discriminatedUnion("type", [
1084
- exports.TextContentSchema,
1085
- exports.ImageContentSchema,
1086
- exports.AudioContentSchema
1087
- ]),
1065
+ stopReason: zod_1.z.optional(zod_1.z.enum(['endTurn', 'stopSequence', 'maxTokens']).or(zod_1.z.string())),
1066
+ role: zod_1.z.enum(['user', 'assistant']),
1067
+ content: zod_1.z.discriminatedUnion('type', [exports.TextContentSchema, exports.ImageContentSchema, exports.AudioContentSchema])
1088
1068
  });
1089
1069
  /* Elicitation */
1090
1070
  /**
@@ -1092,10 +1072,10 @@ exports.CreateMessageResultSchema = exports.ResultSchema.extend({
1092
1072
  */
1093
1073
  exports.BooleanSchemaSchema = zod_1.z
1094
1074
  .object({
1095
- type: zod_1.z.literal("boolean"),
1075
+ type: zod_1.z.literal('boolean'),
1096
1076
  title: zod_1.z.optional(zod_1.z.string()),
1097
1077
  description: zod_1.z.optional(zod_1.z.string()),
1098
- default: zod_1.z.optional(zod_1.z.boolean()),
1078
+ default: zod_1.z.optional(zod_1.z.boolean())
1099
1079
  })
1100
1080
  .passthrough();
1101
1081
  /**
@@ -1103,12 +1083,12 @@ exports.BooleanSchemaSchema = zod_1.z
1103
1083
  */
1104
1084
  exports.StringSchemaSchema = zod_1.z
1105
1085
  .object({
1106
- type: zod_1.z.literal("string"),
1086
+ type: zod_1.z.literal('string'),
1107
1087
  title: zod_1.z.optional(zod_1.z.string()),
1108
1088
  description: zod_1.z.optional(zod_1.z.string()),
1109
1089
  minLength: zod_1.z.optional(zod_1.z.number()),
1110
1090
  maxLength: zod_1.z.optional(zod_1.z.number()),
1111
- format: zod_1.z.optional(zod_1.z.enum(["email", "uri", "date", "date-time"])),
1091
+ format: zod_1.z.optional(zod_1.z.enum(['email', 'uri', 'date', 'date-time']))
1112
1092
  })
1113
1093
  .passthrough();
1114
1094
  /**
@@ -1116,11 +1096,11 @@ exports.StringSchemaSchema = zod_1.z
1116
1096
  */
1117
1097
  exports.NumberSchemaSchema = zod_1.z
1118
1098
  .object({
1119
- type: zod_1.z.enum(["number", "integer"]),
1099
+ type: zod_1.z.enum(['number', 'integer']),
1120
1100
  title: zod_1.z.optional(zod_1.z.string()),
1121
1101
  description: zod_1.z.optional(zod_1.z.string()),
1122
1102
  minimum: zod_1.z.optional(zod_1.z.number()),
1123
- maximum: zod_1.z.optional(zod_1.z.number()),
1103
+ maximum: zod_1.z.optional(zod_1.z.number())
1124
1104
  })
1125
1105
  .passthrough();
1126
1106
  /**
@@ -1128,28 +1108,23 @@ exports.NumberSchemaSchema = zod_1.z
1128
1108
  */
1129
1109
  exports.EnumSchemaSchema = zod_1.z
1130
1110
  .object({
1131
- type: zod_1.z.literal("string"),
1111
+ type: zod_1.z.literal('string'),
1132
1112
  title: zod_1.z.optional(zod_1.z.string()),
1133
1113
  description: zod_1.z.optional(zod_1.z.string()),
1134
1114
  enum: zod_1.z.array(zod_1.z.string()),
1135
- enumNames: zod_1.z.optional(zod_1.z.array(zod_1.z.string())),
1115
+ enumNames: zod_1.z.optional(zod_1.z.array(zod_1.z.string()))
1136
1116
  })
1137
1117
  .passthrough();
1138
1118
  /**
1139
1119
  * Union of all primitive schema definitions.
1140
1120
  */
1141
- exports.PrimitiveSchemaDefinitionSchema = zod_1.z.union([
1142
- exports.BooleanSchemaSchema,
1143
- exports.StringSchemaSchema,
1144
- exports.NumberSchemaSchema,
1145
- exports.EnumSchemaSchema,
1146
- ]);
1121
+ exports.PrimitiveSchemaDefinitionSchema = zod_1.z.union([exports.BooleanSchemaSchema, exports.StringSchemaSchema, exports.NumberSchemaSchema, exports.EnumSchemaSchema]);
1147
1122
  /**
1148
1123
  * A request from the server to elicit user input via the client.
1149
1124
  * The client should present the message and form fields to the user.
1150
1125
  */
1151
1126
  exports.ElicitRequestSchema = exports.RequestSchema.extend({
1152
- method: zod_1.z.literal("elicitation/create"),
1127
+ method: zod_1.z.literal('elicitation/create'),
1153
1128
  params: BaseRequestParamsSchema.extend({
1154
1129
  /**
1155
1130
  * The message to present to the user.
@@ -1160,12 +1135,12 @@ exports.ElicitRequestSchema = exports.RequestSchema.extend({
1160
1135
  */
1161
1136
  requestedSchema: zod_1.z
1162
1137
  .object({
1163
- type: zod_1.z.literal("object"),
1138
+ type: zod_1.z.literal('object'),
1164
1139
  properties: zod_1.z.record(zod_1.z.string(), exports.PrimitiveSchemaDefinitionSchema),
1165
- required: zod_1.z.optional(zod_1.z.array(zod_1.z.string())),
1140
+ required: zod_1.z.optional(zod_1.z.array(zod_1.z.string()))
1166
1141
  })
1167
- .passthrough(),
1168
- }),
1142
+ .passthrough()
1143
+ })
1169
1144
  });
1170
1145
  /**
1171
1146
  * The client's response to an elicitation/create request from the server.
@@ -1174,11 +1149,11 @@ exports.ElicitResultSchema = exports.ResultSchema.extend({
1174
1149
  /**
1175
1150
  * The user's response action.
1176
1151
  */
1177
- action: zod_1.z.enum(["accept", "decline", "cancel"]),
1152
+ action: zod_1.z.enum(['accept', 'decline', 'cancel']),
1178
1153
  /**
1179
1154
  * The collected user input content (only present if action is "accept").
1180
1155
  */
1181
- content: zod_1.z.optional(zod_1.z.record(zod_1.z.string(), zod_1.z.unknown())),
1156
+ content: zod_1.z.optional(zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()))
1182
1157
  });
1183
1158
  /* Autocomplete */
1184
1159
  /**
@@ -1186,11 +1161,11 @@ exports.ElicitResultSchema = exports.ResultSchema.extend({
1186
1161
  */
1187
1162
  exports.ResourceTemplateReferenceSchema = zod_1.z
1188
1163
  .object({
1189
- type: zod_1.z.literal("ref/resource"),
1164
+ type: zod_1.z.literal('ref/resource'),
1190
1165
  /**
1191
1166
  * The URI or URI template of the resource.
1192
1167
  */
1193
- uri: zod_1.z.string(),
1168
+ uri: zod_1.z.string()
1194
1169
  })
1195
1170
  .passthrough();
1196
1171
  /**
@@ -1202,18 +1177,18 @@ exports.ResourceReferenceSchema = exports.ResourceTemplateReferenceSchema;
1202
1177
  */
1203
1178
  exports.PromptReferenceSchema = zod_1.z
1204
1179
  .object({
1205
- type: zod_1.z.literal("ref/prompt"),
1180
+ type: zod_1.z.literal('ref/prompt'),
1206
1181
  /**
1207
1182
  * The name of the prompt or prompt template
1208
1183
  */
1209
- name: zod_1.z.string(),
1184
+ name: zod_1.z.string()
1210
1185
  })
1211
1186
  .passthrough();
1212
1187
  /**
1213
1188
  * A request from the client to the server, to ask for completion options.
1214
1189
  */
1215
1190
  exports.CompleteRequestSchema = exports.RequestSchema.extend({
1216
- method: zod_1.z.literal("completion/complete"),
1191
+ method: zod_1.z.literal('completion/complete'),
1217
1192
  params: BaseRequestParamsSchema.extend({
1218
1193
  ref: zod_1.z.union([exports.PromptReferenceSchema, exports.ResourceTemplateReferenceSchema]),
1219
1194
  /**
@@ -1228,16 +1203,16 @@ exports.CompleteRequestSchema = exports.RequestSchema.extend({
1228
1203
  /**
1229
1204
  * The value of the argument to use for completion matching.
1230
1205
  */
1231
- value: zod_1.z.string(),
1206
+ value: zod_1.z.string()
1232
1207
  })
1233
1208
  .passthrough(),
1234
1209
  context: zod_1.z.optional(zod_1.z.object({
1235
1210
  /**
1236
1211
  * Previously-resolved variables in a URI template or prompt.
1237
1212
  */
1238
- arguments: zod_1.z.optional(zod_1.z.record(zod_1.z.string(), zod_1.z.string())),
1239
- })),
1240
- }),
1213
+ arguments: zod_1.z.optional(zod_1.z.record(zod_1.z.string(), zod_1.z.string()))
1214
+ }))
1215
+ })
1241
1216
  });
1242
1217
  /**
1243
1218
  * The server's response to a completion/complete request
@@ -1256,9 +1231,9 @@ exports.CompleteResultSchema = exports.ResultSchema.extend({
1256
1231
  /**
1257
1232
  * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown.
1258
1233
  */
1259
- hasMore: zod_1.z.optional(zod_1.z.boolean()),
1234
+ hasMore: zod_1.z.optional(zod_1.z.boolean())
1260
1235
  })
1261
- .passthrough(),
1236
+ .passthrough()
1262
1237
  });
1263
1238
  /* Roots */
1264
1239
  /**
@@ -1269,7 +1244,7 @@ exports.RootSchema = zod_1.z
1269
1244
  /**
1270
1245
  * The URI identifying the root. This *must* start with file:// for now.
1271
1246
  */
1272
- uri: zod_1.z.string().startsWith("file://"),
1247
+ uri: zod_1.z.string().startsWith('file://'),
1273
1248
  /**
1274
1249
  * An optional name for the root.
1275
1250
  */
@@ -1278,26 +1253,26 @@ exports.RootSchema = zod_1.z
1278
1253
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
1279
1254
  * for notes on _meta usage.
1280
1255
  */
1281
- _meta: zod_1.z.optional(zod_1.z.object({}).passthrough()),
1256
+ _meta: zod_1.z.optional(zod_1.z.object({}).passthrough())
1282
1257
  })
1283
1258
  .passthrough();
1284
1259
  /**
1285
1260
  * Sent from the server to request a list of root URIs from the client.
1286
1261
  */
1287
1262
  exports.ListRootsRequestSchema = exports.RequestSchema.extend({
1288
- method: zod_1.z.literal("roots/list"),
1263
+ method: zod_1.z.literal('roots/list')
1289
1264
  });
1290
1265
  /**
1291
1266
  * The client's response to a roots/list request from the server.
1292
1267
  */
1293
1268
  exports.ListRootsResultSchema = exports.ResultSchema.extend({
1294
- roots: zod_1.z.array(exports.RootSchema),
1269
+ roots: zod_1.z.array(exports.RootSchema)
1295
1270
  });
1296
1271
  /**
1297
1272
  * A notification from the client to the server, informing it that the list of roots has changed.
1298
1273
  */
1299
1274
  exports.RootsListChangedNotificationSchema = exports.NotificationSchema.extend({
1300
- method: zod_1.z.literal("notifications/roots/list_changed"),
1275
+ method: zod_1.z.literal('notifications/roots/list_changed')
1301
1276
  });
1302
1277
  /* Client messages */
1303
1278
  exports.ClientRequestSchema = zod_1.z.union([
@@ -1313,27 +1288,17 @@ exports.ClientRequestSchema = zod_1.z.union([
1313
1288
  exports.SubscribeRequestSchema,
1314
1289
  exports.UnsubscribeRequestSchema,
1315
1290
  exports.CallToolRequestSchema,
1316
- exports.ListToolsRequestSchema,
1291
+ exports.ListToolsRequestSchema
1317
1292
  ]);
1318
1293
  exports.ClientNotificationSchema = zod_1.z.union([
1319
1294
  exports.CancelledNotificationSchema,
1320
1295
  exports.ProgressNotificationSchema,
1321
1296
  exports.InitializedNotificationSchema,
1322
- exports.RootsListChangedNotificationSchema,
1323
- ]);
1324
- exports.ClientResultSchema = zod_1.z.union([
1325
- exports.EmptyResultSchema,
1326
- exports.CreateMessageResultSchema,
1327
- exports.ElicitResultSchema,
1328
- exports.ListRootsResultSchema,
1297
+ exports.RootsListChangedNotificationSchema
1329
1298
  ]);
1299
+ exports.ClientResultSchema = zod_1.z.union([exports.EmptyResultSchema, exports.CreateMessageResultSchema, exports.ElicitResultSchema, exports.ListRootsResultSchema]);
1330
1300
  /* Server messages */
1331
- exports.ServerRequestSchema = zod_1.z.union([
1332
- exports.PingRequestSchema,
1333
- exports.CreateMessageRequestSchema,
1334
- exports.ElicitRequestSchema,
1335
- exports.ListRootsRequestSchema,
1336
- ]);
1301
+ exports.ServerRequestSchema = zod_1.z.union([exports.PingRequestSchema, exports.CreateMessageRequestSchema, exports.ElicitRequestSchema, exports.ListRootsRequestSchema]);
1337
1302
  exports.ServerNotificationSchema = zod_1.z.union([
1338
1303
  exports.CancelledNotificationSchema,
1339
1304
  exports.ProgressNotificationSchema,
@@ -1341,7 +1306,7 @@ exports.ServerNotificationSchema = zod_1.z.union([
1341
1306
  exports.ResourceUpdatedNotificationSchema,
1342
1307
  exports.ResourceListChangedNotificationSchema,
1343
1308
  exports.ToolListChangedNotificationSchema,
1344
- exports.PromptListChangedNotificationSchema,
1309
+ exports.PromptListChangedNotificationSchema
1345
1310
  ]);
1346
1311
  exports.ServerResultSchema = zod_1.z.union([
1347
1312
  exports.EmptyResultSchema,
@@ -1353,14 +1318,14 @@ exports.ServerResultSchema = zod_1.z.union([
1353
1318
  exports.ListResourceTemplatesResultSchema,
1354
1319
  exports.ReadResourceResultSchema,
1355
1320
  exports.CallToolResultSchema,
1356
- exports.ListToolsResultSchema,
1321
+ exports.ListToolsResultSchema
1357
1322
  ]);
1358
1323
  class McpError extends Error {
1359
1324
  constructor(code, message, data) {
1360
1325
  super(`MCP error ${code}: ${message}`);
1361
1326
  this.code = code;
1362
1327
  this.data = data;
1363
- this.name = "McpError";
1328
+ this.name = 'McpError';
1364
1329
  }
1365
1330
  }
1366
1331
  exports.McpError = McpError;