ostacky 0.5.5 → 0.5.7

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 (850) hide show
  1. package/README.md +22 -22
  2. package/assets/agents/ostacky.md +89 -71
  3. package/assets/commands/install-stack.md +7 -8
  4. package/assets/mcp/ostacky-controller/index.js +16 -4
  5. package/assets/mcp/ostacky-controller/node_modules/.package-lock.json +1 -1
  6. package/assets/mcp/ostacky-controller/package-lock.json +2 -2
  7. package/assets/mcp/ostacky-controller/package.json +1 -1
  8. package/assets/skills/execution-mode-evaluation/SKILL.md +107 -529
  9. package/assets/skills/openspec-apply-change/SKILL.md +18 -9
  10. package/assets/skills/openspec-archive-change/SKILL.md +3 -3
  11. package/assets/skills/openspec-propose/SKILL.md +10 -8
  12. package/assets/skills/review/SKILL.md +7 -5
  13. package/assets/skills/subagent-driven-development/SKILL.md +14 -0
  14. package/assets/skills/thinking/SKILL.md +195 -0
  15. package/assets/skills/using-git-worktrees/SKILL.md +1 -1
  16. package/assets/skills/using-superpowers/SKILL.md +8 -8
  17. package/assets/skills/writing-plans/SKILL.md +12 -1
  18. package/assets/tests/e2e-scenarios.md +502 -0
  19. package/assets/tests/validate-config.sh +254 -0
  20. package/dist/cli.js +78 -52
  21. package/dist/mcp/ask-user-server/index.js +1 -1
  22. package/dist/mcp/ostacky-controller/index.js +15 -4
  23. package/manifest.json +60 -46
  24. package/package.json +1 -1
  25. package/assets/mcp/ask-user-server/index.js +0 -167
  26. package/assets/mcp/ask-user-server/node_modules/.package-lock.json +0 -42
  27. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/core/LICENSE +0 -216
  28. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/core/README.md +0 -40
  29. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/core/dist/auth-BUWfrB3C.d.cts +0 -8198
  30. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/core/dist/auth-BUWfrB3C.d.cts.map +0 -1
  31. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/core/dist/auth-CEFpHq32.cjs +0 -2862
  32. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/core/dist/auth-CEFpHq32.cjs.map +0 -1
  33. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/core/dist/auth-CNbu4K4a.d.mts +0 -8198
  34. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/core/dist/auth-CNbu4K4a.d.mts.map +0 -1
  35. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/core/dist/auth-DFgbUATV.mjs +0 -1653
  36. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/core/dist/auth-DFgbUATV.mjs.map +0 -1
  37. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/core/dist/index.cjs +0 -174
  38. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/core/dist/index.d.cts +0 -2
  39. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/core/dist/index.d.mts +0 -2
  40. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/core/dist/index.mjs +0 -3
  41. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/core/dist/internal.cjs +0 -199
  42. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/core/dist/internal.d.cts +0 -87
  43. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/core/dist/internal.d.cts.map +0 -1
  44. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/core/dist/internal.d.mts +0 -87
  45. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/core/dist/internal.d.mts.map +0 -1
  46. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/core/dist/internal.mjs +0 -3
  47. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/core/package.json +0 -85
  48. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/LICENSE +0 -216
  49. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/README.md +0 -30
  50. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/ajvProvider-B_4czhCS.d.cts +0 -1054
  51. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/ajvProvider-B_4czhCS.d.cts.map +0 -1
  52. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/ajvProvider-BdSo9BII.d.mts +0 -1054
  53. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/ajvProvider-BdSo9BII.d.mts.map +0 -1
  54. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/ajvProvider-Brn-Q2J_.cjs +0 -7086
  55. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/ajvProvider-Brn-Q2J_.cjs.map +0 -1
  56. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CplOkyLC.mjs +0 -7069
  57. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CplOkyLC.mjs.map +0 -1
  58. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-BYRW5af5.d.mts +0 -59
  59. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-BYRW5af5.d.mts.map +0 -1
  60. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-Bd-iTHAF.mjs +0 -970
  61. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-Bd-iTHAF.mjs.map +0 -1
  62. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-D9GAttn8.d.cts +0 -59
  63. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-D9GAttn8.d.cts.map +0 -1
  64. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-ojcZaap3.cjs +0 -976
  65. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-ojcZaap3.cjs.map +0 -1
  66. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/chunk-Bnu9O96Y.cjs +0 -60
  67. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/chunk-Br0eD_fh.mjs +0 -42
  68. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-BRM5MGf9.d.cts +0 -4015
  69. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-BRM5MGf9.d.cts.map +0 -1
  70. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-D93NefGZ.d.mts +0 -4013
  71. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-D93NefGZ.d.mts.map +0 -1
  72. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/index.cjs +0 -1990
  73. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/index.cjs.map +0 -1
  74. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/index.d.cts +0 -732
  75. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/index.d.cts.map +0 -1
  76. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/index.d.mts +0 -732
  77. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/index.d.mts.map +0 -1
  78. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/index.mjs +0 -1813
  79. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/index.mjs.map +0 -1
  80. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/mcp-Ctiu4nBa.mjs +0 -1884
  81. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/mcp-Ctiu4nBa.mjs.map +0 -1
  82. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/mcp-CzU40gwu.cjs +0 -1963
  83. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/mcp-CzU40gwu.cjs.map +0 -1
  84. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.cjs +0 -23
  85. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.cjs.map +0 -1
  86. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.cts +0 -11
  87. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.cts.map +0 -1
  88. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.mts +0 -11
  89. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.mts.map +0 -1
  90. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.mjs +0 -22
  91. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.mjs.map +0 -1
  92. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/shimsNode.cjs +0 -12
  93. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/shimsNode.d.cts +0 -3
  94. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/shimsNode.d.mts +0 -3
  95. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/shimsNode.mjs +0 -4
  96. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.cjs +0 -30
  97. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.cjs.map +0 -1
  98. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.cts +0 -10
  99. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.cts.map +0 -1
  100. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.mts +0 -10
  101. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.mts.map +0 -1
  102. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.mjs +0 -29
  103. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.mjs.map +0 -1
  104. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/src-D5Nfqtoz.mjs +0 -7502
  105. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/src-D5Nfqtoz.mjs.map +0 -1
  106. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/src-D9A7ArDn.cjs +0 -8000
  107. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/src-D9A7ArDn.cjs.map +0 -1
  108. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/stdio.cjs +0 -564
  109. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/stdio.cjs.map +0 -1
  110. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/stdio.d.cts +0 -107
  111. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/stdio.d.cts.map +0 -1
  112. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/stdio.d.mts +0 -107
  113. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/stdio.d.mts.map +0 -1
  114. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/stdio.mjs +0 -562
  115. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/stdio.mjs.map +0 -1
  116. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/types-DsbMXNFL.d.cts +0 -1099
  117. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/types-DsbMXNFL.d.cts.map +0 -1
  118. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/types-mS0yxCL0.d.mts +0 -1099
  119. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/types-mS0yxCL0.d.mts.map +0 -1
  120. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/validators/ajv.cjs +0 -5
  121. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/validators/ajv.d.cts +0 -2
  122. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/validators/ajv.d.mts +0 -2
  123. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/validators/ajv.mjs +0 -3
  124. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.cjs +0 -3
  125. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.d.cts +0 -2
  126. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.d.mts +0 -2
  127. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.mjs +0 -3
  128. package/assets/mcp/ask-user-server/node_modules/@modelcontextprotocol/server/package.json +0 -160
  129. package/assets/mcp/ask-user-server/node_modules/zod/LICENSE +0 -21
  130. package/assets/mcp/ask-user-server/node_modules/zod/README.md +0 -191
  131. package/assets/mcp/ask-user-server/node_modules/zod/index.cjs +0 -33
  132. package/assets/mcp/ask-user-server/node_modules/zod/index.d.cts +0 -4
  133. package/assets/mcp/ask-user-server/node_modules/zod/index.d.ts +0 -4
  134. package/assets/mcp/ask-user-server/node_modules/zod/index.js +0 -4
  135. package/assets/mcp/ask-user-server/node_modules/zod/locales/index.cjs +0 -17
  136. package/assets/mcp/ask-user-server/node_modules/zod/locales/index.d.cts +0 -1
  137. package/assets/mcp/ask-user-server/node_modules/zod/locales/index.d.ts +0 -1
  138. package/assets/mcp/ask-user-server/node_modules/zod/locales/index.js +0 -1
  139. package/assets/mcp/ask-user-server/node_modules/zod/locales/package.json +0 -7
  140. package/assets/mcp/ask-user-server/node_modules/zod/mini/index.cjs +0 -32
  141. package/assets/mcp/ask-user-server/node_modules/zod/mini/index.d.cts +0 -3
  142. package/assets/mcp/ask-user-server/node_modules/zod/mini/index.d.ts +0 -3
  143. package/assets/mcp/ask-user-server/node_modules/zod/mini/index.js +0 -3
  144. package/assets/mcp/ask-user-server/node_modules/zod/mini/package.json +0 -7
  145. package/assets/mcp/ask-user-server/node_modules/zod/package.json +0 -135
  146. package/assets/mcp/ask-user-server/node_modules/zod/src/index.ts +0 -4
  147. package/assets/mcp/ask-user-server/node_modules/zod/src/locales/index.ts +0 -1
  148. package/assets/mcp/ask-user-server/node_modules/zod/src/mini/index.ts +0 -3
  149. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/ZodError.ts +0 -330
  150. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/benchmarks/datetime.ts +0 -58
  151. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +0 -80
  152. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/benchmarks/index.ts +0 -59
  153. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/benchmarks/ipv4.ts +0 -57
  154. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/benchmarks/object.ts +0 -69
  155. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/benchmarks/primitives.ts +0 -162
  156. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/benchmarks/realworld.ts +0 -63
  157. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/benchmarks/string.ts +0 -55
  158. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/benchmarks/union.ts +0 -80
  159. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/errors.ts +0 -13
  160. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/external.ts +0 -6
  161. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/helpers/enumUtil.ts +0 -17
  162. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/helpers/errorUtil.ts +0 -8
  163. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/helpers/parseUtil.ts +0 -176
  164. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/helpers/partialUtil.ts +0 -34
  165. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/helpers/typeAliases.ts +0 -2
  166. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/helpers/util.ts +0 -224
  167. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/index.ts +0 -4
  168. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/locales/en.ts +0 -124
  169. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/standard-schema.ts +0 -113
  170. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/Mocker.ts +0 -54
  171. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/all-errors.test.ts +0 -157
  172. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/anyunknown.test.ts +0 -28
  173. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/array.test.ts +0 -71
  174. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/async-parsing.test.ts +0 -388
  175. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/async-refinements.test.ts +0 -46
  176. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/base.test.ts +0 -29
  177. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/bigint.test.ts +0 -55
  178. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/branded.test.ts +0 -53
  179. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/catch.test.ts +0 -220
  180. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/coerce.test.ts +0 -133
  181. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/complex.test.ts +0 -70
  182. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/custom.test.ts +0 -31
  183. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/date.test.ts +0 -32
  184. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/deepmasking.test.ts +0 -186
  185. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/default.test.ts +0 -112
  186. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/description.test.ts +0 -33
  187. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +0 -315
  188. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/enum.test.ts +0 -80
  189. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/error.test.ts +0 -551
  190. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/firstparty.test.ts +0 -87
  191. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +0 -21
  192. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/function.test.ts +0 -261
  193. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/generics.test.ts +0 -48
  194. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/instanceof.test.ts +0 -37
  195. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/intersection.test.ts +0 -110
  196. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/language-server.source.ts +0 -76
  197. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/language-server.test.ts +0 -207
  198. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/literal.test.ts +0 -36
  199. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/map.test.ts +0 -110
  200. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/masking.test.ts +0 -4
  201. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/mocker.test.ts +0 -19
  202. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/nan.test.ts +0 -24
  203. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/nativeEnum.test.ts +0 -87
  204. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/nullable.test.ts +0 -42
  205. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/number.test.ts +0 -176
  206. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/object-augmentation.test.ts +0 -29
  207. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +0 -29
  208. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/object.test.ts +0 -434
  209. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/optional.test.ts +0 -42
  210. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/parseUtil.test.ts +0 -23
  211. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/parser.test.ts +0 -41
  212. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/partials.test.ts +0 -243
  213. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/pickomit.test.ts +0 -111
  214. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/pipeline.test.ts +0 -29
  215. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/preprocess.test.ts +0 -186
  216. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/primitive.test.ts +0 -440
  217. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/promise.test.ts +0 -90
  218. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/readonly.test.ts +0 -194
  219. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/record.test.ts +0 -171
  220. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/recursive.test.ts +0 -197
  221. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/refine.test.ts +0 -313
  222. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/safeparse.test.ts +0 -27
  223. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/set.test.ts +0 -142
  224. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/standard-schema.test.ts +0 -83
  225. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/string.test.ts +0 -916
  226. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/transformer.test.ts +0 -233
  227. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/tuple.test.ts +0 -90
  228. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/unions.test.ts +0 -57
  229. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/validations.test.ts +0 -133
  230. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/tests/void.test.ts +0 -15
  231. package/assets/mcp/ask-user-server/node_modules/zod/src/v3/types.ts +0 -5138
  232. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/checks.ts +0 -32
  233. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/coerce.ts +0 -27
  234. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/compat.ts +0 -70
  235. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/errors.ts +0 -82
  236. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/external.ts +0 -52
  237. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/from-json-schema.ts +0 -659
  238. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/index.ts +0 -5
  239. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/iso.ts +0 -90
  240. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/parse.ts +0 -82
  241. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/schemas.ts +0 -2672
  242. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +0 -26
  243. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/apply.test.ts +0 -59
  244. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/array.test.ts +0 -264
  245. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/assignability.test.ts +0 -216
  246. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +0 -381
  247. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +0 -68
  248. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/base.test.ts +0 -7
  249. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/bigint.test.ts +0 -54
  250. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/brand.test.ts +0 -106
  251. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/catch.test.ts +0 -326
  252. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +0 -20
  253. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +0 -573
  254. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/codec.test.ts +0 -703
  255. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/coerce.test.ts +0 -160
  256. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/continuability.test.ts +0 -374
  257. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/custom.test.ts +0 -40
  258. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/date.test.ts +0 -62
  259. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/datetime.test.ts +0 -302
  260. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/default.test.ts +0 -409
  261. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +0 -27
  262. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/description.test.ts +0 -32
  263. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +0 -197
  264. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +0 -694
  265. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/enum.test.ts +0 -285
  266. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +0 -807
  267. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/error.test.ts +0 -711
  268. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/file.test.ts +0 -96
  269. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +0 -179
  270. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +0 -26
  271. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +0 -895
  272. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/function.test.ts +0 -360
  273. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/generics.test.ts +0 -72
  274. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/global-config.test.ts +0 -39
  275. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/hash.test.ts +0 -68
  276. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/index.test.ts +0 -939
  277. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +0 -60
  278. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/intersection.test.ts +0 -198
  279. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +0 -46
  280. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/json.test.ts +0 -109
  281. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/lazy.test.ts +0 -227
  282. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/literal.test.ts +0 -117
  283. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +0 -29
  284. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +0 -24
  285. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/map.test.ts +0 -330
  286. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/nan.test.ts +0 -21
  287. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +0 -168
  288. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +0 -101
  289. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/nullable.test.ts +0 -22
  290. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/number.test.ts +0 -325
  291. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/object.test.ts +0 -717
  292. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/optional.test.ts +0 -333
  293. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/partial.test.ts +0 -450
  294. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +0 -211
  295. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/pipe.test.ts +0 -101
  296. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/prefault.test.ts +0 -74
  297. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +0 -26
  298. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +0 -351
  299. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/primitive.test.ts +0 -175
  300. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/promise.test.ts +0 -81
  301. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +0 -23
  302. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/readonly.test.ts +0 -252
  303. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/record.test.ts +0 -717
  304. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +0 -631
  305. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/refine.test.ts +0 -633
  306. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/registries.test.ts +0 -243
  307. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/set.test.ts +0 -181
  308. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +0 -134
  309. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +0 -125
  310. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/string.test.ts +0 -1224
  311. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +0 -106
  312. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +0 -771
  313. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +0 -438
  314. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +0 -3125
  315. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/transform.test.ts +0 -378
  316. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/tuple.test.ts +0 -496
  317. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/union.test.ts +0 -273
  318. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/url.test.ts +0 -13
  319. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/validations.test.ts +0 -283
  320. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/classic/tests/void.test.ts +0 -12
  321. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/core/api.ts +0 -1823
  322. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/core/checks.ts +0 -1293
  323. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/core/config.ts +0 -15
  324. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/core/core.ts +0 -153
  325. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/core/doc.ts +0 -44
  326. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/core/errors.ts +0 -455
  327. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/core/index.ts +0 -16
  328. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/core/json-schema-generator.ts +0 -126
  329. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/core/json-schema-processors.ts +0 -666
  330. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/core/json-schema.ts +0 -147
  331. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/core/parse.ts +0 -195
  332. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/core/regexes.ts +0 -190
  333. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/core/registries.ts +0 -105
  334. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/core/schemas.ts +0 -4730
  335. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/core/standard-schema.ts +0 -159
  336. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/core/tests/extend.test.ts +0 -59
  337. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/core/tests/index.test.ts +0 -46
  338. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/core/tests/locales/be.test.ts +0 -124
  339. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/core/tests/locales/el.test.ts +0 -215
  340. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/core/tests/locales/en.test.ts +0 -22
  341. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/core/tests/locales/es.test.ts +0 -181
  342. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +0 -72
  343. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/core/tests/locales/he.test.ts +0 -379
  344. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +0 -163
  345. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +0 -46
  346. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +0 -128
  347. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +0 -69
  348. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +0 -105
  349. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +0 -125
  350. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +0 -45
  351. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/core/to-json-schema.ts +0 -622
  352. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/core/util.ts +0 -983
  353. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/core/versions.ts +0 -5
  354. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/core/zsf.ts +0 -323
  355. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/index.ts +0 -4
  356. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/ar.ts +0 -115
  357. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/az.ts +0 -111
  358. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/be.ts +0 -176
  359. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/bg.ts +0 -128
  360. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/ca.ts +0 -116
  361. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/cs.ts +0 -118
  362. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/da.ts +0 -123
  363. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/de.ts +0 -116
  364. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/el.ts +0 -121
  365. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/en.ts +0 -123
  366. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/eo.ts +0 -118
  367. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/es.ts +0 -141
  368. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/fa.ts +0 -126
  369. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/fi.ts +0 -121
  370. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/fr-CA.ts +0 -116
  371. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/fr.ts +0 -132
  372. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/he.ts +0 -246
  373. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/hr.ts +0 -131
  374. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/hu.ts +0 -117
  375. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/hy.ts +0 -164
  376. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/id.ts +0 -115
  377. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/index.ts +0 -52
  378. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/is.ts +0 -119
  379. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/it.ts +0 -116
  380. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/ja.ts +0 -114
  381. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/ka.ts +0 -123
  382. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/kh.ts +0 -7
  383. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/km.ts +0 -119
  384. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/ko.ts +0 -121
  385. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/lt.ts +0 -239
  386. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/mk.ts +0 -118
  387. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/ms.ts +0 -115
  388. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/nl.ts +0 -121
  389. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/no.ts +0 -116
  390. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/ota.ts +0 -117
  391. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/pl.ts +0 -118
  392. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/ps.ts +0 -126
  393. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/pt.ts +0 -116
  394. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/ro.ts +0 -129
  395. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/ru.ts +0 -176
  396. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/sl.ts +0 -118
  397. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/sv.ts +0 -119
  398. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/ta.ts +0 -118
  399. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/th.ts +0 -119
  400. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/tr.ts +0 -111
  401. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/ua.ts +0 -7
  402. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/uk.ts +0 -117
  403. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/ur.ts +0 -119
  404. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/uz.ts +0 -117
  405. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/vi.ts +0 -117
  406. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/yo.ts +0 -124
  407. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/zh-CN.ts +0 -116
  408. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/locales/zh-TW.ts +0 -115
  409. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/mini/checks.ts +0 -32
  410. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/mini/coerce.ts +0 -27
  411. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/mini/external.ts +0 -41
  412. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/mini/index.ts +0 -3
  413. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/mini/iso.ts +0 -66
  414. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/mini/parse.ts +0 -14
  415. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/mini/schemas.ts +0 -1947
  416. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/mini/tests/apply.test.ts +0 -24
  417. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/mini/tests/assignability.test.ts +0 -129
  418. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/mini/tests/brand.test.ts +0 -94
  419. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/mini/tests/checks.test.ts +0 -144
  420. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/mini/tests/codec.test.ts +0 -548
  421. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/mini/tests/computed.test.ts +0 -36
  422. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/mini/tests/error.test.ts +0 -22
  423. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/mini/tests/functions.test.ts +0 -5
  424. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/mini/tests/index.test.ts +0 -993
  425. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/mini/tests/number.test.ts +0 -95
  426. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/mini/tests/object.test.ts +0 -227
  427. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +0 -43
  428. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +0 -325
  429. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +0 -50
  430. package/assets/mcp/ask-user-server/node_modules/zod/src/v4/mini/tests/string.test.ts +0 -352
  431. package/assets/mcp/ask-user-server/node_modules/zod/src/v4-mini/index.ts +0 -3
  432. package/assets/mcp/ask-user-server/node_modules/zod/v3/ZodError.cjs +0 -138
  433. package/assets/mcp/ask-user-server/node_modules/zod/v3/ZodError.d.cts +0 -164
  434. package/assets/mcp/ask-user-server/node_modules/zod/v3/ZodError.d.ts +0 -164
  435. package/assets/mcp/ask-user-server/node_modules/zod/v3/ZodError.js +0 -133
  436. package/assets/mcp/ask-user-server/node_modules/zod/v3/errors.cjs +0 -17
  437. package/assets/mcp/ask-user-server/node_modules/zod/v3/errors.d.cts +0 -5
  438. package/assets/mcp/ask-user-server/node_modules/zod/v3/errors.d.ts +0 -5
  439. package/assets/mcp/ask-user-server/node_modules/zod/v3/errors.js +0 -9
  440. package/assets/mcp/ask-user-server/node_modules/zod/v3/external.cjs +0 -22
  441. package/assets/mcp/ask-user-server/node_modules/zod/v3/external.d.cts +0 -6
  442. package/assets/mcp/ask-user-server/node_modules/zod/v3/external.d.ts +0 -6
  443. package/assets/mcp/ask-user-server/node_modules/zod/v3/external.js +0 -6
  444. package/assets/mcp/ask-user-server/node_modules/zod/v3/helpers/enumUtil.cjs +0 -2
  445. package/assets/mcp/ask-user-server/node_modules/zod/v3/helpers/enumUtil.d.cts +0 -8
  446. package/assets/mcp/ask-user-server/node_modules/zod/v3/helpers/enumUtil.d.ts +0 -8
  447. package/assets/mcp/ask-user-server/node_modules/zod/v3/helpers/enumUtil.js +0 -1
  448. package/assets/mcp/ask-user-server/node_modules/zod/v3/helpers/errorUtil.cjs +0 -9
  449. package/assets/mcp/ask-user-server/node_modules/zod/v3/helpers/errorUtil.d.cts +0 -9
  450. package/assets/mcp/ask-user-server/node_modules/zod/v3/helpers/errorUtil.d.ts +0 -9
  451. package/assets/mcp/ask-user-server/node_modules/zod/v3/helpers/errorUtil.js +0 -6
  452. package/assets/mcp/ask-user-server/node_modules/zod/v3/helpers/parseUtil.cjs +0 -124
  453. package/assets/mcp/ask-user-server/node_modules/zod/v3/helpers/parseUtil.d.cts +0 -78
  454. package/assets/mcp/ask-user-server/node_modules/zod/v3/helpers/parseUtil.d.ts +0 -78
  455. package/assets/mcp/ask-user-server/node_modules/zod/v3/helpers/parseUtil.js +0 -109
  456. package/assets/mcp/ask-user-server/node_modules/zod/v3/helpers/partialUtil.cjs +0 -2
  457. package/assets/mcp/ask-user-server/node_modules/zod/v3/helpers/partialUtil.d.cts +0 -8
  458. package/assets/mcp/ask-user-server/node_modules/zod/v3/helpers/partialUtil.d.ts +0 -8
  459. package/assets/mcp/ask-user-server/node_modules/zod/v3/helpers/partialUtil.js +0 -1
  460. package/assets/mcp/ask-user-server/node_modules/zod/v3/helpers/typeAliases.cjs +0 -2
  461. package/assets/mcp/ask-user-server/node_modules/zod/v3/helpers/typeAliases.d.cts +0 -2
  462. package/assets/mcp/ask-user-server/node_modules/zod/v3/helpers/typeAliases.d.ts +0 -2
  463. package/assets/mcp/ask-user-server/node_modules/zod/v3/helpers/typeAliases.js +0 -1
  464. package/assets/mcp/ask-user-server/node_modules/zod/v3/helpers/util.cjs +0 -137
  465. package/assets/mcp/ask-user-server/node_modules/zod/v3/helpers/util.d.cts +0 -85
  466. package/assets/mcp/ask-user-server/node_modules/zod/v3/helpers/util.d.ts +0 -85
  467. package/assets/mcp/ask-user-server/node_modules/zod/v3/helpers/util.js +0 -133
  468. package/assets/mcp/ask-user-server/node_modules/zod/v3/index.cjs +0 -33
  469. package/assets/mcp/ask-user-server/node_modules/zod/v3/index.d.cts +0 -4
  470. package/assets/mcp/ask-user-server/node_modules/zod/v3/index.d.ts +0 -4
  471. package/assets/mcp/ask-user-server/node_modules/zod/v3/index.js +0 -4
  472. package/assets/mcp/ask-user-server/node_modules/zod/v3/locales/en.cjs +0 -112
  473. package/assets/mcp/ask-user-server/node_modules/zod/v3/locales/en.d.cts +0 -3
  474. package/assets/mcp/ask-user-server/node_modules/zod/v3/locales/en.d.ts +0 -3
  475. package/assets/mcp/ask-user-server/node_modules/zod/v3/locales/en.js +0 -109
  476. package/assets/mcp/ask-user-server/node_modules/zod/v3/package.json +0 -7
  477. package/assets/mcp/ask-user-server/node_modules/zod/v3/standard-schema.cjs +0 -2
  478. package/assets/mcp/ask-user-server/node_modules/zod/v3/standard-schema.d.cts +0 -102
  479. package/assets/mcp/ask-user-server/node_modules/zod/v3/standard-schema.d.ts +0 -102
  480. package/assets/mcp/ask-user-server/node_modules/zod/v3/standard-schema.js +0 -1
  481. package/assets/mcp/ask-user-server/node_modules/zod/v3/types.cjs +0 -3777
  482. package/assets/mcp/ask-user-server/node_modules/zod/v3/types.d.cts +0 -1034
  483. package/assets/mcp/ask-user-server/node_modules/zod/v3/types.d.ts +0 -1034
  484. package/assets/mcp/ask-user-server/node_modules/zod/v3/types.js +0 -3695
  485. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/checks.cjs +0 -33
  486. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/checks.d.cts +0 -1
  487. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/checks.d.ts +0 -1
  488. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/checks.js +0 -1
  489. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/coerce.cjs +0 -47
  490. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/coerce.d.cts +0 -17
  491. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/coerce.d.ts +0 -17
  492. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/coerce.js +0 -17
  493. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/compat.cjs +0 -61
  494. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/compat.d.cts +0 -50
  495. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/compat.d.ts +0 -50
  496. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/compat.js +0 -31
  497. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/errors.cjs +0 -74
  498. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/errors.d.cts +0 -30
  499. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/errors.d.ts +0 -30
  500. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/errors.js +0 -48
  501. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/external.cjs +0 -73
  502. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/external.d.cts +0 -16
  503. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/external.d.ts +0 -16
  504. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/external.js +0 -20
  505. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/from-json-schema.cjs +0 -625
  506. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/from-json-schema.d.cts +0 -12
  507. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/from-json-schema.d.ts +0 -12
  508. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/from-json-schema.js +0 -599
  509. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/index.cjs +0 -33
  510. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/index.d.cts +0 -4
  511. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/index.d.ts +0 -4
  512. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/index.js +0 -4
  513. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/iso.cjs +0 -60
  514. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/iso.d.cts +0 -22
  515. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/iso.d.ts +0 -22
  516. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/iso.js +0 -30
  517. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/package.json +0 -7
  518. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/parse.cjs +0 -41
  519. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/parse.d.cts +0 -31
  520. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/parse.d.ts +0 -31
  521. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/parse.js +0 -15
  522. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/schemas.cjs +0 -1511
  523. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/schemas.d.cts +0 -767
  524. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/schemas.d.ts +0 -767
  525. package/assets/mcp/ask-user-server/node_modules/zod/v4/classic/schemas.js +0 -1395
  526. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/api.cjs +0 -1227
  527. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/api.d.cts +0 -325
  528. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/api.d.ts +0 -325
  529. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/api.js +0 -1087
  530. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/checks.cjs +0 -601
  531. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/checks.d.cts +0 -278
  532. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/checks.d.ts +0 -278
  533. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/checks.js +0 -575
  534. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/core.cjs +0 -85
  535. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/core.d.cts +0 -70
  536. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/core.d.ts +0 -70
  537. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/core.js +0 -78
  538. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/doc.cjs +0 -39
  539. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/doc.d.cts +0 -14
  540. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/doc.d.ts +0 -14
  541. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/doc.js +0 -35
  542. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/errors.cjs +0 -216
  543. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/errors.d.cts +0 -221
  544. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/errors.d.ts +0 -221
  545. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/errors.js +0 -185
  546. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/index.cjs +0 -47
  547. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/index.d.cts +0 -16
  548. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/index.d.ts +0 -16
  549. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/index.js +0 -16
  550. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/json-schema-generator.cjs +0 -99
  551. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/json-schema-generator.d.cts +0 -65
  552. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/json-schema-generator.d.ts +0 -65
  553. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/json-schema-generator.js +0 -95
  554. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/json-schema-processors.cjs +0 -644
  555. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/json-schema-processors.d.cts +0 -49
  556. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/json-schema-processors.d.ts +0 -49
  557. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/json-schema-processors.js +0 -601
  558. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/json-schema.cjs +0 -2
  559. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/json-schema.d.cts +0 -88
  560. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/json-schema.d.ts +0 -88
  561. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/json-schema.js +0 -1
  562. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/package.json +0 -7
  563. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/parse.cjs +0 -131
  564. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/parse.d.cts +0 -49
  565. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/parse.d.ts +0 -49
  566. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/parse.js +0 -93
  567. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/regexes.cjs +0 -172
  568. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/regexes.d.cts +0 -85
  569. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/regexes.d.ts +0 -85
  570. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/regexes.js +0 -139
  571. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/registries.cjs +0 -56
  572. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/registries.d.cts +0 -35
  573. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/registries.d.ts +0 -35
  574. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/registries.js +0 -51
  575. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/schemas.cjs +0 -2270
  576. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/schemas.d.cts +0 -1184
  577. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/schemas.d.ts +0 -1184
  578. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/schemas.js +0 -2239
  579. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/standard-schema.cjs +0 -2
  580. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/standard-schema.d.cts +0 -126
  581. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/standard-schema.d.ts +0 -126
  582. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/standard-schema.js +0 -1
  583. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/to-json-schema.cjs +0 -457
  584. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/to-json-schema.d.cts +0 -114
  585. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/to-json-schema.d.ts +0 -114
  586. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/to-json-schema.js +0 -448
  587. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/util.cjs +0 -734
  588. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/util.d.cts +0 -200
  589. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/util.d.ts +0 -200
  590. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/util.js +0 -674
  591. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/versions.cjs +0 -8
  592. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/versions.d.cts +0 -5
  593. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/versions.d.ts +0 -5
  594. package/assets/mcp/ask-user-server/node_modules/zod/v4/core/versions.js +0 -5
  595. package/assets/mcp/ask-user-server/node_modules/zod/v4/index.cjs +0 -22
  596. package/assets/mcp/ask-user-server/node_modules/zod/v4/index.d.cts +0 -3
  597. package/assets/mcp/ask-user-server/node_modules/zod/v4/index.d.ts +0 -3
  598. package/assets/mcp/ask-user-server/node_modules/zod/v4/index.js +0 -3
  599. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ar.cjs +0 -133
  600. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ar.d.cts +0 -5
  601. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ar.d.ts +0 -4
  602. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ar.js +0 -106
  603. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/az.cjs +0 -132
  604. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/az.d.cts +0 -5
  605. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/az.d.ts +0 -4
  606. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/az.js +0 -105
  607. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/be.cjs +0 -183
  608. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/be.d.cts +0 -5
  609. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/be.d.ts +0 -4
  610. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/be.js +0 -156
  611. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/bg.cjs +0 -147
  612. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/bg.d.cts +0 -5
  613. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/bg.d.ts +0 -4
  614. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/bg.js +0 -120
  615. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ca.cjs +0 -134
  616. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ca.d.cts +0 -5
  617. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ca.d.ts +0 -4
  618. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ca.js +0 -107
  619. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/cs.cjs +0 -138
  620. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/cs.d.cts +0 -5
  621. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/cs.d.ts +0 -4
  622. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/cs.js +0 -111
  623. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/da.cjs +0 -142
  624. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/da.d.cts +0 -5
  625. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/da.d.ts +0 -4
  626. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/da.js +0 -115
  627. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/de.cjs +0 -135
  628. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/de.d.cts +0 -5
  629. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/de.d.ts +0 -4
  630. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/de.js +0 -108
  631. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/el.cjs +0 -136
  632. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/el.d.cts +0 -5
  633. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/el.d.ts +0 -4
  634. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/el.js +0 -109
  635. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/en.cjs +0 -140
  636. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/en.d.cts +0 -5
  637. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/en.d.ts +0 -4
  638. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/en.js +0 -113
  639. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/eo.cjs +0 -136
  640. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/eo.d.cts +0 -5
  641. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/eo.d.ts +0 -4
  642. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/eo.js +0 -109
  643. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/es.cjs +0 -159
  644. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/es.d.cts +0 -5
  645. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/es.d.ts +0 -4
  646. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/es.js +0 -132
  647. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/fa.cjs +0 -141
  648. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/fa.d.cts +0 -5
  649. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/fa.d.ts +0 -4
  650. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/fa.js +0 -114
  651. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/fi.cjs +0 -139
  652. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/fi.d.cts +0 -5
  653. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/fi.d.ts +0 -4
  654. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/fi.js +0 -112
  655. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/fr-CA.cjs +0 -134
  656. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/fr-CA.d.cts +0 -5
  657. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/fr-CA.d.ts +0 -4
  658. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/fr-CA.js +0 -107
  659. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/fr.cjs +0 -152
  660. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/fr.d.cts +0 -5
  661. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/fr.d.ts +0 -4
  662. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/fr.js +0 -125
  663. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/he.cjs +0 -241
  664. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/he.d.cts +0 -5
  665. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/he.d.ts +0 -4
  666. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/he.js +0 -214
  667. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/hr.cjs +0 -149
  668. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/hr.d.cts +0 -5
  669. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/hr.d.ts +0 -4
  670. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/hr.js +0 -122
  671. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/hu.cjs +0 -135
  672. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/hu.d.cts +0 -5
  673. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/hu.d.ts +0 -4
  674. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/hu.js +0 -108
  675. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/hy.cjs +0 -174
  676. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/hy.d.cts +0 -5
  677. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/hy.d.ts +0 -4
  678. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/hy.js +0 -147
  679. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/id.cjs +0 -133
  680. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/id.d.cts +0 -5
  681. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/id.d.ts +0 -4
  682. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/id.js +0 -106
  683. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/index.cjs +0 -111
  684. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/index.d.cts +0 -52
  685. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/index.d.ts +0 -52
  686. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/index.js +0 -52
  687. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/is.cjs +0 -136
  688. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/is.d.cts +0 -5
  689. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/is.d.ts +0 -4
  690. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/is.js +0 -109
  691. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/it.cjs +0 -135
  692. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/it.d.cts +0 -5
  693. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/it.d.ts +0 -4
  694. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/it.js +0 -108
  695. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ja.cjs +0 -134
  696. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ja.d.cts +0 -5
  697. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ja.d.ts +0 -4
  698. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ja.js +0 -107
  699. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ka.cjs +0 -139
  700. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ka.d.cts +0 -5
  701. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ka.d.ts +0 -4
  702. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ka.js +0 -112
  703. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/kh.cjs +0 -12
  704. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/kh.d.cts +0 -5
  705. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/kh.d.ts +0 -5
  706. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/kh.js +0 -5
  707. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/km.cjs +0 -137
  708. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/km.d.cts +0 -5
  709. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/km.d.ts +0 -4
  710. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/km.js +0 -110
  711. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ko.cjs +0 -138
  712. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ko.d.cts +0 -5
  713. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ko.d.ts +0 -4
  714. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ko.js +0 -111
  715. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/lt.cjs +0 -230
  716. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/lt.d.cts +0 -5
  717. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/lt.d.ts +0 -4
  718. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/lt.js +0 -203
  719. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/mk.cjs +0 -136
  720. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/mk.d.cts +0 -5
  721. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/mk.d.ts +0 -4
  722. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/mk.js +0 -109
  723. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ms.cjs +0 -134
  724. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ms.d.cts +0 -5
  725. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ms.d.ts +0 -4
  726. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ms.js +0 -107
  727. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/nl.cjs +0 -137
  728. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/nl.d.cts +0 -5
  729. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/nl.d.ts +0 -4
  730. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/nl.js +0 -110
  731. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/no.cjs +0 -135
  732. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/no.d.cts +0 -5
  733. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/no.d.ts +0 -4
  734. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/no.js +0 -108
  735. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ota.cjs +0 -136
  736. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ota.d.cts +0 -5
  737. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ota.d.ts +0 -4
  738. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ota.js +0 -109
  739. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/package.json +0 -7
  740. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/pl.cjs +0 -136
  741. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/pl.d.cts +0 -5
  742. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/pl.d.ts +0 -4
  743. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/pl.js +0 -109
  744. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ps.cjs +0 -141
  745. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ps.d.cts +0 -5
  746. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ps.d.ts +0 -4
  747. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ps.js +0 -114
  748. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/pt.cjs +0 -135
  749. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/pt.d.cts +0 -5
  750. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/pt.d.ts +0 -4
  751. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/pt.js +0 -108
  752. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ro.cjs +0 -146
  753. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ro.d.cts +0 -5
  754. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ro.d.ts +0 -4
  755. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ro.js +0 -119
  756. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ru.cjs +0 -183
  757. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ru.d.cts +0 -5
  758. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ru.d.ts +0 -4
  759. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ru.js +0 -156
  760. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/sl.cjs +0 -136
  761. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/sl.d.cts +0 -5
  762. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/sl.d.ts +0 -4
  763. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/sl.js +0 -109
  764. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/sv.cjs +0 -137
  765. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/sv.d.cts +0 -5
  766. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/sv.d.ts +0 -4
  767. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/sv.js +0 -110
  768. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ta.cjs +0 -137
  769. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ta.d.cts +0 -5
  770. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ta.d.ts +0 -4
  771. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ta.js +0 -110
  772. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/th.cjs +0 -137
  773. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/th.d.cts +0 -5
  774. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/th.d.ts +0 -4
  775. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/th.js +0 -110
  776. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/tr.cjs +0 -132
  777. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/tr.d.cts +0 -5
  778. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/tr.d.ts +0 -4
  779. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/tr.js +0 -105
  780. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ua.cjs +0 -12
  781. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ua.d.cts +0 -5
  782. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ua.d.ts +0 -5
  783. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ua.js +0 -5
  784. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/uk.cjs +0 -135
  785. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/uk.d.cts +0 -5
  786. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/uk.d.ts +0 -4
  787. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/uk.js +0 -108
  788. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ur.cjs +0 -137
  789. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ur.d.cts +0 -5
  790. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ur.d.ts +0 -4
  791. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/ur.js +0 -110
  792. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/uz.cjs +0 -137
  793. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/uz.d.cts +0 -5
  794. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/uz.d.ts +0 -4
  795. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/uz.js +0 -110
  796. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/vi.cjs +0 -135
  797. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/vi.d.cts +0 -5
  798. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/vi.d.ts +0 -4
  799. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/vi.js +0 -108
  800. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/yo.cjs +0 -134
  801. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/yo.d.cts +0 -5
  802. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/yo.d.ts +0 -4
  803. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/yo.js +0 -107
  804. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/zh-CN.cjs +0 -136
  805. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/zh-CN.d.cts +0 -5
  806. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/zh-CN.d.ts +0 -4
  807. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/zh-CN.js +0 -109
  808. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/zh-TW.cjs +0 -134
  809. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/zh-TW.d.cts +0 -5
  810. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/zh-TW.d.ts +0 -4
  811. package/assets/mcp/ask-user-server/node_modules/zod/v4/locales/zh-TW.js +0 -107
  812. package/assets/mcp/ask-user-server/node_modules/zod/v4/mini/checks.cjs +0 -34
  813. package/assets/mcp/ask-user-server/node_modules/zod/v4/mini/checks.d.cts +0 -1
  814. package/assets/mcp/ask-user-server/node_modules/zod/v4/mini/checks.d.ts +0 -1
  815. package/assets/mcp/ask-user-server/node_modules/zod/v4/mini/checks.js +0 -1
  816. package/assets/mcp/ask-user-server/node_modules/zod/v4/mini/coerce.cjs +0 -52
  817. package/assets/mcp/ask-user-server/node_modules/zod/v4/mini/coerce.d.cts +0 -7
  818. package/assets/mcp/ask-user-server/node_modules/zod/v4/mini/coerce.d.ts +0 -7
  819. package/assets/mcp/ask-user-server/node_modules/zod/v4/mini/coerce.js +0 -22
  820. package/assets/mcp/ask-user-server/node_modules/zod/v4/mini/external.cjs +0 -63
  821. package/assets/mcp/ask-user-server/node_modules/zod/v4/mini/external.d.cts +0 -13
  822. package/assets/mcp/ask-user-server/node_modules/zod/v4/mini/external.d.ts +0 -13
  823. package/assets/mcp/ask-user-server/node_modules/zod/v4/mini/external.js +0 -14
  824. package/assets/mcp/ask-user-server/node_modules/zod/v4/mini/index.cjs +0 -32
  825. package/assets/mcp/ask-user-server/node_modules/zod/v4/mini/index.d.cts +0 -3
  826. package/assets/mcp/ask-user-server/node_modules/zod/v4/mini/index.d.ts +0 -3
  827. package/assets/mcp/ask-user-server/node_modules/zod/v4/mini/index.js +0 -3
  828. package/assets/mcp/ask-user-server/node_modules/zod/v4/mini/iso.cjs +0 -64
  829. package/assets/mcp/ask-user-server/node_modules/zod/v4/mini/iso.d.cts +0 -22
  830. package/assets/mcp/ask-user-server/node_modules/zod/v4/mini/iso.d.ts +0 -22
  831. package/assets/mcp/ask-user-server/node_modules/zod/v4/mini/iso.js +0 -34
  832. package/assets/mcp/ask-user-server/node_modules/zod/v4/mini/package.json +0 -7
  833. package/assets/mcp/ask-user-server/node_modules/zod/v4/mini/parse.cjs +0 -16
  834. package/assets/mcp/ask-user-server/node_modules/zod/v4/mini/parse.d.cts +0 -1
  835. package/assets/mcp/ask-user-server/node_modules/zod/v4/mini/parse.d.ts +0 -1
  836. package/assets/mcp/ask-user-server/node_modules/zod/v4/mini/parse.js +0 -1
  837. package/assets/mcp/ask-user-server/node_modules/zod/v4/mini/schemas.cjs +0 -1083
  838. package/assets/mcp/ask-user-server/node_modules/zod/v4/mini/schemas.d.cts +0 -445
  839. package/assets/mcp/ask-user-server/node_modules/zod/v4/mini/schemas.d.ts +0 -445
  840. package/assets/mcp/ask-user-server/node_modules/zod/v4/mini/schemas.js +0 -961
  841. package/assets/mcp/ask-user-server/node_modules/zod/v4/package.json +0 -7
  842. package/assets/mcp/ask-user-server/node_modules/zod/v4-mini/index.cjs +0 -32
  843. package/assets/mcp/ask-user-server/node_modules/zod/v4-mini/index.d.cts +0 -3
  844. package/assets/mcp/ask-user-server/node_modules/zod/v4-mini/index.d.ts +0 -3
  845. package/assets/mcp/ask-user-server/node_modules/zod/v4-mini/index.js +0 -3
  846. package/assets/mcp/ask-user-server/node_modules/zod/v4-mini/package.json +0 -7
  847. package/assets/mcp/ask-user-server/package-lock.json +0 -50
  848. package/assets/mcp/ask-user-server/package.json +0 -10
  849. package/assets/skills/brainstorming/SKILL.md +0 -153
  850. package/assets/skills/openspec-explore/SKILL.md +0 -288
@@ -1,4013 +0,0 @@
1
- import { i as jsonSchemaValidator } from "./types-mS0yxCL0.mjs";
2
- import { AnnotationsSchema, AudioContentSchema, AuthorizationServerMetadata, BAGGAGE_META_KEY, BaseMetadataSchema, BaseRequestParamsSchema, BlobResourceContentsSchema, BooleanSchemaSchema, CLIENT_CAPABILITIES_META_KEY, CLIENT_INFO_META_KEY, CallToolRequestParamsSchema, CallToolRequestSchema, CallToolResultSchema, CancelTaskRequestSchema, CancelTaskResultSchema, CancelledNotificationParamsSchema, CancelledNotificationSchema, ClientCapabilitiesSchema, ClientNotificationSchema, ClientRequestSchema, ClientResultSchema, ClientTasksCapabilitySchema, CompatibilityCallToolResultSchema, CompleteRequestParamsSchema, CompleteRequestSchema, CompleteResultSchema, ContentBlockSchema, CreateMessageRequestParamsSchema, CreateMessageRequestSchema, CreateMessageResultSchema, CreateMessageResultWithToolsSchema, CreateTaskResultSchema, CursorSchema, DEFAULT_NEGOTIATED_PROTOCOL_VERSION, DiscoverRequestSchema, DiscoverResultSchema, ElicitRequestFormParamsSchema, ElicitRequestParamsSchema, ElicitRequestSchema, ElicitRequestURLParamsSchema, ElicitResultSchema, ElicitationCompleteNotificationParamsSchema, ElicitationCompleteNotificationSchema, EmbeddedResourceSchema, EmptyResultSchema, EnumSchemaSchema, GetPromptRequestParamsSchema, GetPromptRequestSchema, GetPromptResultSchema, GetTaskPayloadRequestSchema, GetTaskPayloadResultSchema, GetTaskRequestSchema, GetTaskResultSchema, INTERNAL_ERROR, INVALID_PARAMS, INVALID_REQUEST, IconSchema, IconsSchema, IdJagTokenExchangeResponse, ImageContentSchema, ImplementationSchema, InitializeRequestParamsSchema, InitializeRequestSchema, InitializeResultSchema, InitializedNotificationSchema, JSONArray, JSONArraySchema, JSONObject, JSONObjectSchema, JSONRPCErrorResponseSchema, JSONRPCMessageSchema, JSONRPCNotificationSchema, JSONRPCRequestSchema, JSONRPCResponseSchema, JSONRPCResultResponseSchema, JSONRPC_VERSION, JSONValue, JSONValueSchema, LATEST_PROTOCOL_VERSION, LOG_LEVEL_META_KEY, LegacyTitledEnumSchemaSchema, ListChangedOptionsBaseSchema, ListPromptsRequestSchema, ListPromptsResultSchema, ListResourceTemplatesRequestSchema, ListResourceTemplatesResultSchema, ListResourcesRequestSchema, ListResourcesResultSchema, ListRootsRequestSchema, ListRootsResultSchema, ListTasksRequestSchema, ListTasksResultSchema, ListToolsRequestSchema, ListToolsResultSchema, LoggingLevelSchema, LoggingMessageNotificationParamsSchema, LoggingMessageNotificationSchema, METHOD_NOT_FOUND, ModelHintSchema, ModelPreferencesSchema, MultiSelectEnumSchemaSchema, NotificationSchema, NotificationsParamsSchema, NumberSchemaSchema, OAuthClientInformation, OAuthClientInformationFull, OAuthClientInformationMixed, OAuthClientMetadata, OAuthClientRegistrationError, OAuthErrorResponse, OAuthMetadata, OAuthProtectedResourceMetadata, OAuthTokenRevocationRequest, OAuthTokens, OpenIdProviderDiscoveryMetadata, OpenIdProviderMetadata, PARSE_ERROR, PROTOCOL_VERSION_META_KEY, PaginatedRequestParamsSchema, PaginatedRequestSchema, PaginatedResultSchema, PingRequestSchema, PrimitiveSchemaDefinitionSchema, ProgressNotificationParamsSchema, ProgressNotificationSchema, ProgressSchema, ProgressTokenSchema, PromptArgumentSchema, PromptListChangedNotificationSchema, PromptMessageSchema, PromptReferenceSchema, PromptSchema, RELATED_TASK_META_KEY, ReadResourceRequestParamsSchema, ReadResourceRequestSchema, ReadResourceResultSchema, RelatedTaskMetadataSchema, RequestIdSchema, RequestMetaSchema, RequestSchema, ResourceContentsSchema, ResourceLinkSchema, ResourceListChangedNotificationSchema, ResourceRequestParamsSchema, ResourceSchema, ResourceTemplateReferenceSchema, ResourceTemplateSchema, ResourceUpdatedNotificationParamsSchema, ResourceUpdatedNotificationSchema, ResultSchema, RoleSchema, RootSchema, RootsListChangedNotificationSchema, SUBSCRIPTION_ID_META_KEY, SUPPORTED_PROTOCOL_VERSIONS, SamplingContentSchema, SamplingMessageContentBlockSchema, SamplingMessageSchema, ServerCapabilitiesSchema, ServerNotificationSchema, ServerRequestSchema, ServerResultSchema, ServerTasksCapabilitySchema, SetLevelRequestParamsSchema, SetLevelRequestSchema, SingleSelectEnumSchemaSchema, StoredOAuthClientInformation, StoredOAuthTokens, StringSchemaSchema, SubscribeRequestParamsSchema, SubscribeRequestSchema, SubscriptionFilterSchema, SubscriptionsAcknowledgedNotificationParamsSchema, SubscriptionsAcknowledgedNotificationSchema, SubscriptionsListenRequestParamsSchema, SubscriptionsListenRequestSchema, SubscriptionsListenResultMetaSchema, SubscriptionsListenResultSchema, TRACEPARENT_META_KEY, TRACESTATE_META_KEY, TaskAugmentedRequestParamsSchema, TaskCreationParamsSchema, TaskMetadataSchema, TaskSchema, TaskStatusNotificationParamsSchema, TaskStatusNotificationSchema, TaskStatusSchema, TextContentSchema, TextResourceContentsSchema, TitledMultiSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema, ToolAnnotationsSchema, ToolChoiceSchema, ToolExecutionSchema, ToolListChangedNotificationSchema, ToolResultContentSchema, ToolSchema, ToolUseContentSchema, UnsubscribeRequestParamsSchema, UnsubscribeRequestSchema, UntitledMultiSelectEnumSchemaSchema, UntitledSingleSelectEnumSchemaSchema } from "@modelcontextprotocol/core/internal";
3
- import * as z from "zod/v4";
4
-
5
- //#region ../core-internal/src/auth/errors.d.ts
6
- /**
7
- * OAuth error codes as defined by {@link https://datatracker.ietf.org/doc/html/rfc6749#section-5.2 | RFC 6749}
8
- * and extensions.
9
- */
10
- declare enum OAuthErrorCode {
11
- /**
12
- * The request is missing a required parameter, includes an invalid parameter value,
13
- * includes a parameter more than once, or is otherwise malformed.
14
- */
15
- InvalidRequest = "invalid_request",
16
- /**
17
- * Client authentication failed (e.g., unknown client, no client authentication included,
18
- * or unsupported authentication method).
19
- */
20
- InvalidClient = "invalid_client",
21
- /**
22
- * The provided authorization grant or refresh token is invalid, expired, revoked,
23
- * does not match the redirection URI used in the authorization request, or was issued to another client.
24
- */
25
- InvalidGrant = "invalid_grant",
26
- /**
27
- * The authenticated client is not authorized to use this authorization grant type.
28
- */
29
- UnauthorizedClient = "unauthorized_client",
30
- /**
31
- * The authorization grant type is not supported by the authorization server.
32
- */
33
- UnsupportedGrantType = "unsupported_grant_type",
34
- /**
35
- * The requested scope is invalid, unknown, malformed, or exceeds the scope granted by the resource owner.
36
- */
37
- InvalidScope = "invalid_scope",
38
- /**
39
- * The resource owner or authorization server denied the request.
40
- */
41
- AccessDenied = "access_denied",
42
- /**
43
- * The authorization server encountered an unexpected condition that prevented it from fulfilling the request.
44
- */
45
- ServerError = "server_error",
46
- /**
47
- * The authorization server is currently unable to handle the request due to temporary overloading or maintenance.
48
- */
49
- TemporarilyUnavailable = "temporarily_unavailable",
50
- /**
51
- * The authorization server does not support obtaining an authorization code using this method.
52
- */
53
- UnsupportedResponseType = "unsupported_response_type",
54
- /**
55
- * The authorization server does not support the requested token type.
56
- */
57
- UnsupportedTokenType = "unsupported_token_type",
58
- /**
59
- * The access token provided is expired, revoked, malformed, or invalid for other reasons.
60
- */
61
- InvalidToken = "invalid_token",
62
- /**
63
- * The HTTP method used is not allowed for this endpoint. (Custom, non-standard error)
64
- */
65
- MethodNotAllowed = "method_not_allowed",
66
- /**
67
- * Rate limit exceeded. (Custom, non-standard error based on RFC 6585)
68
- */
69
- TooManyRequests = "too_many_requests",
70
- /**
71
- * The client metadata is invalid. (Custom error for dynamic client registration - RFC 7591)
72
- */
73
- InvalidClientMetadata = "invalid_client_metadata",
74
- /**
75
- * The value of one or more redirection URIs is invalid. (Dynamic client registration - RFC 7591 §3.2.2)
76
- */
77
- InvalidRedirectUri = "invalid_redirect_uri",
78
- /**
79
- * The request requires higher privileges than provided by the access token.
80
- */
81
- InsufficientScope = "insufficient_scope",
82
- /**
83
- * The requested resource is invalid, missing, unknown, or malformed. (Custom error for resource indicators - RFC 8707)
84
- */
85
- InvalidTarget = "invalid_target",
86
- }
87
- /**
88
- * OAuth error class for all OAuth-related errors.
89
- */
90
- declare class OAuthError extends Error {
91
- readonly code: OAuthErrorCode | string;
92
- readonly errorUri?: string | undefined;
93
- static [Symbol.hasInstance](value: unknown): boolean;
94
- /**
95
- * Brand-based type guard: equivalent to `value instanceof this`, as an
96
- * explicit static predicate (the axios/AWS-SDK `isInstance` style). Reads
97
- * the caller's own brand via `this`, so every branded subclass gets a
98
- * correctly-scoped guard by inheritance. Must be invoked on the class —
99
- * in callback position write `v => SdkError.isInstance(v)`, not
100
- * `.filter(SdkError.isInstance)` (detached calls throw rather than
101
- * silently matching nothing).
102
- */
103
- static isInstance<T$1 extends abstract new (...args: never[]) => unknown>(this: T$1, value: unknown): value is InstanceType<T$1>;
104
- constructor(code: OAuthErrorCode | string, message: string, errorUri?: string | undefined);
105
- /**
106
- * Converts the error to a standard OAuth error response object.
107
- */
108
- toResponseObject(): OAuthErrorResponse;
109
- /**
110
- * Creates an {@linkcode OAuthError} from an OAuth error response.
111
- */
112
- static fromResponse(response: OAuthErrorResponse): OAuthError;
113
- }
114
- //#endregion
115
- //#region ../core-internal/src/errors/sdkErrors.d.ts
116
- /**
117
- * Error codes for SDK errors (local errors that never cross the wire).
118
- * Unlike {@linkcode ProtocolErrorCode} which uses numeric JSON-RPC codes, `SdkErrorCode` uses
119
- * descriptive string values for better developer experience.
120
- *
121
- * These errors are thrown locally by the SDK and are never serialized as
122
- * JSON-RPC error responses.
123
- */
124
- declare enum SdkErrorCode {
125
- /** Transport is not connected */
126
- NotConnected = "NOT_CONNECTED",
127
- /** Transport is already connected */
128
- AlreadyConnected = "ALREADY_CONNECTED",
129
- /** Protocol is not initialized */
130
- NotInitialized = "NOT_INITIALIZED",
131
- /** Required capability is not supported by the remote side */
132
- CapabilityNotSupported = "CAPABILITY_NOT_SUPPORTED",
133
- /** Request timed out waiting for response */
134
- RequestTimeout = "REQUEST_TIMEOUT",
135
- /** Connection was closed */
136
- ConnectionClosed = "CONNECTION_CLOSED",
137
- /** Failed to send message */
138
- SendFailed = "SEND_FAILED",
139
- /** Response result failed local schema validation */
140
- InvalidResult = "INVALID_RESULT",
141
- /**
142
- * The response carried a `resultType` discriminator (protocol revision
143
- * 2026-07-28) naming a result kind this client cannot consume yet, e.g.
144
- * `input_required`. The kind is carried in `data.resultType`.
145
- */
146
- UnsupportedResultType = "UNSUPPORTED_RESULT_TYPE",
147
- /**
148
- * The multi-round-trip auto-fulfilment driver exhausted its round cap
149
- * (`inputRequired.maxRounds`) without the server returning a complete
150
- * result. `data.rounds` carries the cap that was hit and
151
- * `data.lastResult` carries the last `input_required` payload received
152
- * (`{ inputRequests, requestState? }`), so callers can inspect or resume
153
- * the flow manually.
154
- */
155
- InputRequiredRoundsExceeded = "INPUT_REQUIRED_ROUNDS_EXCEEDED",
156
- /**
157
- * The auto-aggregating no-`cursor` `listTools()` / `listPrompts()` /
158
- * `listResources()` / `listResourceTemplates()` walk hit the
159
- * `ClientOptions.listMaxPages` cap without the server's pagination
160
- * converging. `data.method` carries the list verb and
161
- * `data.listMaxPages` the cap that was hit; raise the cap or fall back to
162
- * explicit per-page `{ cursor }` calls.
163
- */
164
- ListPaginationExceeded = "LIST_PAGINATION_EXCEEDED",
165
- /**
166
- * The spec method being sent does not exist on the negotiated protocol
167
- * version's wire era (e.g. `tasks/get` toward a 2026-07-28 peer, or
168
- * `server/discover` toward a 2025-era peer). Raised locally, before
169
- * anything reaches the transport. The method and era are carried in
170
- * `data.method` / `data.era`.
171
- */
172
- MethodNotSupportedByProtocolVersion = "METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",
173
- /**
174
- * Protocol-era negotiation at connect time failed without producing either a
175
- * usable modern (2026-07-28+) era or a definitive legacy fallback signal —
176
- * e.g. the negotiation mode forbids falling back (`pin`), or the probe hit a
177
- * network failure (a typed connect error, never an era verdict).
178
- *
179
- * Negotiation-phase only: this code is never used once an era is established.
180
- */
181
- EraNegotiationFailed = "ERA_NEGOTIATION_FAILED",
182
- ClientHttpNotImplemented = "CLIENT_HTTP_NOT_IMPLEMENTED",
183
- ClientHttpAuthentication = "CLIENT_HTTP_AUTHENTICATION",
184
- ClientHttpForbidden = "CLIENT_HTTP_FORBIDDEN",
185
- ClientHttpUnexpectedContent = "CLIENT_HTTP_UNEXPECTED_CONTENT",
186
- ClientHttpFailedToOpenStream = "CLIENT_HTTP_FAILED_TO_OPEN_STREAM",
187
- ClientHttpFailedToTerminateSession = "CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",
188
- }
189
- /**
190
- * SDK errors are local errors that never cross the wire.
191
- * They are distinct from {@linkcode ProtocolError} which represents JSON-RPC protocol errors
192
- * that are serialized and sent as error responses.
193
- *
194
- * @example
195
- * ```ts source="./sdkErrors.examples.ts#SdkError_basicUsage"
196
- * try {
197
- * // Throwing an SDK error
198
- * throw new SdkError(SdkErrorCode.NotConnected, 'Transport is not connected');
199
- * } catch (error) {
200
- * // Checking error type by code
201
- * if (error instanceof SdkError && error.code === SdkErrorCode.RequestTimeout) {
202
- * // Handle timeout
203
- * }
204
- * }
205
- * ```
206
- */
207
- declare class SdkError extends Error {
208
- readonly code: SdkErrorCode;
209
- readonly data?: unknown | undefined;
210
- static [Symbol.hasInstance](value: unknown): boolean;
211
- /**
212
- * Brand-based type guard: equivalent to `value instanceof this`, as an
213
- * explicit static predicate (the axios/AWS-SDK `isInstance` style). Reads
214
- * the caller's own brand via `this`, so every branded subclass gets a
215
- * correctly-scoped guard by inheritance. Must be invoked on the class —
216
- * in callback position write `v => SdkError.isInstance(v)`, not
217
- * `.filter(SdkError.isInstance)` (detached calls throw rather than
218
- * silently matching nothing).
219
- */
220
- static isInstance<T$1 extends abstract new (...args: never[]) => unknown>(this: T$1, value: unknown): value is InstanceType<T$1>;
221
- constructor(code: SdkErrorCode, message: string, data?: unknown | undefined);
222
- }
223
- /**
224
- * Typed shape for HTTP error data carried by {@linkcode SdkHttpError}.
225
- */
226
- interface SdkHttpErrorData {
227
- status: number;
228
- statusText?: string;
229
- [key: string]: unknown;
230
- }
231
- /**
232
- * An {@linkcode SdkError} subclass for HTTP transport failures.
233
- *
234
- * Thrown by the streamable HTTP transport when the server responds with a
235
- * non-OK status code. Narrows {@linkcode SdkError.data | data} to
236
- * {@linkcode SdkHttpErrorData} so consumers can inspect the HTTP status
237
- * without unsafe casting.
238
- *
239
- * @example
240
- * ```ts source="./sdkErrors.examples.ts#SdkHttpError_basicUsage"
241
- * if (error instanceof SdkHttpError) {
242
- * console.log(error.status); // number
243
- * console.log(error.statusText); // string | undefined
244
- * }
245
- * ```
246
- */
247
- declare class SdkHttpError extends SdkError {
248
- readonly data: SdkHttpErrorData;
249
- constructor(code: SdkErrorCode, message: string, data: SdkHttpErrorData);
250
- get status(): number;
251
- get statusText(): string | undefined;
252
- }
253
- //#endregion
254
- //#region ../core-internal/src/shared/authUtils.d.ts
255
- /**
256
- * Utilities for handling OAuth resource URIs.
257
- */
258
- /**
259
- * Converts a server URL to a resource URL by removing the fragment.
260
- * {@link https://datatracker.ietf.org/doc/html/rfc8707#section-2 | RFC 8707 section 2}
261
- * states that resource URIs "MUST NOT include a fragment component".
262
- * Keeps everything else unchanged (scheme, domain, port, path, query).
263
- */
264
- declare function resourceUrlFromServerUrl(url: URL | string): URL;
265
- /**
266
- * Checks if a requested resource URL matches a configured resource URL.
267
- * A requested resource matches if it has the same scheme, domain, port,
268
- * and its path starts with the configured resource's path.
269
- *
270
- * @param options - The options object
271
- * @param options.requestedResource - The resource URL being requested
272
- * @param options.configuredResource - The resource URL that has been configured
273
- * @returns true if the requested resource matches the configured resource, false otherwise
274
- */
275
- declare function checkResourceAllowed({
276
- requestedResource,
277
- configuredResource
278
- }: {
279
- requestedResource: URL | string;
280
- configuredResource: URL | string;
281
- }): boolean;
282
- declare namespace schemas_d_exports {
283
- export { AnnotationsSchema, AudioContentSchema, BaseMetadataSchema, BaseRequestParamsSchema, BlobResourceContentsSchema, BooleanSchemaSchema, CallToolRequestParamsSchema, CallToolRequestSchema, CallToolResultSchema, CancelTaskRequestSchema, CancelTaskResultSchema, CancelledNotificationParamsSchema, CancelledNotificationSchema, ClientCapabilitiesSchema, ClientNotificationSchema, ClientRequestSchema, ClientResultSchema, ClientTasksCapabilitySchema, CompatibilityCallToolResultSchema, CompleteRequestParamsSchema, CompleteRequestSchema, CompleteResultSchema, ContentBlockSchema, CreateMessageRequestParamsSchema, CreateMessageRequestSchema, CreateMessageResultSchema, CreateMessageResultWithToolsSchema, CreateTaskResultSchema, CursorSchema, DiscoverRequestSchema, DiscoverResultSchema, ElicitRequestFormParamsSchema, ElicitRequestParamsSchema, ElicitRequestSchema, ElicitRequestURLParamsSchema, ElicitResultSchema, ElicitationCompleteNotificationParamsSchema, ElicitationCompleteNotificationSchema, EmbeddedResourceSchema, EmptyResultSchema, EnumSchemaSchema, GetPromptRequestParamsSchema, GetPromptRequestSchema, GetPromptResultSchema, GetTaskPayloadRequestSchema, GetTaskPayloadResultSchema, GetTaskRequestSchema, GetTaskResultSchema, IconSchema, IconsSchema, ImageContentSchema, ImplementationSchema, InitializeRequestParamsSchema, InitializeRequestSchema, InitializeResultSchema, InitializedNotificationSchema, JSONArraySchema, JSONObjectSchema, JSONRPCErrorResponseSchema, JSONRPCMessageSchema, JSONRPCNotificationSchema, JSONRPCRequestSchema, JSONRPCResponseSchema, JSONRPCResultResponseSchema, JSONValueSchema, LegacyTitledEnumSchemaSchema, ListChangedOptionsBaseSchema, ListPromptsRequestSchema, ListPromptsResultSchema, ListResourceTemplatesRequestSchema, ListResourceTemplatesResultSchema, ListResourcesRequestSchema, ListResourcesResultSchema, ListRootsRequestSchema, ListRootsResultSchema, ListTasksRequestSchema, ListTasksResultSchema, ListToolsRequestSchema, ListToolsResultSchema, LoggingLevelSchema, LoggingMessageNotificationParamsSchema, LoggingMessageNotificationSchema, ModelHintSchema, ModelPreferencesSchema, MultiSelectEnumSchemaSchema, NotificationSchema, NotificationsParamsSchema, NumberSchemaSchema, PaginatedRequestParamsSchema, PaginatedRequestSchema, PaginatedResultSchema, PingRequestSchema, PrimitiveSchemaDefinitionSchema, ProgressNotificationParamsSchema, ProgressNotificationSchema, ProgressSchema, ProgressTokenSchema, PromptArgumentSchema, PromptListChangedNotificationSchema, PromptMessageSchema, PromptReferenceSchema, PromptSchema, ReadResourceRequestParamsSchema, ReadResourceRequestSchema, ReadResourceResultSchema, RelatedTaskMetadataSchema, RequestIdSchema, RequestMetaSchema, RequestSchema, ResourceContentsSchema, ResourceLinkSchema, ResourceListChangedNotificationSchema, ResourceRequestParamsSchema, ResourceSchema, ResourceTemplateReferenceSchema, ResourceTemplateSchema, ResourceUpdatedNotificationParamsSchema, ResourceUpdatedNotificationSchema, ResultSchema, RoleSchema, RootSchema, RootsListChangedNotificationSchema, SamplingContentSchema, SamplingMessageContentBlockSchema, SamplingMessageSchema, ServerCapabilitiesSchema, ServerNotificationSchema, ServerRequestSchema, ServerResultSchema, ServerTasksCapabilitySchema, SetLevelRequestParamsSchema, SetLevelRequestSchema, SingleSelectEnumSchemaSchema, StringSchemaSchema, SubscribeRequestParamsSchema, SubscribeRequestSchema, SubscriptionFilterSchema, SubscriptionsAcknowledgedNotificationParamsSchema, SubscriptionsAcknowledgedNotificationSchema, SubscriptionsListenRequestParamsSchema, SubscriptionsListenRequestSchema, SubscriptionsListenResultMetaSchema, SubscriptionsListenResultSchema, TaskAugmentedRequestParamsSchema, TaskCreationParamsSchema, TaskMetadataSchema, TaskSchema, TaskStatusNotificationParamsSchema, TaskStatusNotificationSchema, TaskStatusSchema, TextContentSchema, TextResourceContentsSchema, TitledMultiSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema, ToolAnnotationsSchema, ToolChoiceSchema, ToolExecutionSchema, ToolListChangedNotificationSchema, ToolResultContentSchema, ToolSchema, ToolUseContentSchema, UnsubscribeRequestParamsSchema, UnsubscribeRequestSchema, UntitledMultiSelectEnumSchemaSchema, UntitledSingleSelectEnumSchemaSchema };
284
- }
285
- //#endregion
286
- //#region ../core-internal/src/types/types.d.ts
287
- /**
288
- * Utility types
289
- */
290
- type ExpandRecursively<T$1> = T$1 extends object ? (T$1 extends infer O ? { [K in keyof O]: ExpandRecursively<O[K]> } : never) : T$1;
291
- type Primitive = string | number | boolean | bigint | null | undefined;
292
- type Flatten<T$1> = T$1 extends Primitive ? T$1 : T$1 extends Array<infer U> ? Array<Flatten<U>> : T$1 extends Set<infer U> ? Set<Flatten<U>> : T$1 extends Map<infer K, infer V> ? Map<Flatten<K>, Flatten<V>> : T$1 extends object ? { [K in keyof T$1]: Flatten<T$1[K]> } : T$1;
293
- type Infer<Schema extends z.ZodTypeAny> = Flatten<z.infer<Schema>>;
294
- /**
295
- * Wire-only members hidden from the public types.
296
- *
297
- * `resultType` is the protocol-revision-2026-07-28 wire discrimination field
298
- * on results. It is consumed by the SDK's protocol layer (and stripped before
299
- * results reach consumers), so the public result types do not declare it.
300
- * The wire schemas continue to model it internally.
301
- */
302
- type WireOnlyResultKey = 'resultType';
303
- /**
304
- * Removes wire-only members from a (possibly union) schema-inferred type
305
- * while preserving every other declared member, optionality, and the loose
306
- * index signature.
307
- */
308
- type StripWireOnly<T$1> = T$1 extends unknown ? { [K in keyof T$1 as K extends WireOnlyResultKey ? never : K]: T$1[K] } : never;
309
- type ProgressToken = Infer<typeof ProgressTokenSchema>;
310
- type Cursor = Infer<typeof CursorSchema>;
311
- type Request$1 = Infer<typeof RequestSchema>;
312
- /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
313
- type TaskAugmentedRequestParams = Infer<typeof TaskAugmentedRequestParamsSchema>;
314
- type RequestMeta = Infer<typeof RequestMetaSchema>;
315
- type Notification = Infer<typeof NotificationSchema>;
316
- type Result$1 = StripWireOnly<Infer<typeof ResultSchema>>;
317
- type RequestId = Infer<typeof RequestIdSchema>;
318
- type JSONRPCRequest = Infer<typeof JSONRPCRequestSchema>;
319
- type JSONRPCNotification = Infer<typeof JSONRPCNotificationSchema>;
320
- type JSONRPCErrorResponse = Infer<typeof JSONRPCErrorResponseSchema>;
321
- type JSONRPCResultResponse = Omit<Infer<typeof JSONRPCResultResponseSchema>, 'result'> & {
322
- result: Result$1;
323
- };
324
- type JSONRPCResponse = JSONRPCResultResponse | JSONRPCErrorResponse;
325
- type JSONRPCMessage = JSONRPCRequest | JSONRPCNotification | JSONRPCResultResponse | JSONRPCErrorResponse;
326
- type RequestParams = Infer<typeof BaseRequestParamsSchema>;
327
- type NotificationParams = Infer<typeof NotificationsParamsSchema>;
328
- /**
329
- * The per-request `_meta` envelope carried by every request under protocol revision
330
- * 2026-07-28 (protocol version, client info, client capabilities, optional log level).
331
- *
332
- * Neutral hand-written shape keyed by the public meta-key constants — never
333
- * inferred from a wire-module schema (this neutral layer does not import from
334
- * `wire/rev*`). A `type` alias rather than an interface so it stays assignable
335
- * to `_meta`'s string-indexed object slot.
336
- */
337
- type RequestMetaEnvelope = {};
338
- type EmptyResult = StripWireOnly<Infer<typeof EmptyResultSchema>>;
339
- type CancelledNotificationParams = Infer<typeof CancelledNotificationParamsSchema>;
340
- type CancelledNotification = Infer<typeof CancelledNotificationSchema>;
341
- type Icon = Infer<typeof IconSchema>;
342
- type Icons = Infer<typeof IconsSchema>;
343
- type BaseMetadata = Infer<typeof BaseMetadataSchema>;
344
- type Annotations = Infer<typeof AnnotationsSchema>;
345
- type Role = Infer<typeof RoleSchema>;
346
- type Implementation = Infer<typeof ImplementationSchema>;
347
- /**
348
- * Capabilities a client may support.
349
- *
350
- * Note: the `roots` and `sampling` capabilities are deprecated as of protocol
351
- * version 2026-07-28 (SEP-2577); they remain in the specification for at least
352
- * twelve months. See `ClientCapabilitiesSchema`.
353
- */
354
- type ClientCapabilities = Infer<typeof ClientCapabilitiesSchema>;
355
- type InitializeRequestParams = Infer<typeof InitializeRequestParamsSchema>;
356
- type InitializeRequest = Infer<typeof InitializeRequestSchema>;
357
- /**
358
- * Capabilities a server may support.
359
- *
360
- * Note: the `logging` capability is deprecated as of protocol version
361
- * 2026-07-28 (SEP-2577); it remains in the specification for at least twelve
362
- * months. See `ServerCapabilitiesSchema`.
363
- */
364
- type ServerCapabilities = Infer<typeof ServerCapabilitiesSchema>;
365
- type InitializeResult = StripWireOnly<Infer<typeof InitializeResultSchema>>;
366
- type InitializedNotification = Infer<typeof InitializedNotificationSchema>;
367
- type DiscoverRequest = Infer<typeof DiscoverRequestSchema>;
368
- type DiscoverResult = StripWireOnly<Infer<typeof DiscoverResultSchema>>;
369
- type PingRequest = Infer<typeof PingRequestSchema>;
370
- type Progress = Infer<typeof ProgressSchema>;
371
- type ProgressNotificationParams = Infer<typeof ProgressNotificationParamsSchema>;
372
- type ProgressNotification = Infer<typeof ProgressNotificationSchema>;
373
- /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
374
- type Task = Infer<typeof TaskSchema>;
375
- /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
376
- type TaskStatus = Infer<typeof TaskStatusSchema>;
377
- /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
378
- type TaskCreationParams = Infer<typeof TaskCreationParamsSchema>;
379
- /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
380
- type TaskMetadata = Infer<typeof TaskMetadataSchema>;
381
- /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
382
- type RelatedTaskMetadata = Infer<typeof RelatedTaskMetadataSchema>;
383
- /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
384
- type CreateTaskResult = StripWireOnly<Infer<typeof CreateTaskResultSchema>>;
385
- /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
386
- type TaskStatusNotificationParams = Infer<typeof TaskStatusNotificationParamsSchema>;
387
- /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
388
- type TaskStatusNotification = Infer<typeof TaskStatusNotificationSchema>;
389
- /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
390
- type GetTaskRequest = Infer<typeof GetTaskRequestSchema>;
391
- /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
392
- type GetTaskResult = StripWireOnly<Infer<typeof GetTaskResultSchema>>;
393
- /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
394
- type GetTaskPayloadRequest = Infer<typeof GetTaskPayloadRequestSchema>;
395
- /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
396
- type ListTasksRequest = Infer<typeof ListTasksRequestSchema>;
397
- /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
398
- type ListTasksResult = StripWireOnly<Infer<typeof ListTasksResultSchema>>;
399
- /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
400
- type CancelTaskRequest = Infer<typeof CancelTaskRequestSchema>;
401
- /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
402
- type CancelTaskResult = StripWireOnly<Infer<typeof CancelTaskResultSchema>>;
403
- /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
404
- type GetTaskPayloadResult = StripWireOnly<Infer<typeof GetTaskPayloadResultSchema>>;
405
- type PaginatedRequestParams = Infer<typeof PaginatedRequestParamsSchema>;
406
- type PaginatedRequest = Infer<typeof PaginatedRequestSchema>;
407
- type PaginatedResult = StripWireOnly<Infer<typeof PaginatedResultSchema>>;
408
- type ResourceContents = Infer<typeof ResourceContentsSchema>;
409
- type TextResourceContents = Infer<typeof TextResourceContentsSchema>;
410
- type BlobResourceContents = Infer<typeof BlobResourceContentsSchema>;
411
- type Resource = Infer<typeof ResourceSchema>;
412
- type ResourceTemplateType = Infer<typeof ResourceTemplateSchema>;
413
- type ListResourcesRequest = Infer<typeof ListResourcesRequestSchema>;
414
- type ListResourcesResult = StripWireOnly<Infer<typeof ListResourcesResultSchema>>;
415
- type ListResourceTemplatesRequest = Infer<typeof ListResourceTemplatesRequestSchema>;
416
- type ListResourceTemplatesResult = StripWireOnly<Infer<typeof ListResourceTemplatesResultSchema>>;
417
- type ResourceRequestParams = Infer<typeof ResourceRequestParamsSchema>;
418
- type ReadResourceRequestParams = Infer<typeof ReadResourceRequestParamsSchema>;
419
- type ReadResourceRequest = Infer<typeof ReadResourceRequestSchema>;
420
- type ReadResourceResult = StripWireOnly<Infer<typeof ReadResourceResultSchema>>;
421
- type ResourceListChangedNotification = Infer<typeof ResourceListChangedNotificationSchema>;
422
- type SubscribeRequestParams = Infer<typeof SubscribeRequestParamsSchema>;
423
- type SubscribeRequest = Infer<typeof SubscribeRequestSchema>;
424
- type UnsubscribeRequestParams = Infer<typeof UnsubscribeRequestParamsSchema>;
425
- type UnsubscribeRequest = Infer<typeof UnsubscribeRequestSchema>;
426
- type ResourceUpdatedNotificationParams = Infer<typeof ResourceUpdatedNotificationParamsSchema>;
427
- type ResourceUpdatedNotification = Infer<typeof ResourceUpdatedNotificationSchema>;
428
- type SubscriptionFilter = Infer<typeof SubscriptionFilterSchema>;
429
- type SubscriptionsListenRequestParams = Infer<typeof SubscriptionsListenRequestParamsSchema>;
430
- type SubscriptionsListenRequest = Infer<typeof SubscriptionsListenRequestSchema>;
431
- type SubscriptionsAcknowledgedNotificationParams = Infer<typeof SubscriptionsAcknowledgedNotificationParamsSchema>;
432
- type SubscriptionsAcknowledgedNotification = Infer<typeof SubscriptionsAcknowledgedNotificationSchema>;
433
- type SubscriptionsListenResultMeta = Infer<typeof SubscriptionsListenResultMetaSchema>;
434
- type SubscriptionsListenResult = StripWireOnly<Infer<typeof SubscriptionsListenResultSchema>>;
435
- type PromptArgument = Infer<typeof PromptArgumentSchema>;
436
- type Prompt = Infer<typeof PromptSchema>;
437
- type ListPromptsRequest = Infer<typeof ListPromptsRequestSchema>;
438
- type ListPromptsResult = StripWireOnly<Infer<typeof ListPromptsResultSchema>>;
439
- type GetPromptRequestParams = Infer<typeof GetPromptRequestParamsSchema>;
440
- type GetPromptRequest = Infer<typeof GetPromptRequestSchema>;
441
- type TextContent = Infer<typeof TextContentSchema>;
442
- type ImageContent = Infer<typeof ImageContentSchema>;
443
- type AudioContent = Infer<typeof AudioContentSchema>;
444
- /**
445
- * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
446
- * in the specification for at least twelve months. Migrate to calling LLM
447
- * provider APIs directly.
448
- */
449
- type ToolUseContent = Infer<typeof ToolUseContentSchema>;
450
- /**
451
- * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
452
- * in the specification for at least twelve months. Migrate to calling LLM
453
- * provider APIs directly.
454
- */
455
- type ToolResultContent = Infer<typeof ToolResultContentSchema>;
456
- type EmbeddedResource = Infer<typeof EmbeddedResourceSchema>;
457
- type ResourceLink = Infer<typeof ResourceLinkSchema>;
458
- type ContentBlock = Infer<typeof ContentBlockSchema>;
459
- type PromptMessage = Infer<typeof PromptMessageSchema>;
460
- type GetPromptResult = StripWireOnly<Infer<typeof GetPromptResultSchema>>;
461
- type PromptListChangedNotification = Infer<typeof PromptListChangedNotificationSchema>;
462
- type ToolAnnotations = Infer<typeof ToolAnnotationsSchema>;
463
- type ToolExecution = Infer<typeof ToolExecutionSchema>;
464
- type Tool = Infer<typeof ToolSchema>;
465
- type ListToolsRequest = Infer<typeof ListToolsRequestSchema>;
466
- type ListToolsResult = StripWireOnly<Infer<typeof ListToolsResultSchema>>;
467
- type CallToolRequestParams = Infer<typeof CallToolRequestParamsSchema>;
468
- type CallToolResult = StripWireOnly<Infer<typeof CallToolResultSchema>>;
469
- type CompatibilityCallToolResult = StripWireOnly<Infer<typeof CompatibilityCallToolResultSchema>>;
470
- type CallToolRequest = Infer<typeof CallToolRequestSchema>;
471
- type ToolListChangedNotification = Infer<typeof ToolListChangedNotificationSchema>;
472
- /**
473
- * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
474
- * in the specification for at least twelve months. Migrate to stderr logging
475
- * (STDIO servers) or OpenTelemetry.
476
- */
477
- type LoggingLevel = Infer<typeof LoggingLevelSchema>;
478
- /**
479
- * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
480
- * in the specification for at least twelve months. Migrate to stderr logging
481
- * (STDIO servers) or OpenTelemetry.
482
- */
483
- type SetLevelRequestParams = Infer<typeof SetLevelRequestParamsSchema>;
484
- /**
485
- * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
486
- * in the specification for at least twelve months. Migrate to stderr logging
487
- * (STDIO servers) or OpenTelemetry.
488
- */
489
- type SetLevelRequest = Infer<typeof SetLevelRequestSchema>;
490
- /**
491
- * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
492
- * in the specification for at least twelve months. Migrate to stderr logging
493
- * (STDIO servers) or OpenTelemetry.
494
- */
495
- type LoggingMessageNotificationParams = Infer<typeof LoggingMessageNotificationParamsSchema>;
496
- /**
497
- * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
498
- * in the specification for at least twelve months. Migrate to stderr logging
499
- * (STDIO servers) or OpenTelemetry.
500
- */
501
- type LoggingMessageNotification = Infer<typeof LoggingMessageNotificationSchema>;
502
- /**
503
- * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
504
- * in the specification for at least twelve months. Migrate to calling LLM
505
- * provider APIs directly.
506
- */
507
- type ToolChoice = Infer<typeof ToolChoiceSchema>;
508
- /**
509
- * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
510
- * in the specification for at least twelve months. Migrate to calling LLM
511
- * provider APIs directly.
512
- */
513
- type ModelHint = Infer<typeof ModelHintSchema>;
514
- /**
515
- * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
516
- * in the specification for at least twelve months. Migrate to calling LLM
517
- * provider APIs directly.
518
- */
519
- type ModelPreferences = Infer<typeof ModelPreferencesSchema>;
520
- /**
521
- * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
522
- * in the specification for at least twelve months. Migrate to calling LLM
523
- * provider APIs directly.
524
- */
525
- type SamplingContent = Infer<typeof SamplingContentSchema>;
526
- /**
527
- * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
528
- * in the specification for at least twelve months. Migrate to calling LLM
529
- * provider APIs directly.
530
- */
531
- type SamplingMessageContentBlock = Infer<typeof SamplingMessageContentBlockSchema>;
532
- /**
533
- * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
534
- * in the specification for at least twelve months. Migrate to calling LLM
535
- * provider APIs directly.
536
- */
537
- type SamplingMessage = Infer<typeof SamplingMessageSchema>;
538
- /**
539
- * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
540
- * in the specification for at least twelve months. Migrate to calling LLM
541
- * provider APIs directly.
542
- */
543
- type CreateMessageRequestParams = Infer<typeof CreateMessageRequestParamsSchema>;
544
- /**
545
- * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
546
- * in the specification for at least twelve months. Migrate to calling LLM
547
- * provider APIs directly.
548
- */
549
- type CreateMessageRequest = Infer<typeof CreateMessageRequestSchema>;
550
- /**
551
- * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
552
- * in the specification for at least twelve months. Migrate to calling LLM
553
- * provider APIs directly.
554
- */
555
- type CreateMessageResult = StripWireOnly<Infer<typeof CreateMessageResultSchema>>;
556
- /**
557
- * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
558
- * in the specification for at least twelve months. Migrate to calling LLM
559
- * provider APIs directly.
560
- */
561
- type CreateMessageResultWithTools = StripWireOnly<Infer<typeof CreateMessageResultWithToolsSchema>>;
562
- type BooleanSchema = Infer<typeof BooleanSchemaSchema>;
563
- type StringSchema = Infer<typeof StringSchemaSchema>;
564
- type NumberSchema = Infer<typeof NumberSchemaSchema>;
565
- type EnumSchema = Infer<typeof EnumSchemaSchema>;
566
- type UntitledSingleSelectEnumSchema = Infer<typeof UntitledSingleSelectEnumSchemaSchema>;
567
- type TitledSingleSelectEnumSchema = Infer<typeof TitledSingleSelectEnumSchemaSchema>;
568
- type LegacyTitledEnumSchema = Infer<typeof LegacyTitledEnumSchemaSchema>;
569
- type UntitledMultiSelectEnumSchema = Infer<typeof UntitledMultiSelectEnumSchemaSchema>;
570
- type TitledMultiSelectEnumSchema = Infer<typeof TitledMultiSelectEnumSchemaSchema>;
571
- type SingleSelectEnumSchema = Infer<typeof SingleSelectEnumSchemaSchema>;
572
- type MultiSelectEnumSchema = Infer<typeof MultiSelectEnumSchemaSchema>;
573
- type PrimitiveSchemaDefinition = Infer<typeof PrimitiveSchemaDefinitionSchema>;
574
- type ElicitRequestParams = Infer<typeof ElicitRequestParamsSchema>;
575
- type ElicitRequestFormParams = Infer<typeof ElicitRequestFormParamsSchema>;
576
- type ElicitRequestURLParams = Infer<typeof ElicitRequestURLParamsSchema>;
577
- type ElicitRequest = Infer<typeof ElicitRequestSchema>;
578
- /** @deprecated Removed from the spec by #2891 (2026-07-28). 2025-era only; the 2026-07-28 wire codec excludes this notification. */
579
- type ElicitationCompleteNotificationParams = Infer<typeof ElicitationCompleteNotificationParamsSchema>;
580
- /** @deprecated Removed from the spec by #2891 (2026-07-28). 2025-era only; the 2026-07-28 wire codec excludes this notification. */
581
- type ElicitationCompleteNotification = Infer<typeof ElicitationCompleteNotificationSchema>;
582
- type ElicitResult = StripWireOnly<Infer<typeof ElicitResultSchema>>;
583
- type ResourceTemplateReference = Infer<typeof ResourceTemplateReferenceSchema>;
584
- type PromptReference = Infer<typeof PromptReferenceSchema>;
585
- type CompleteRequestParams = Infer<typeof CompleteRequestParamsSchema>;
586
- type CompleteRequest = Infer<typeof CompleteRequestSchema>;
587
- type CompleteResult = StripWireOnly<Infer<typeof CompleteResultSchema>>;
588
- /**
589
- * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
590
- * in the specification for at least twelve months. Migrate to passing paths via
591
- * tool parameters, resource URIs, or configuration.
592
- */
593
- type Root = Infer<typeof RootSchema>;
594
- /**
595
- * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
596
- * in the specification for at least twelve months. Migrate to passing paths via
597
- * tool parameters, resource URIs, or configuration.
598
- */
599
- type ListRootsRequest = Infer<typeof ListRootsRequestSchema>;
600
- /**
601
- * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
602
- * in the specification for at least twelve months. Migrate to passing paths via
603
- * tool parameters, resource URIs, or configuration.
604
- */
605
- type ListRootsResult = StripWireOnly<Infer<typeof ListRootsResultSchema>>;
606
- /**
607
- * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
608
- * in the specification for at least twelve months. Migrate to passing paths via
609
- * tool parameters, resource URIs, or configuration.
610
- */
611
- type RootsListChangedNotification = Infer<typeof RootsListChangedNotificationSchema>;
612
- /**
613
- * A single embedded (de-JSON-RPC'd) input request inside an
614
- * {@linkcode InputRequiredResult}: an elicitation, sampling, or roots request
615
- * object carried in-band rather than sent as a server→client JSON-RPC request.
616
- */
617
- type InputRequest = CreateMessageRequest | ListRootsRequest | ElicitRequest;
618
- /**
619
- * A single embedded (de-JSON-RPC'd) input response inside a retried request's
620
- * `inputResponses`: the bare result object for the corresponding
621
- * {@linkcode InputRequest} (never wrapped in a `{method, result}` envelope).
622
- */
623
- type InputResponse = CreateMessageResult | ListRootsResult | ElicitResult;
624
- /**
625
- * A map of embedded input requests, keyed by server-assigned identifiers that
626
- * are unique within the scope of the request.
627
- */
628
- interface InputRequests {
629
- [key: string]: InputRequest;
630
- }
631
- /**
632
- * A map of embedded input responses. Keys correspond to the keys of the
633
- * {@linkcode InputRequests} map the server sent; values are the client's bare
634
- * result for each request.
635
- */
636
- interface InputResponses {
637
- [key: string]: InputResponse;
638
- }
639
- /**
640
- * The input-required result a handler for a multi-round-trip method
641
- * (`tools/call`, `prompts/get`, `resources/read`) returns to request more
642
- * input from the client (protocol revision 2026-07-28). Build it with the
643
- * `inputRequired()` builder; hand-built literals are equally legal —
644
- * `resultType: 'input_required'` is the discriminator, and the SDK re-checks
645
- * the at-least-one rule at the seam.
646
- *
647
- * This is the one place the wire discriminator `resultType` appears on the
648
- * neutral surface: the handler authors it, the 2026-07-28 codec passes it
649
- * through to the wire, and consumers receiving results never see it (complete
650
- * results are lifted).
651
- *
652
- * At least one of `inputRequests` or `requestState` must be present.
653
- *
654
- * `requestState` is an opaque, server-minted string echoed back verbatim by
655
- * the client on retry. It travels through the client and MUST be treated by
656
- * the server as attacker-controlled input on re-entry: if it influences
657
- * authorization, resource access, or business logic, the server MUST protect
658
- * its integrity (e.g. HMAC or AEAD) and MUST reject state that fails
659
- * verification (spec: basic/patterns/mrtr §Server Requirements). The SDK
660
- * applies no integrity protection by default — without a configured
661
- * `ServerOptions.requestState.verify` hook, `ctx.mcpReq.requestState()`
662
- * returns the raw, unverified string; with one, the seam rejects state the
663
- * hook refuses and the accessor returns the hook's decoded payload.
664
- */
665
- interface InputRequiredResult extends Result$1 {
666
- resultType: 'input_required';
667
- /** Embedded requests the client must fulfil before retrying. */
668
- inputRequests?: InputRequests;
669
- /** Opaque server state the client echoes back verbatim on retry. */
670
- requestState?: string;
671
- }
672
- type ClientRequest = Infer<typeof ClientRequestSchema>;
673
- type ClientNotification = Infer<typeof ClientNotificationSchema>;
674
- type ClientResult = StripWireOnly<Infer<typeof ClientResultSchema>>;
675
- type ServerRequest = Infer<typeof ServerRequestSchema>;
676
- type ServerNotification = Infer<typeof ServerNotificationSchema>;
677
- type ServerResult = StripWireOnly<Infer<typeof ServerResultSchema>>;
678
- type MethodToTypeMap<U$1> = { [T in U$1 as T extends {
679
- method: infer M extends string;
680
- } ? M : never]: T };
681
- /**
682
- * Task methods are 2025-11-25 wire vocabulary with no SDK runtime: the task
683
- * wire types stay importable (see the Tasks section above), but the typed
684
- * method surface — `request()`, `setRequestHandler()`, `ctx.mcpReq.send()` —
685
- * does not offer them. The wire schemas keep parsing task vocabulary for
686
- * interoperability with 2025-11-25 peers.
687
- */
688
- type TaskRequestMethod = 'tasks/get' | 'tasks/result' | 'tasks/list' | 'tasks/cancel';
689
- type TaskNotificationMethod = 'notifications/tasks/status';
690
- type RequestMethod = Exclude<ClientRequest['method'] | ServerRequest['method'], TaskRequestMethod>;
691
- type NotificationMethod = Exclude<ClientNotification['method'] | ServerNotification['method'], TaskNotificationMethod>;
692
- type RequestTypeMap = MethodToTypeMap<Exclude<ClientRequest | ServerRequest, {
693
- method: TaskRequestMethod;
694
- }>>;
695
- type NotificationTypeMap = MethodToTypeMap<Exclude<ClientNotification | ServerNotification, {
696
- method: TaskNotificationMethod;
697
- }>>;
698
- type ResultTypeMap = {
699
- ping: EmptyResult;
700
- initialize: InitializeResult;
701
- 'server/discover': DiscoverResult;
702
- 'completion/complete': CompleteResult;
703
- 'logging/setLevel': EmptyResult;
704
- 'prompts/get': GetPromptResult;
705
- 'prompts/list': ListPromptsResult;
706
- 'resources/list': ListResourcesResult;
707
- 'resources/templates/list': ListResourceTemplatesResult;
708
- 'resources/read': ReadResourceResult;
709
- 'resources/subscribe': EmptyResult;
710
- 'resources/unsubscribe': EmptyResult;
711
- 'subscriptions/listen': SubscriptionsListenResult;
712
- 'tools/call': CallToolResult;
713
- 'tools/list': ListToolsResult;
714
- 'sampling/createMessage': CreateMessageResult | CreateMessageResultWithTools;
715
- 'elicitation/create': ElicitResult;
716
- 'roots/list': ListRootsResult;
717
- };
718
- /**
719
- * The handler-return counterpart of {@linkcode ResultTypeMap}: what a
720
- * registered request handler may RETURN for each method. Identical to
721
- * `ResultTypeMap` except that the multi-round-trip methods (`tools/call`,
722
- * `prompts/get`, `resources/read`) additionally accept an
723
- * {@linkcode InputRequiredResult} (protocol revision 2026-07-28).
724
- *
725
- * `ResultTypeMap` itself — what a *requester* receives — is deliberately NOT
726
- * widened: `client.callTool()` returns a plain {@linkcode CallToolResult} on
727
- * both protocol eras.
728
- */
729
- type HandlerResultTypeMap = { [M in keyof ResultTypeMap]: M extends 'tools/call' | 'prompts/get' | 'resources/read' ? ResultTypeMap[M] | InputRequiredResult : ResultTypeMap[M] };
730
- /**
731
- * Information about a validated access token, provided to request handlers.
732
- */
733
- interface AuthInfo {
734
- /**
735
- * The access token.
736
- */
737
- token: string;
738
- /**
739
- * The client ID associated with this token.
740
- */
741
- clientId: string;
742
- /**
743
- * Scopes associated with this token.
744
- */
745
- scopes: string[];
746
- /**
747
- * When the token expires (in seconds since epoch).
748
- */
749
- expiresAt?: number;
750
- /**
751
- * The RFC 8707 resource server identifier for which this token is valid.
752
- * If set, this MUST match the MCP server's resource identifier (minus hash fragment).
753
- */
754
- resource?: URL;
755
- /**
756
- * Additional data associated with the token.
757
- * This field should be used for any additional data that needs to be attached to the auth info.
758
- */
759
- extra?: Record<string, unknown>;
760
- }
761
- type JSONRPCErrorObject = {
762
- code: number;
763
- message: string;
764
- data?: unknown;
765
- };
766
- interface ParseError extends JSONRPCErrorObject {
767
- code: typeof PARSE_ERROR;
768
- }
769
- interface InvalidRequestError extends JSONRPCErrorObject {
770
- code: typeof INVALID_REQUEST;
771
- }
772
- interface MethodNotFoundError extends JSONRPCErrorObject {
773
- code: typeof METHOD_NOT_FOUND;
774
- }
775
- interface InvalidParamsError extends JSONRPCErrorObject {
776
- code: typeof INVALID_PARAMS;
777
- }
778
- interface InternalError extends JSONRPCErrorObject {
779
- code: typeof INTERNAL_ERROR;
780
- }
781
- /**
782
- * Data carried by a `-32021` MissingRequiredClientCapability protocol error
783
- * (protocol revision 2026-07-28).
784
- */
785
- interface MissingRequiredClientCapabilityErrorData {
786
- /**
787
- * The capabilities the server requires from the client to process the
788
- * request, in the `ClientCapabilities` shape (only the missing
789
- * capabilities are listed).
790
- */
791
- requiredCapabilities: ClientCapabilities;
792
- }
793
- /**
794
- * Data carried by a `-32022` UnsupportedProtocolVersion protocol error
795
- * (protocol revision 2026-07-28).
796
- */
797
- interface UnsupportedProtocolVersionErrorData {
798
- /**
799
- * Protocol versions the receiver supports. The sender should choose a
800
- * mutually supported version from this list and retry.
801
- */
802
- supported: string[];
803
- /**
804
- * The protocol version that was requested.
805
- */
806
- requested: string;
807
- }
808
- /**
809
- * Callback type for list changed notifications.
810
- */
811
- type ListChangedCallback<T$1> = (error: Error | null, items: T$1[] | null) => void;
812
- /**
813
- * Options for subscribing to list changed notifications.
814
- *
815
- * @typeParam T - The type of items in the list (`Tool`, `Prompt`, or `Resource`)
816
- */
817
- type ListChangedOptions<T$1> = {
818
- /**
819
- * If `true`, the list will be refreshed automatically when a list changed notification is received.
820
- * @default true
821
- */
822
- autoRefresh?: boolean;
823
- /**
824
- * Debounce time in milliseconds. Set to `0` to disable.
825
- * @default 300
826
- */
827
- debounceMs?: number;
828
- /**
829
- * Callback invoked when the list changes.
830
- *
831
- * If `autoRefresh` is `true`, `items` contains the updated list.
832
- * If `autoRefresh` is `false`, `items` is `null` (caller should refresh manually).
833
- */
834
- onChanged: ListChangedCallback<T$1>;
835
- };
836
- /**
837
- * Configuration for list changed notification handlers.
838
- *
839
- * Use this to configure handlers for tools, prompts, and resources list changes
840
- * when creating a client.
841
- *
842
- * Note: Handlers are only activated if the server advertises the corresponding
843
- * `listChanged` capability (e.g., `tools.listChanged: true`). If the server
844
- * doesn't advertise this capability, the handler will not be set up.
845
- */
846
- type ListChangedHandlers = {
847
- /**
848
- * Handler for tool list changes.
849
- */
850
- tools?: ListChangedOptions<Tool>;
851
- /**
852
- * Handler for prompt list changes.
853
- */
854
- prompts?: ListChangedOptions<Prompt>;
855
- /**
856
- * Handler for resource list changes.
857
- */
858
- resources?: ListChangedOptions<Resource>;
859
- };
860
- /**
861
- * Protocol-era classification of an inbound message.
862
- *
863
- * Populated by transports that classify messages at the edge (e.g. an HTTP
864
- * entry distinguishing 2025-era from 2026-era traffic). The wire era itself
865
- * is connection state (the negotiated protocol version held by the
866
- * `Client`/`Server` instance); the protocol layer validates a classified
867
- * message against that instance era at dispatch — a mismatch is treated as
868
- * an entry/routing error, never a per-message era switch. Unclassified
869
- * traffic is dispatched on the instance era unchanged.
870
- */
871
- interface MessageClassification {
872
- /**
873
- * The wire era the message was classified into: `legacy` for the
874
- * 2025-11-25 family of revisions, `modern` for 2026-07-28 and later.
875
- */
876
- era: 'legacy' | 'modern';
877
- /**
878
- * The exact protocol revision, when the classifier derived one.
879
- */
880
- revision?: string;
881
- }
882
- /**
883
- * Extra information about a message.
884
- */
885
- interface MessageExtraInfo {
886
- /**
887
- * The original HTTP request.
888
- */
889
- request?: globalThis.Request;
890
- /**
891
- * Protocol-era classification of the message, when the transport
892
- * classified it at the edge. Validated by the protocol layer against the
893
- * instance's negotiated era at dispatch (the edge→instance handoff
894
- * check); it does not select the era itself.
895
- */
896
- classification?: MessageClassification;
897
- /**
898
- * The authentication information.
899
- */
900
- authInfo?: AuthInfo;
901
- /**
902
- * Callback to close the SSE stream for this request, triggering client reconnection.
903
- * Only available when using {@linkcode @modelcontextprotocol/node!streamableHttp.NodeStreamableHTTPServerTransport | NodeStreamableHTTPServerTransport} with eventStore configured.
904
- */
905
- closeSSEStream?: () => void;
906
- /**
907
- * Callback to close the standalone GET SSE stream, triggering client reconnection.
908
- * Only available when using {@linkcode @modelcontextprotocol/node!streamableHttp.NodeStreamableHTTPServerTransport | NodeStreamableHTTPServerTransport} with eventStore configured.
909
- */
910
- closeStandaloneSSEStream?: () => void;
911
- }
912
- type MetaObject = Record<string, unknown>;
913
- type RequestMetaObject = RequestMeta;
914
- /**
915
- * {@linkcode CreateMessageRequestParams} without tools - for backwards-compatible overload.
916
- * Excludes tools/toolChoice to indicate they should not be provided.
917
- *
918
- * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
919
- * in the specification for at least twelve months. Migrate to calling LLM
920
- * provider APIs directly.
921
- */
922
- type CreateMessageRequestParamsBase = Omit<CreateMessageRequestParams, 'tools' | 'toolChoice'>;
923
- /**
924
- * {@linkcode CreateMessageRequestParams} with required tools - for tool-enabled overload.
925
- *
926
- * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
927
- * in the specification for at least twelve months. Migrate to calling LLM
928
- * provider APIs directly.
929
- */
930
- interface CreateMessageRequestParamsWithTools extends CreateMessageRequestParams {
931
- tools: Tool[];
932
- }
933
- type CompleteRequestResourceTemplate = ExpandRecursively<CompleteRequest & {
934
- params: CompleteRequestParams & {
935
- ref: ResourceTemplateReference;
936
- };
937
- }>;
938
- type CompleteRequestPrompt = ExpandRecursively<CompleteRequest & {
939
- params: CompleteRequestParams & {
940
- ref: PromptReference;
941
- };
942
- }>;
943
- //#endregion
944
- //#region ../core-internal/src/wire/codec.d.ts
945
- /** Wire eras with distinct vocabulary. */
946
- type WireEra = '2025-11-25' | '2026-07-28';
947
- /**
948
- * Wire-only material lifted off an inbound message by the protocol layer
949
- * before dispatch (the V-3 seam): the reserved `_meta` envelope keys and the
950
- * multi-round-trip driver fields. This is the typed driver-material channel
951
- * of the codec contract — handlers never see it; the protocol layer surfaces
952
- * it via `ctx.mcpReq.envelope` / `.inputResponses` / `.requestState`, and the
953
- * MRTR driver (M4.1) consumes the retry fields from here.
954
- */
955
- interface LiftedWireMaterial {
956
- envelope?: Partial<RequestMetaEnvelope>;
957
- inputResponses?: Record<string, unknown>;
958
- requestState?: string;
959
- }
960
- /**
961
- * Tri-state validation outcome — the function-only contract for what the
962
- * schema-getter pair (`hasRequestMethod` ⇒ −32601-by-absence; `…Schema(m)
963
- * .parse` throw ⇒ −32602) used to encode in two pieces. Preserving the split
964
- * is the point: collapsing 'absent from this era's registry' into 'invalid'
965
- * would make the in-band fallback chain (validate → on `not-in-era` fall to
966
- * validateInputRequest) treat absence as failure and never fall through.
967
- */
968
- type ValidateOutcome<T$1> = {
969
- readonly ok: true;
970
- readonly value: T$1;
971
- }
972
- /**
973
- * Method is spec vocabulary but absent from THIS era's registry. Callers
974
- * map to −32601 (inbound) or a typed local SdkError (outbound), or fall
975
- * through to the in-band validator.
976
- */ | {
977
- readonly ok: false;
978
- readonly reason: 'not-in-era';
979
- }
980
- /**
981
- * Method is in this era's registry; payload failed the era-exact schema.
982
- * Callers map to −32602.
983
- */ | {
984
- readonly ok: false;
985
- readonly reason: 'invalid';
986
- readonly message: string;
987
- };
988
- /** A single self-identifying problem found while validating a per-request `_meta` envelope. */
989
- interface EnvelopeIssue {
990
- /**
991
- * The envelope key the problem is about: one of the reserved `_meta`
992
- * keys, or a dotted path inside one.
993
- */
994
- readonly key: string;
995
- /** A short description of what is wrong with that key (`missing`, or a validation message). */
996
- readonly problem: string;
997
- }
998
- /** Material a Client supplies for an era to build its per-request `_meta` envelope from. */
999
- interface OutboundEnvelopeMaterial {
1000
- readonly protocolVersion: string;
1001
- readonly clientInfo: Implementation;
1002
- readonly clientCapabilities: ClientCapabilities;
1003
- readonly logLevel?: LoggingLevel;
1004
- }
1005
- /** Result decode outcomes — the raw-first discrimination (V-1) lives in `decodeResult`. */
1006
- type DecodedResult = {
1007
- kind: 'complete';
1008
- /** The neutral result value: wire-only material consumed/stripped. */
1009
- result: Result$1;
1010
- } | {
1011
- kind: 'input_required';
1012
- /**
1013
- * Driver-only material (never consumer-visible). The full
1014
- * multi-round-trip driver is M4.1 scope; this seam carries the
1015
- * discriminated payload to it.
1016
- */
1017
- inputRequests: Record<string, unknown>;
1018
- requestState?: string;
1019
- } | {
1020
- kind: 'invalid';
1021
- error: SdkError;
1022
- };
1023
- /**
1024
- * The per-era wire codec contract (design C §3, adapted to the live funnel
1025
- * layout: the universal wire-only LIFT runs once in the protocol layer for
1026
- * every message — spec, custom, and fallback paths alike — and codecs consume
1027
- * the lifted material rather than re-implementing the strip per era).
1028
- */
1029
- interface WireCodec {
1030
- readonly era: WireEra;
1031
- /** Registry membership — the deletion story (inbound −32601 by absence; outbound typed local error). */
1032
- hasRequestMethod(method: string): boolean;
1033
- hasNotificationMethod(method: string): boolean;
1034
- hasInputRequestMethod(method: string): boolean;
1035
- /** Era-exact request validation. `not-in-era` ≡ −32601-by-absence; `invalid` ≡ −32602. */
1036
- validateRequest<M$1 extends RequestMethod>(method: M$1, raw: unknown): ValidateOutcome<RequestTypeMap[M$1]>;
1037
- validateRequest(method: string, raw: unknown): ValidateOutcome<unknown>;
1038
- /** Era-exact result validation (same registry as `validateRequest`). */
1039
- validateResult<M$1 extends RequestMethod>(method: M$1, raw: unknown): ValidateOutcome<ResultTypeMap[M$1]>;
1040
- validateResult(method: string, raw: unknown): ValidateOutcome<unknown>;
1041
- /** Era-exact notification validation. */
1042
- validateNotification<M$1 extends NotificationMethod>(method: M$1, raw: unknown): ValidateOutcome<NotificationTypeMap[M$1]>;
1043
- validateNotification(method: string, raw: unknown): ValidateOutcome<unknown>;
1044
- /**
1045
- * In-band (de-JSON-RPC'd) input-request validation — the embedded
1046
- * requests a multi-round-trip `input_required` result may carry. Always
1047
- * `not-in-era` on the 2025 era (elicitation/sampling/roots are wire
1048
- * request methods there). Does NOT grant registry membership.
1049
- */
1050
- validateInputRequest<M$1 extends RequestMethod>(method: M$1, raw: unknown): ValidateOutcome<RequestTypeMap[M$1]>;
1051
- validateInputRequest(method: string, raw: unknown): ValidateOutcome<unknown>;
1052
- /** In-band bare-response validation answering an embedded input request. */
1053
- validateInputResponse<M$1 extends RequestMethod>(method: M$1, raw: unknown): ValidateOutcome<ResultTypeMap[M$1]>;
1054
- validateInputResponse(method: string, raw: unknown): ValidateOutcome<unknown>;
1055
- /**
1056
- * Param-conditional `sampling/createMessage` result validation — the one
1057
- * spec result whose schema depends on REQUEST params (tools vs no tools).
1058
- * The 2025 era owns the with-tools/plain frozen schemas; the 2026 era
1059
- * returns `not-in-era` (sampling is in-band there — callers fall through
1060
- * to `validateInputResponse`).
1061
- */
1062
- samplingResultVariant(hasTools: true, raw: unknown): ValidateOutcome<CreateMessageResultWithTools>;
1063
- samplingResultVariant(hasTools: false, raw: unknown): ValidateOutcome<CreateMessageResult>;
1064
- samplingResultVariant(hasTools: boolean, raw: unknown): ValidateOutcome<CreateMessageResult | CreateMessageResultWithTools>;
1065
- /**
1066
- * Outbound per-request `_meta` envelope encode. Returns the keyed object
1067
- * to merge into `params._meta` on this era, or `undefined` when this era
1068
- * carries no per-request envelope (the 2025 era — legacy wire stays
1069
- * byte-identical).
1070
- */
1071
- outboundEnvelope(material: OutboundEnvelopeMaterial): Readonly<Record<string, unknown>> | undefined;
1072
- /**
1073
- * Structured envelope validation: maps a `_meta` object to
1074
- * self-identifying issues. The 2025 era never requires an envelope and
1075
- * always returns `[]`; the 2026 era owns the required-key pre-pass plus
1076
- * the wire-exact `RequestMetaEnvelopeSchema` parse.
1077
- */
1078
- validateEnvelopeMeta(meta: Readonly<Record<string, unknown>>): EnvelopeIssue[];
1079
- /**
1080
- * Per-registration `tools/call` result projection. Two independent
1081
- * decisions, both owned here so server-side code never re-derives them:
1082
- *
1083
- * - SEP-2106 §4.3 TextContent auto-append (EVERY era, value-shape-based):
1084
- * when `structuredContent` is a non-object value (array/primitive/
1085
- * `null`) and the handler authored no `type:'text'` block, append
1086
- * `{type:'text', text: JSON.stringify(value)}` so consumers that read
1087
- * only `content` still receive a rendering. The author opts out by
1088
- * returning any `text` block themselves.
1089
- *
1090
- * - `{result:…}` wrap (2025 era only): wrap as `{result:<value>}` when the
1091
- * value is non-object (the 2025 wire shape requires `structuredContent`
1092
- * to be an object — a schema-less tool returning `[1,2,3]` would
1093
- * otherwise ship wire-illegal bytes) OR when the tool's ADVERTISED
1094
- * `outputSchema` has a non-object root (so the result matches the
1095
- * `encodeResult('tools/list')` projection of the same tool). Identity on
1096
- * the 2026 era — the wire shape carries the natural value directly.
1097
- */
1098
- projectCallToolResult(result: CallToolResult, advertisedOutputSchema: Readonly<Record<string, unknown>> | undefined): CallToolResult;
1099
- /**
1100
- * Step 1 of result decoding: RAW `resultType` handling BEFORE any schema
1101
- * validation (V-1's structural home). Era postures (Q1-SD3):
1102
- * - 2026 era: required discriminator — absent ⇒ typed error naming the
1103
- * spec violation; `input_required` ⇒ driver payload; unknown ⇒ invalid,
1104
- * no retry; `complete` ⇒ consume + lift.
1105
- * - 2025 era: `resultType` is foreign vocabulary ⇒ strip-on-lift.
1106
- */
1107
- decodeResult(method: string, raw: unknown): DecodedResult;
1108
- /**
1109
- * Outbound result mapping (the stamp seam). The 2025-era codec is the
1110
- * identity — it has NO stamp code path (the never-stamp guarantee). The
1111
- * 2026-era codec strictly enforces the 2026 wire shape for the known
1112
- * deleted-field set (`execution.taskSupport`, `capabilities.tasks` —
1113
- * Q1-SD3 iii), stamps `resultType`, and fills the required
1114
- * `ttlMs`/`cacheScope` fields on cacheable results.
1115
- */
1116
- encodeResult(method: string, result: Result$1): Result$1;
1117
- /**
1118
- * Outbound error-code mapping (the error half of the stamp seam). A
1119
- * handler-thrown `ProtocolError`'s numeric code passes through here on
1120
- * its way to the JSON-RPC error response, so per-era wire-code selection
1121
- * lives in the codec rather than in handler/funnel code. The current
1122
- * mapping is identical on both eras (the `-32002` resource-not-found
1123
- * domain code maps to `-32602` Invalid Params on the wire — the
1124
- * 2026-07-28 spec MUST, and what the deployed v1.x SDK already emits on
1125
- * earlier revisions); the seam is the structural home for any future
1126
- * per-era divergence. Unknown codes pass through unchanged.
1127
- */
1128
- encodeErrorCode(code: number): number;
1129
- /**
1130
- * @deprecated Use {@link validateEnvelopeMeta}. Inbound envelope
1131
- * enforcement for era-classified traffic: validates the lifted envelope
1132
- * material of a request. Returns an error message when the era requires
1133
- * an envelope and it is missing/invalid (→ −32602 at the dispatch
1134
- * layer); `undefined` when acceptable. The 2025 era never requires an
1135
- * envelope.
1136
- */
1137
- checkInboundEnvelope(material: LiftedWireMaterial): string | undefined;
1138
- }
1139
- //#endregion
1140
- //#region ../core-internal/src/shared/inboundClassification.d.ts
1141
- /**
1142
- * The transport-neutral description of an inbound HTTP request the classifier
1143
- * evaluates. The caller (the HTTP entry) reads the body exactly once and
1144
- * extracts the two protocol headers; the classifier never touches a request
1145
- * object itself.
1146
- */
1147
- interface InboundHttpRequest {
1148
- /** The HTTP request method, e.g. `POST`, `GET`, `DELETE`. */
1149
- httpMethod: string;
1150
- /** The value of the `MCP-Protocol-Version` header, when present. */
1151
- protocolVersionHeader?: string;
1152
- /** The value of the `Mcp-Method` header, when present. */
1153
- mcpMethodHeader?: string;
1154
- /** The value of the `Mcp-Name` header, when present. */
1155
- mcpNameHeader?: string;
1156
- /** The parsed JSON request body (`undefined` for body-less methods). */
1157
- body?: unknown;
1158
- }
1159
- /** Why an inbound request was routed to legacy-era serving. */
1160
- type InboundLegacyRouteReason = /** Non-`POST` HTTP method: a body-less 2025-era session operation. */
1161
- 'http-method'
1162
- /** An `initialize` request without a valid modern envelope claim — the legacy handshake by definition. */ | 'initialize'
1163
- /** A request without a per-request envelope claim. */ | 'no-claim'
1164
- /** A notification without a body claim or a modern protocol-version header. */ | 'notification'
1165
- /** An all-legacy JSON-RPC batch array. */ | 'batch'
1166
- /** A JSON-RPC response posted to the endpoint (2025-era session traffic). */ | 'response';
1167
- /**
1168
- * The request is legacy-era traffic. It carries no classification on purpose:
1169
- * legacy serving receives it exactly as a hand-wired 2025 transport would.
1170
- */
1171
- interface InboundLegacyRoute {
1172
- kind: 'legacy';
1173
- reason: InboundLegacyRouteReason;
1174
- /**
1175
- * The protocol version the request named, when it named one (an
1176
- * `initialize` body's `protocolVersion`, or the `MCP-Protocol-Version`
1177
- * header). Used to echo `requested` when legacy serving is not configured.
1178
- */
1179
- requestedVersion?: string;
1180
- }
1181
- /**
1182
- * The request claims the per-request envelope mechanism and is served on the
1183
- * modern path. Discriminated by `messageKind` so the typed `message` narrows
1184
- * with it — the classifier has already proved the JSON-RPC shape via the
1185
- * `isJSONRPCRequest` / `isJSONRPCNotification` guards, so consumers never
1186
- * cast the body again.
1187
- */
1188
- type InboundModernRoute = {
1189
- kind: 'modern';
1190
- messageKind: 'request';
1191
- /** The classified body — guard-proved {@linkcode JSONRPCRequest} shape. */
1192
- message: JSONRPCRequest;
1193
- /**
1194
- * The classification handed to the per-request transport and validated by
1195
- * the protocol layer against the serving instance's negotiated era.
1196
- */
1197
- classification: MessageClassification;
1198
- } | {
1199
- kind: 'modern';
1200
- messageKind: 'notification';
1201
- /** The classified body — guard-proved {@linkcode JSONRPCNotification} shape. */
1202
- message: JSONRPCNotification;
1203
- classification: MessageClassification;
1204
- };
1205
- /** The named steps of the inbound validation ladder, in evaluation order. */
1206
- type InboundValidationRung = 'http-method' | 'jsonrpc-shape' | 'era-classification' | 'envelope' | 'method-registry' | 'request-params' | 'standard-header-validation' | 'client-capabilities' | 'param-header-validation';
1207
- /** A ladder rejection: the JSON-RPC error to emit and the HTTP status to emit it with. */
1208
- interface InboundLadderRejection {
1209
- kind: 'reject';
1210
- /** The ladder rung that produced the rejection. */
1211
- rung: InboundValidationRung;
1212
- /** The cell this rejection corresponds to on the ladder cell sheet (stable identifier for tests). */
1213
- cell: string;
1214
- /** The HTTP status the rejection is emitted with. */
1215
- httpStatus: number;
1216
- /** The JSON-RPC error code. */
1217
- code: number;
1218
- /** The JSON-RPC error message. */
1219
- message: string;
1220
- /** Structured error data (recognizers parse this; they never rely on class identity). */
1221
- data?: unknown;
1222
- /**
1223
- * `false` when the exact error code for this cell is not settled upstream
1224
- * yet and the emitted code is provisional.
1225
- */
1226
- settled: boolean;
1227
- }
1228
- /** The outcome of classifying one inbound HTTP request. */
1229
- type InboundClassificationOutcome = InboundLegacyRoute | InboundModernRoute | InboundLadderRejection;
1230
- /**
1231
- * Classifies one inbound HTTP request for dual-era serving.
1232
- *
1233
- * The body-primary predicate, evaluated once at the entry boundary: see the
1234
- * module documentation for the rules. Returns a routing outcome (`legacy` or
1235
- * `modern`) or a ladder rejection; it never throws.
1236
- */
1237
- declare function classifyInboundRequest(request: InboundHttpRequest): InboundClassificationOutcome;
1238
- //#endregion
1239
- //#region ../core-internal/src/util/standardSchema.d.ts
1240
- interface StandardTypedV1<Input = unknown, Output = Input> {
1241
- readonly '~standard': StandardTypedV1.Props<Input, Output>;
1242
- }
1243
- declare namespace StandardTypedV1 {
1244
- interface Props<Input = unknown, Output = Input> {
1245
- readonly version: 1;
1246
- readonly vendor: string;
1247
- readonly types?: Types<Input, Output> | undefined;
1248
- }
1249
- interface Types<Input = unknown, Output = Input> {
1250
- readonly input: Input;
1251
- readonly output: Output;
1252
- }
1253
- type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema['~standard']['types']>['input'];
1254
- type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema['~standard']['types']>['output'];
1255
- }
1256
- interface StandardSchemaV1<Input = unknown, Output = Input> {
1257
- readonly '~standard': StandardSchemaV1.Props<Input, Output>;
1258
- }
1259
- declare namespace StandardSchemaV1 {
1260
- interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
1261
- readonly validate: (value: unknown, options?: Options | undefined) => Result<Output> | Promise<Result<Output>>;
1262
- }
1263
- interface Options {
1264
- readonly libraryOptions?: Record<string, unknown> | undefined;
1265
- }
1266
- type Result<Output> = SuccessResult<Output> | FailureResult;
1267
- interface SuccessResult<Output> {
1268
- readonly value: Output;
1269
- readonly issues?: undefined;
1270
- }
1271
- interface FailureResult {
1272
- readonly issues: ReadonlyArray<Issue>;
1273
- }
1274
- interface Issue {
1275
- readonly message: string;
1276
- readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
1277
- }
1278
- interface PathSegment {
1279
- readonly key: PropertyKey;
1280
- }
1281
- type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
1282
- type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
1283
- }
1284
- interface StandardJSONSchemaV1<Input = unknown, Output = Input> {
1285
- readonly '~standard': StandardJSONSchemaV1.Props<Input, Output>;
1286
- }
1287
- declare namespace StandardJSONSchemaV1 {
1288
- interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
1289
- readonly jsonSchema: Converter;
1290
- }
1291
- interface Converter {
1292
- readonly input: (options: Options) => Record<string, unknown>;
1293
- readonly output: (options: Options) => Record<string, unknown>;
1294
- }
1295
- type Target = 'draft-2020-12' | 'draft-07' | 'openapi-3.0' | (object & string);
1296
- interface Options {
1297
- readonly target: Target;
1298
- readonly libraryOptions?: Record<string, unknown> | undefined;
1299
- }
1300
- type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
1301
- type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
1302
- }
1303
- /**
1304
- * Combined interface for schemas with both validation and JSON Schema conversion —
1305
- * the intersection of {@linkcode StandardSchemaV1} and {@linkcode StandardJSONSchemaV1}.
1306
- *
1307
- * This is the type accepted by `registerTool` / `registerPrompt`. The SDK needs
1308
- * `~standard.jsonSchema` to advertise the tool's argument shape in `tools/list`, and
1309
- * `~standard.validate` to check incoming arguments when a `tools/call` arrives.
1310
- *
1311
- * Zod v4, ArkType, and Valibot (via `@valibot/to-json-schema`'s `toStandardJsonSchema`)
1312
- * all implement both interfaces.
1313
- *
1314
- * @see https://standardschema.dev/ for the Standard Schema specification
1315
- */
1316
- interface StandardSchemaWithJSON<Input = unknown, Output = Input> {
1317
- readonly '~standard': StandardSchemaV1.Props<Input, Output> & StandardJSONSchemaV1.Props<Input, Output>;
1318
- }
1319
- declare namespace StandardSchemaWithJSON {
1320
- type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
1321
- type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
1322
- }
1323
- /**
1324
- * Narrowing of {@linkcode StandardSchemaV1} whose `validate` is guaranteed synchronous.
1325
- *
1326
- * The Zod schemas backing `specTypeSchemas` contain no async refinements or transforms,
1327
- * so every entry satisfies this interface. Consumers can call `validate()` and access
1328
- * `.issues` / `.value` on the result without `await`.
1329
- *
1330
- * `StandardSchemaV1Sync` is assignable to `StandardSchemaV1` — it is a strict subtype.
1331
- */
1332
- interface StandardSchemaV1Sync<Input = unknown, Output = Input> extends StandardSchemaV1<Input, Output> {
1333
- readonly '~standard': StandardSchemaV1Sync.Props<Input, Output>;
1334
- }
1335
- declare namespace StandardSchemaV1Sync {
1336
- interface Props<Input = unknown, Output = Input> extends StandardSchemaV1.Props<Input, Output> {
1337
- readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => StandardSchemaV1.Result<Output>;
1338
- }
1339
- type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
1340
- type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
1341
- }
1342
- //#endregion
1343
- //#region ../core-internal/src/shared/elicitation.d.ts
1344
- /** Input accepted by `inputRequired.elicit()`: a wire-ready elicitation JSON Schema or a Standard Schema. */
1345
- type ElicitInputParams = Omit<ElicitRequestFormParams, 'requestedSchema'> & {
1346
- requestedSchema: ElicitRequestFormParams['requestedSchema'] | StandardSchemaWithJSON;
1347
- };
1348
- //#endregion
1349
- //#region ../core-internal/src/shared/inputRequired.d.ts
1350
- /** The shape accepted by {@linkcode inputRequired}. */
1351
- interface InputRequiredSpec {
1352
- /** Embedded requests the client must fulfil before retrying. */
1353
- inputRequests?: InputRequests;
1354
- /** Opaque server state echoed back verbatim by the client on retry. */
1355
- requestState?: string;
1356
- }
1357
- interface InputRequiredBuilder {
1358
- /**
1359
- * Builds the input-required return value for a multi-round-trip handler.
1360
- *
1361
- * At least one of `inputRequests` or `requestState` must be provided
1362
- * (spec: basic/patterns/mrtr, server requirements) — the builder throws a
1363
- * `TypeError` otherwise, and the server seam re-checks the same rule for
1364
- * hand-built results.
1365
- *
1366
- * `requestState` is opaque, server-minted state. It round-trips through
1367
- * the client and comes back as attacker-controlled input: a server that
1368
- * lets it influence authorization, resource access, or business logic
1369
- * MUST integrity-protect it (e.g. HMAC or AEAD) and MUST reject state
1370
- * that fails verification. The SDK does not do this for you.
1371
- */
1372
- (spec: InputRequiredSpec): InputRequiredResult;
1373
- /**
1374
- * Builds an embedded form-mode elicitation request (`elicitation/create`).
1375
- *
1376
- * A Standard Schema `requestedSchema` is converted to the restricted wire shape;
1377
- * shapes it cannot express throw a `TypeError` before anything is sent. Responses
1378
- * are not validated against it — pass the same schema to `acceptedContent()` on
1379
- * re-entry for validated, typed content.
1380
- */
1381
- elicit(params: ElicitInputParams): InputRequest;
1382
- /**
1383
- * Builds an embedded URL-mode elicitation request (`elicitation/create`).
1384
- * On the 2026-07-28 revision URL elicitation rides the multi-round-trip
1385
- * flow — the `-32042` error of earlier revisions never appears on this
1386
- * era's wire. The 2025-era `elicitationId` is not part of the 2026-07-28
1387
- * URL-mode shape; correlation across retries is the server's own
1388
- * identifier inside `requestState`.
1389
- */
1390
- elicitUrl(params: Omit<ElicitRequestURLParams, 'mode' | 'elicitationId'>): InputRequest;
1391
- /** Builds an embedded sampling request (`sampling/createMessage`). */
1392
- createMessage(params: CreateMessageRequestParams): InputRequest;
1393
- /** Builds an embedded roots listing request (`roots/list`). */
1394
- listRoots(): InputRequest;
1395
- }
1396
- /**
1397
- * Builder for the input-required return value of multi-round-trip handlers,
1398
- * with per-kind constructors for the embedded requests
1399
- * (`inputRequired.elicit`, `inputRequired.elicitUrl`,
1400
- * `inputRequired.createMessage`, `inputRequired.listRoots`).
1401
- *
1402
- * @example Write-once tool requesting confirmation
1403
- * ```ts
1404
- * server.registerTool('deploy', { inputSchema: z.object({ env: z.string() }) }, async ({ env }, ctx) => {
1405
- * const confirmed = acceptedContent<{ confirm: boolean }>(ctx.mcpReq.inputResponses, 'confirm');
1406
- * if (!confirmed) {
1407
- * return inputRequired({
1408
- * inputRequests: {
1409
- * confirm: inputRequired.elicit({
1410
- * message: `Deploy to ${env}?`,
1411
- * requestedSchema: { type: 'object', properties: { confirm: { type: 'boolean' } }, required: ['confirm'] }
1412
- * })
1413
- * }
1414
- * });
1415
- * }
1416
- * return { content: [{ type: 'text', text: `deployed to ${env}` }] };
1417
- * });
1418
- * ```
1419
- */
1420
- declare const inputRequired: InputRequiredBuilder;
1421
- /**
1422
- * Reads the accepted content of a form-mode elicitation response from a
1423
- * retried request's `inputResponses` (`ctx.mcpReq.inputResponses`).
1424
- *
1425
- * Returns the response's `content` for `key` when the entry is an accepted
1426
- * elicitation result, and `undefined` otherwise (missing key, declined or
1427
- * cancelled elicitation, or a response of another kind). The values arrive
1428
- * from the client and are not re-validated here — treat them as untrusted
1429
- * input.
1430
- */
1431
- declare function acceptedContent<T$1 extends Record<string, unknown> = Record<string, unknown>>(responses: InputResponses | Record<string, unknown> | undefined, key: string): T$1 | undefined;
1432
- /**
1433
- * Schema-aware overload: validates the accepted content against the given
1434
- * schema (any Standard Schema, e.g. a zod object) before returning it, so the
1435
- * untrusted client value arrives in the handler already validated and typed.
1436
- *
1437
- * Returns `undefined` when the response is missing/declined/of another kind
1438
- * (as the two-argument form does) AND when the accepted content fails schema
1439
- * validation — handlers treat both the same way (re-issue the request or
1440
- * give up). Only synchronous schemas are supported (zod schemas without async
1441
- * refinements are synchronous); an asynchronously-validating schema throws a
1442
- * `TypeError`.
1443
- */
1444
- declare function acceptedContent<S extends StandardSchemaV1>(responses: InputResponses | Record<string, unknown> | undefined, key: string, schema: S): StandardSchemaV1.InferOutput<S> | undefined;
1445
- /**
1446
- * The discriminated view {@linkcode inputResponse} returns: which kind of
1447
- * embedded response (if any) a retried request carried for a key. Bare
1448
- * response objects are discriminated structurally — an `action` member means
1449
- * an elicitation result, a `roots` array a roots listing, a `role` + `content`
1450
- * pair a sampling result. A missing key or an entry that matches none of the
1451
- * three shapes reads as `{ kind: 'missing' }`.
1452
- */
1453
- type InputResponseView = {
1454
- kind: 'missing';
1455
- } | {
1456
- kind: 'elicit';
1457
- action: 'accept' | 'decline' | 'cancel';
1458
- content?: Record<string, unknown>;
1459
- } | {
1460
- kind: 'sampling';
1461
- result: CreateMessageResult | CreateMessageResultWithTools;
1462
- } | {
1463
- kind: 'roots';
1464
- roots: Root[];
1465
- };
1466
- /**
1467
- * Reads one entry of a retried request's `inputResponses`
1468
- * (`ctx.mcpReq.inputResponses`) as a discriminated view, covering
1469
- * decline/cancel detection and the non-elicitation response kinds that
1470
- * {@linkcode acceptedContent} does not surface.
1471
- *
1472
- * The values arrive from the client and are not re-validated here — treat
1473
- * them as untrusted input (validate elicitation content with the
1474
- * schema-aware {@linkcode acceptedContent} overload where it matters).
1475
- */
1476
- declare function inputResponse(responses: InputResponses | Record<string, unknown> | undefined, key: string): InputResponseView;
1477
- //#endregion
1478
- //#region ../core-internal/src/types/enums.d.ts
1479
- /**
1480
- * Error codes for protocol errors that cross the wire as JSON-RPC error responses.
1481
- * These follow the JSON-RPC specification and MCP-specific extensions.
1482
- */
1483
- declare enum ProtocolErrorCode {
1484
- ParseError = -32700,
1485
- InvalidRequest = -32600,
1486
- MethodNotFound = -32601,
1487
- InvalidParams = -32602,
1488
- InternalError = -32603,
1489
- /**
1490
- * Resource not found.
1491
- *
1492
- * Receive-tolerated only: the SDK never EMITS `-32002` — `resources/read`
1493
- * misses answer `-32602` (Invalid Params) on every protocol revision per
1494
- * the 2026-07-28 spec MUST, and a handler-thrown `-32002` is mapped to
1495
- * `-32602` at the era encode seam. The member stays importable so clients
1496
- * can recognise `-32002` from peers built on earlier SDK releases (the
1497
- * spec's "clients SHOULD also accept `-32002`" backwards-compatibility
1498
- * clause). Throw `ResourceNotFoundError` instead.
1499
- */
1500
- ResourceNotFound = -32002,
1501
- /**
1502
- * Processing the request requires a capability the client did not declare
1503
- * in the request's `clientCapabilities` (protocol revision 2026-07-28).
1504
- */
1505
- MissingRequiredClientCapability = -32021,
1506
- /**
1507
- * The request's protocol version is unknown to the server or unsupported
1508
- * by it (protocol revision 2026-07-28).
1509
- */
1510
- UnsupportedProtocolVersion = -32022,
1511
- UrlElicitationRequired = -32042,
1512
- }
1513
- //#endregion
1514
- //#region ../core-internal/src/types/errors.d.ts
1515
- /**
1516
- * Protocol errors are JSON-RPC errors that cross the wire as error responses.
1517
- * They use numeric error codes from the {@linkcode ProtocolErrorCode} enum.
1518
- *
1519
- * `instanceof` on this class (and its subclasses) is brand-matched, so it works
1520
- * across separately bundled copies of the SDK — e.g. an error constructed by
1521
- * `@modelcontextprotocol/client` matches the class re-exported by
1522
- * `@modelcontextprotocol/server` in the same process.
1523
- */
1524
- declare class ProtocolError extends Error {
1525
- readonly code: number;
1526
- readonly data?: unknown | undefined;
1527
- static [Symbol.hasInstance](value: unknown): boolean;
1528
- /**
1529
- * Brand-based type guard: equivalent to `value instanceof this`, as an
1530
- * explicit static predicate (the axios/AWS-SDK `isInstance` style). Reads
1531
- * the caller's own brand via `this`, so every branded subclass gets a
1532
- * correctly-scoped guard by inheritance. Must be invoked on the class —
1533
- * in callback position write `v => SdkError.isInstance(v)`, not
1534
- * `.filter(SdkError.isInstance)` (detached calls throw rather than
1535
- * silently matching nothing).
1536
- */
1537
- static isInstance<T$1 extends abstract new (...args: never[]) => unknown>(this: T$1, value: unknown): value is InstanceType<T$1>;
1538
- constructor(code: number, message: string, data?: unknown | undefined);
1539
- /**
1540
- * Factory method to create the appropriate error type based on the error code and data
1541
- */
1542
- static fromError(code: number, message: string, data?: unknown): ProtocolError;
1543
- }
1544
- /**
1545
- * Error type for a `resources/read` miss: the requested resource does not
1546
- * exist. The wire code is `-32602` (Invalid Params) on every protocol
1547
- * revision — the spec MUST for revision 2026-07-28, and the value the v1.x
1548
- * SDK has always emitted on earlier revisions. The error data echoes the
1549
- * requested URI.
1550
- *
1551
- * Recognise this error by checking `error.data` is exactly `{ uri: string }`
1552
- * (a `-32602` whose data carries `uri` and nothing else is resource-not-found;
1553
- * any other `-32602` is an ordinary Invalid Params). For backwards compatibility, clients should also
1554
- * accept `-32002` as resource not found — earlier SDK builds emitted that
1555
- * code, and {@linkcode ProtocolError.fromError} reconstructs this class for
1556
- * either code **when `error.data` carries `uri`** (a bare `-32002` without
1557
- * `data.uri` stays a generic {@linkcode ProtocolError}). `instanceof` checks
1558
- * are brand-matched and work across separately bundled copies of the SDK.
1559
- */
1560
- declare class ResourceNotFoundError extends ProtocolError {
1561
- constructor(uri: string, message?: string);
1562
- /** The URI that was requested and not found. */
1563
- get uri(): string;
1564
- }
1565
- /**
1566
- * Specialized error type when a tool requires a URL mode elicitation.
1567
- * This makes it nicer for the client to handle since there is specific data to work with instead of just a code to check against.
1568
- */
1569
- declare class UrlElicitationRequiredError extends ProtocolError {
1570
- constructor(elicitations: ElicitRequestURLParams[], message?: string);
1571
- get elicitations(): ElicitRequestURLParams[];
1572
- }
1573
- /**
1574
- * Error type for the `-32022` UnsupportedProtocolVersion protocol error (protocol
1575
- * revision 2026-07-28): the request's protocol version is unknown to the server or
1576
- * unsupported by it.
1577
- *
1578
- * The error data lists the protocol versions the receiver supports (`supported`),
1579
- * so the sender can choose a mutually supported version and retry, and echoes the
1580
- * version that was requested (`requested`).
1581
- */
1582
- declare class UnsupportedProtocolVersionError extends ProtocolError {
1583
- constructor(data: UnsupportedProtocolVersionErrorData, message?: string);
1584
- /**
1585
- * Protocol versions the receiver supports.
1586
- */
1587
- get supported(): string[];
1588
- /**
1589
- * The protocol version that was requested.
1590
- */
1591
- get requested(): string;
1592
- }
1593
- /**
1594
- * Error type for the `-32021` MissingRequiredClientCapability protocol error
1595
- * (protocol revision 2026-07-28): processing the request requires a capability
1596
- * the client did not declare in the request's `clientCapabilities`.
1597
- *
1598
- * The error data lists the missing capabilities (`requiredCapabilities`) in
1599
- * the `ClientCapabilities` shape, so the client can see exactly what it would
1600
- * have to declare for the request to be served. On HTTP, the response status
1601
- * is `400 Bad Request`.
1602
- *
1603
- * Recognize this error by its code and `data.requiredCapabilities`, or by
1604
- * `instanceof` — checks are brand-matched and work across separately bundled
1605
- * copies of the SDK.
1606
- */
1607
- declare class MissingRequiredClientCapabilityError extends ProtocolError {
1608
- constructor(data: MissingRequiredClientCapabilityErrorData, message?: string);
1609
- /**
1610
- * The capabilities the server requires from the client to process the
1611
- * request (only the missing capabilities are listed).
1612
- */
1613
- get requiredCapabilities(): ClientCapabilities;
1614
- }
1615
- //#endregion
1616
- //#region ../core-internal/src/types/guards.d.ts
1617
- /**
1618
- * Validates and parses an unknown value as a JSON-RPC message.
1619
- *
1620
- * Use this to validate incoming messages in custom transport implementations.
1621
- * Throws if the value does not conform to the JSON-RPC message schema.
1622
- *
1623
- * @param value - The value to validate (typically a parsed JSON object).
1624
- * @returns The validated {@linkcode JSONRPCMessage}.
1625
- * @throws If validation fails.
1626
- */
1627
- declare function parseJSONRPCMessage(value: unknown): JSONRPCMessage;
1628
- declare const isJSONRPCRequest: (value: unknown) => value is JSONRPCRequest;
1629
- declare const isJSONRPCNotification: (value: unknown) => value is JSONRPCNotification;
1630
- /**
1631
- * Checks if a value is a valid {@linkcode JSONRPCResultResponse}.
1632
- * @param value - The value to check.
1633
- *
1634
- * @returns True if the value is a valid {@linkcode JSONRPCResultResponse}, false otherwise.
1635
- */
1636
- declare const isJSONRPCResultResponse: (value: unknown) => value is JSONRPCResultResponse;
1637
- /**
1638
- * Checks if a value is a valid {@linkcode JSONRPCErrorResponse}.
1639
- * @param value - The value to check.
1640
- *
1641
- * @returns True if the value is a valid {@linkcode JSONRPCErrorResponse}, false otherwise.
1642
- */
1643
- declare const isJSONRPCErrorResponse: (value: unknown) => value is JSONRPCErrorResponse;
1644
- /**
1645
- * Checks if a value is a valid {@linkcode JSONRPCResponse} (either a result or error response).
1646
- * @param value - The value to check.
1647
- *
1648
- * @returns True if the value is a valid {@linkcode JSONRPCResponse}, false otherwise.
1649
- */
1650
- declare const isJSONRPCResponse: (value: unknown) => value is JSONRPCResponse;
1651
- /**
1652
- * Checks if a value is a valid {@linkcode CallToolResult}.
1653
- *
1654
- * This is a consumer-side VALUE check against the neutral model, not a wire
1655
- * validator: a raw wire object that additionally carries wire-only members
1656
- * (e.g. `resultType`) still passes through the loose index signature. Use a
1657
- * transport-level parse to validate raw wire traffic.
1658
- *
1659
- * @param value - The value to check.
1660
- *
1661
- * @returns True if the value is a valid {@linkcode CallToolResult}, false otherwise.
1662
- */
1663
- declare const isCallToolResult: (value: unknown) => value is CallToolResult;
1664
- /**
1665
- * Checks whether a value is an input-required result (protocol revision
1666
- * 2026-07-28): the multi-round-trip return shape discriminated by
1667
- * `resultType: 'input_required'`.
1668
- *
1669
- * This is a discriminator check, not a full validator — the at-least-one rule
1670
- * (`inputRequests` or `requestState`) is enforced by the `inputRequired()`
1671
- * builder and re-checked by the server seam for hand-built values.
1672
- *
1673
- * @param value - The value to check.
1674
- * @returns True if the value carries the `input_required` discriminator.
1675
- */
1676
- declare const isInputRequiredResult: (value: unknown) => value is InputRequiredResult;
1677
- /**
1678
- * Checks if a value is a valid {@linkcode TaskAugmentedRequestParams}.
1679
- * @param value - The value to check.
1680
- *
1681
- * @returns True if the value is a valid {@linkcode TaskAugmentedRequestParams}, false otherwise.
1682
- *
1683
- * @deprecated Recognizes 2025-11-25 task wire vocabulary, which has no SDK
1684
- * runtime; kept importable for interoperability only.
1685
- */
1686
- declare const isTaskAugmentedRequestParams: (value: unknown) => value is TaskAugmentedRequestParams;
1687
- declare const isInitializeRequest: (value: unknown) => value is InitializeRequest;
1688
- declare const isInitializedNotification: (value: unknown) => value is InitializedNotification;
1689
- declare function assertCompleteRequestPrompt(request: CompleteRequest): asserts request is CompleteRequestPrompt;
1690
- declare function assertCompleteRequestResourceTemplate(request: CompleteRequest): asserts request is CompleteRequestResourceTemplate;
1691
- //#endregion
1692
- //#region ../core-internal/src/types/specTypeSchema.d.ts
1693
- /**
1694
- * Explicit allowlist of protocol Zod schemas that correspond to a public spec type in `types.ts`.
1695
- *
1696
- * This intentionally excludes internal helper schemas exported from `schemas.ts` that have no
1697
- * matching public type (e.g. `ListChangedOptionsBaseSchema`, `BaseRequestParamsSchema`,
1698
- * `NotificationsParamsSchema`, `ClientTasksCapabilitySchema`, `ServerTasksCapabilitySchema`).
1699
- * Keeping the list explicit means new public spec types must be added here deliberately, and
1700
- * internals never leak into `SpecTypeName`.
1701
- *
1702
- * `ResourceTemplateSchema` is included; its public type is exported as `ResourceTemplateType`
1703
- * (the bare name collides with the server package's `ResourceTemplate` class), so
1704
- * `SpecTypes['ResourceTemplate']` is structurally equal to `ResourceTemplateType` rather than to
1705
- * a type literally named `ResourceTemplate`.
1706
- */
1707
- declare const SPEC_SCHEMA_KEYS: readonly ["AnnotationsSchema", "AudioContentSchema", "BaseMetadataSchema", "BlobResourceContentsSchema", "BooleanSchemaSchema", "CallToolRequestSchema", "CallToolRequestParamsSchema", "CallToolResultSchema", "CancelledNotificationSchema", "CancelledNotificationParamsSchema", "CancelTaskRequestSchema", "CancelTaskResultSchema", "ClientCapabilitiesSchema", "ClientNotificationSchema", "ClientRequestSchema", "ClientResultSchema", "CompatibilityCallToolResultSchema", "CompleteRequestSchema", "CompleteRequestParamsSchema", "CompleteResultSchema", "ContentBlockSchema", "CreateMessageRequestSchema", "CreateMessageRequestParamsSchema", "CreateMessageResultSchema", "CreateMessageResultWithToolsSchema", "CreateTaskResultSchema", "CursorSchema", "DiscoverRequestSchema", "DiscoverResultSchema", "ElicitationCompleteNotificationSchema", "ElicitationCompleteNotificationParamsSchema", "ElicitRequestSchema", "ElicitRequestFormParamsSchema", "ElicitRequestParamsSchema", "ElicitRequestURLParamsSchema", "ElicitResultSchema", "EmbeddedResourceSchema", "EmptyResultSchema", "EnumSchemaSchema", "GetPromptRequestSchema", "GetPromptRequestParamsSchema", "GetPromptResultSchema", "GetTaskPayloadRequestSchema", "GetTaskPayloadResultSchema", "GetTaskRequestSchema", "GetTaskResultSchema", "IconSchema", "IconsSchema", "ImageContentSchema", "ImplementationSchema", "InitializedNotificationSchema", "InitializeRequestSchema", "InitializeRequestParamsSchema", "InitializeResultSchema", "JSONArraySchema", "JSONObjectSchema", "JSONRPCErrorResponseSchema", "JSONRPCMessageSchema", "JSONRPCNotificationSchema", "JSONRPCRequestSchema", "JSONRPCResponseSchema", "JSONRPCResultResponseSchema", "JSONValueSchema", "LegacyTitledEnumSchemaSchema", "ListPromptsRequestSchema", "ListPromptsResultSchema", "ListResourcesRequestSchema", "ListResourcesResultSchema", "ListResourceTemplatesRequestSchema", "ListResourceTemplatesResultSchema", "ListRootsRequestSchema", "ListRootsResultSchema", "ListTasksRequestSchema", "ListTasksResultSchema", "ListToolsRequestSchema", "ListToolsResultSchema", "LoggingLevelSchema", "LoggingMessageNotificationSchema", "LoggingMessageNotificationParamsSchema", "ModelHintSchema", "ModelPreferencesSchema", "MultiSelectEnumSchemaSchema", "NotificationSchema", "NumberSchemaSchema", "PaginatedRequestSchema", "PaginatedRequestParamsSchema", "PaginatedResultSchema", "PingRequestSchema", "PrimitiveSchemaDefinitionSchema", "ProgressSchema", "ProgressNotificationSchema", "ProgressNotificationParamsSchema", "ProgressTokenSchema", "PromptSchema", "PromptArgumentSchema", "PromptListChangedNotificationSchema", "PromptMessageSchema", "PromptReferenceSchema", "ReadResourceRequestSchema", "ReadResourceRequestParamsSchema", "ReadResourceResultSchema", "RelatedTaskMetadataSchema", "RequestSchema", "RequestIdSchema", "RequestMetaSchema", "ResourceSchema", "ResourceContentsSchema", "ResourceLinkSchema", "ResourceListChangedNotificationSchema", "ResourceRequestParamsSchema", "ResourceTemplateSchema", "ResourceTemplateReferenceSchema", "ResourceUpdatedNotificationSchema", "ResourceUpdatedNotificationParamsSchema", "ResultSchema", "RoleSchema", "RootSchema", "RootsListChangedNotificationSchema", "SamplingContentSchema", "SamplingMessageSchema", "SamplingMessageContentBlockSchema", "ServerCapabilitiesSchema", "ServerNotificationSchema", "ServerRequestSchema", "ServerResultSchema", "SetLevelRequestSchema", "SetLevelRequestParamsSchema", "SingleSelectEnumSchemaSchema", "StringSchemaSchema", "SubscribeRequestSchema", "SubscribeRequestParamsSchema", "SubscriptionFilterSchema", "SubscriptionsAcknowledgedNotificationSchema", "SubscriptionsAcknowledgedNotificationParamsSchema", "SubscriptionsListenRequestSchema", "SubscriptionsListenRequestParamsSchema", "SubscriptionsListenResultSchema", "SubscriptionsListenResultMetaSchema", "TaskAugmentedRequestParamsSchema", "TaskCreationParamsSchema", "TaskMetadataSchema", "TaskSchema", "TaskStatusSchema", "TaskStatusNotificationSchema", "TaskStatusNotificationParamsSchema", "TextContentSchema", "TextResourceContentsSchema", "TitledMultiSelectEnumSchemaSchema", "TitledSingleSelectEnumSchemaSchema", "ToolSchema", "ToolAnnotationsSchema", "ToolChoiceSchema", "ToolExecutionSchema", "ToolListChangedNotificationSchema", "ToolResultContentSchema", "ToolUseContentSchema", "UnsubscribeRequestSchema", "UnsubscribeRequestParamsSchema", "UntitledMultiSelectEnumSchemaSchema", "UntitledSingleSelectEnumSchemaSchema"];
1708
- declare const authSchemas: {
1709
- readonly IdJagTokenExchangeResponseSchema: any;
1710
- readonly OAuthClientInformationFullSchema: any;
1711
- readonly OAuthClientInformationSchema: any;
1712
- readonly OAuthClientMetadataSchema: any;
1713
- readonly OAuthClientRegistrationErrorSchema: any;
1714
- readonly OAuthErrorResponseSchema: any;
1715
- readonly OAuthMetadataSchema: any;
1716
- readonly OAuthProtectedResourceMetadataSchema: any;
1717
- readonly OAuthTokenRevocationRequestSchema: any;
1718
- readonly OAuthTokensSchema: any;
1719
- readonly OpenIdProviderDiscoveryMetadataSchema: any;
1720
- readonly OpenIdProviderMetadataSchema: any;
1721
- };
1722
- type ProtocolSchemaKey = (typeof SPEC_SCHEMA_KEYS)[number];
1723
- type AuthSchemaKey = keyof typeof authSchemas;
1724
- type SchemaKey = ProtocolSchemaKey | AuthSchemaKey;
1725
- type SchemaFor<K$1 extends SchemaKey> = K$1 extends ProtocolSchemaKey ? (typeof schemas_d_exports)[K$1] : K$1 extends AuthSchemaKey ? (typeof authSchemas)[K$1] : never;
1726
- type StripSchemaSuffix<K$1> = K$1 extends `${infer N}Schema` ? N : never;
1727
- /**
1728
- * Union of every named type in the SDK's protocol and OAuth schemas (e.g. `'CallToolResult'`,
1729
- * `'ContentBlock'`, `'Tool'`, `'OAuthTokens'`). Derived from the internal Zod schemas, so it stays
1730
- * in sync with the spec.
1731
- */
1732
- type SpecTypeName = StripSchemaSuffix<SchemaKey>;
1733
- /**
1734
- * Maps each {@linkcode SpecTypeName} to its TypeScript type.
1735
- *
1736
- * `SpecTypes['Tool']` is equivalent to importing the `Tool` type directly.
1737
- * These validators cover the NEUTRAL model — the consumer-facing shapes with
1738
- * no wire-only members (`resultType`, the reserved `_meta` envelope keys).
1739
- * Per-revision WIRE validators are deliberately not public surface; they are
1740
- * planned to return as versioned `zod-schemas/<revision>` exports for
1741
- * consumers who validate raw wire traffic themselves.
1742
- */
1743
- type SpecTypes = { [K in SchemaKey as StripSchemaSuffix<K>]: SchemaFor<K> extends z.ZodType ? z.output<SchemaFor<K>> : never };
1744
- /**
1745
- * Input shape for each {@linkcode SpecTypeName}. For most types this equals {@linkcode SpecTypes},
1746
- * but a few schemas apply defaults/preprocessing, so the accepted input may be looser than the
1747
- * resulting output type.
1748
- */
1749
- type SpecTypeInputs = { [K in SchemaKey as StripSchemaSuffix<K>]: SchemaFor<K> extends z.ZodType ? z.input<SchemaFor<K>> : never };
1750
- type SchemaRecord = { readonly [K in SpecTypeName]: StandardSchemaV1Sync<SpecTypeInputs[K], SpecTypes[K]> };
1751
- type GuardRecord = { readonly [K in SpecTypeName]: (value: unknown) => value is SpecTypeInputs[K] };
1752
- /**
1753
- * Runtime validators for every MCP spec type, keyed by type name.
1754
- *
1755
- * Use this when you need to validate a spec-defined shape at a boundary the SDK does not own, for
1756
- * example an extension's custom-method payload that embeds a `CallToolResult`, or a value read from
1757
- * storage that should be a `Tool`.
1758
- *
1759
- * Each entry implements the Standard Schema interface, so it composes with any
1760
- * Standard-Schema-aware library. For a simple boolean check, use {@linkcode isSpecType} instead.
1761
- *
1762
- * @example
1763
- * ```ts source="./specTypeSchema.examples.ts#specTypeSchemas_basicUsage"
1764
- * const result = specTypeSchemas.CallToolResult['~standard'].validate(untrusted);
1765
- * if (result.issues === undefined) {
1766
- * // result.value is CallToolResult
1767
- * }
1768
- * ```
1769
- */
1770
- declare const specTypeSchemas: SchemaRecord;
1771
- /**
1772
- * Type predicates for every MCP spec type, keyed by type name.
1773
- *
1774
- * Returns `true` if the value satisfies the schema's input type (`z.input<>`, before defaults and
1775
- * transforms are applied), and narrows to that input type. For schemas with `.default()` or
1776
- * `.preprocess()`, this may accept values that do not structurally match the named output type;
1777
- * for example `isSpecType.CallToolResult({})` is `true` because `content` has a default. Use
1778
- * `specTypeSchemas.X['~standard'].validate(value)` when you need the validated output value.
1779
- *
1780
- * Each guard is a standalone function, so it can be passed directly as a callback.
1781
- *
1782
- * @example
1783
- * ```ts source="./specTypeSchema.examples.ts#isSpecType_basicUsage"
1784
- * if (isSpecType.ContentBlock(value)) {
1785
- * // value is ContentBlock
1786
- * }
1787
- *
1788
- * const blocks = mixed.filter(isSpecType.ContentBlock);
1789
- * ```
1790
- */
1791
- declare const isSpecType: GuardRecord;
1792
- //#endregion
1793
- //#region ../core-internal/src/shared/transport.d.ts
1794
- type FetchLike = (url: string | URL, init?: RequestInit) => Promise<Response>;
1795
- /**
1796
- * Creates a fetch function that includes base `RequestInit` options.
1797
- * This ensures requests inherit settings like credentials, mode, headers, etc. from the base init.
1798
- *
1799
- * @param baseFetch - The base fetch function to wrap (defaults to global `fetch`)
1800
- * @param baseInit - The base `RequestInit` to merge with each request
1801
- * @returns A wrapped fetch function that merges base options with call-specific options
1802
- */
1803
- declare function createFetchWithInit(baseFetch?: FetchLike, baseInit?: RequestInit): FetchLike;
1804
- /**
1805
- * Options for sending a JSON-RPC message.
1806
- */
1807
- type TransportSendOptions = {
1808
- /**
1809
- * If present, `relatedRequestId` is used to indicate to the transport which incoming request to associate this outgoing message with.
1810
- */
1811
- relatedRequestId?: RequestId | undefined;
1812
- /**
1813
- * The resumption token used to continue long-running requests that were interrupted.
1814
- *
1815
- * This allows clients to reconnect and continue from where they left off, if supported by the transport.
1816
- */
1817
- resumptionToken?: string | undefined;
1818
- /**
1819
- * A callback that is invoked when the resumption token changes, if supported by the transport.
1820
- *
1821
- * This allows clients to persist the latest token for potential reconnection.
1822
- */
1823
- onresumptiontoken?: ((token: string) => void) | undefined;
1824
- /**
1825
- * An abort signal for THIS outbound message's underlying request, when the
1826
- * transport sends one outbound message per underlying request (the
1827
- * Streamable HTTP transport's POST-per-request model). Aborting it cancels
1828
- * the underlying request (and its SSE response stream) without closing the
1829
- * transport. Transports that share a single channel (stdio, in-memory)
1830
- * ignore it.
1831
- */
1832
- requestSignal?: AbortSignal | undefined;
1833
- /**
1834
- * Fired by transports that open a per-request stream (the Streamable HTTP
1835
- * transport's POST-per-request SSE response) when that stream ends or
1836
- * errors for any reason OTHER than a deliberate `requestSignal` abort —
1837
- * i.e. the server closed the stream, the network dropped it, or
1838
- * reconnection was exhausted. Transports that share a single channel
1839
- * (stdio, in-memory) ignore it.
1840
- */
1841
- onRequestStreamEnd?: (() => void) | undefined;
1842
- /**
1843
- * Additional HTTP headers to send with THIS outbound message, when the
1844
- * transport sends one outbound message per underlying HTTP request (the
1845
- * Streamable HTTP transport's POST-per-request model). Transports that
1846
- * share a single channel (stdio, in-memory) ignore it.
1847
- *
1848
- * The Client uses this to attach SEP-2243 `Mcp-Param-{Name}` headers to a
1849
- * `tools/call` request on a 2026-07-28 connection. Values are sent
1850
- * verbatim — encode anything that is not a safe RFC 9110 field value
1851
- * before passing it here.
1852
- */
1853
- headers?: Readonly<Record<string, string>> | undefined;
1854
- };
1855
- /**
1856
- * Describes the minimal contract for an MCP transport that a client or server can communicate over.
1857
- */
1858
- interface Transport {
1859
- /**
1860
- * Starts processing messages on the transport, including any connection steps that might need to be taken.
1861
- *
1862
- * This method should only be called after callbacks are installed, or else messages may be lost.
1863
- *
1864
- * NOTE: This method should not be called explicitly when using {@linkcode @modelcontextprotocol/client!client/client.Client | Client} or {@linkcode @modelcontextprotocol/server!server/server.Server | Server} classes, as they will implicitly call {@linkcode Transport.start | start()}.
1865
- */
1866
- start(): Promise<void>;
1867
- /**
1868
- * Sends a JSON-RPC message (request or response).
1869
- *
1870
- * If present, `relatedRequestId` is used to indicate to the transport which incoming request to associate this outgoing message with.
1871
- */
1872
- send(message: JSONRPCMessage, options?: TransportSendOptions): Promise<void>;
1873
- /**
1874
- * Closes the connection.
1875
- */
1876
- close(): Promise<void>;
1877
- /**
1878
- * `true` when this transport opens one underlying request per outbound
1879
- * JSON-RPC request (the Streamable HTTP POST-per-request model) and
1880
- * therefore honors {@linkcode TransportSendOptions.requestSignal}. The
1881
- * 2026-07-28 spec makes closing that per-request stream the cancellation
1882
- * signal — the protocol layer aborts `requestSignal` instead of POSTing
1883
- * `notifications/cancelled` when this flag is set on a 2026-era
1884
- * connection. Transports that share a single channel (stdio, in-memory)
1885
- * leave it `undefined`.
1886
- */
1887
- readonly hasPerRequestStream?: boolean;
1888
- /**
1889
- * Callback for when the connection is closed for any reason.
1890
- *
1891
- * This should be invoked when {@linkcode Transport.close | close()} is called as well.
1892
- */
1893
- onclose?: (() => void) | undefined;
1894
- /**
1895
- * Callback for when an error occurs.
1896
- *
1897
- * Note that errors are not necessarily fatal; they are used for reporting any kind of exceptional condition out of band.
1898
- */
1899
- onerror?: ((error: Error) => void) | undefined;
1900
- /**
1901
- * Callback for when a message (request or response) is received over the connection.
1902
- *
1903
- * Includes the {@linkcode MessageExtraInfo.request | request} and {@linkcode MessageExtraInfo.authInfo | authInfo} if the transport is authenticated.
1904
- *
1905
- * The {@linkcode MessageExtraInfo.request | request} can be used to get the original request information (headers, etc.)
1906
- */
1907
- onmessage?: (<T$1 extends JSONRPCMessage>(message: T$1, extra?: MessageExtraInfo) => void) | undefined;
1908
- /**
1909
- * The session ID generated for this connection.
1910
- */
1911
- sessionId?: string | undefined;
1912
- /**
1913
- * Sets the protocol version used for the connection (called when the initialize response is received).
1914
- */
1915
- setProtocolVersion?: ((version: string) => void) | undefined;
1916
- /**
1917
- * Sets the supported protocol versions for header validation (called during connect).
1918
- * This allows the server to pass its supported versions to the transport.
1919
- */
1920
- setSupportedProtocolVersions?: ((versions: string[]) => void) | undefined;
1921
- }
1922
- //#endregion
1923
- //#region ../core-internal/src/shared/protocol.d.ts
1924
- /**
1925
- * Callback for progress notifications.
1926
- */
1927
- type ProgressCallback = (progress: Progress) => void;
1928
- /**
1929
- * Additional initialization options.
1930
- */
1931
- type ProtocolOptions = {
1932
- /**
1933
- * Protocol versions supported. The legacy `initialize` handshake offers and
1934
- * falls back to the first 2025-era entry in the list (the client sends it,
1935
- * the server counter-offers it); 2026-era entries are only ever selected via
1936
- * `server/discover`. Passed to transport during {@linkcode Protocol.connect | connect()}.
1937
- *
1938
- * @default {@linkcode SUPPORTED_PROTOCOL_VERSIONS}
1939
- */
1940
- supportedProtocolVersions?: string[];
1941
- /**
1942
- * Whether to restrict emitted requests to only those that the remote side has indicated that they can handle, through their advertised capabilities.
1943
- *
1944
- * Note that this DOES NOT affect checking of _local_ side capabilities, as it is considered a logic error to mis-specify those.
1945
- *
1946
- * Currently this defaults to `false`, for backwards compatibility with SDK versions that did not advertise capabilities correctly. In future, this will default to `true`.
1947
- */
1948
- enforceStrictCapabilities?: boolean;
1949
- /**
1950
- * An array of notification method names that should be automatically debounced.
1951
- * Any notifications with a method in this list will be coalesced if they
1952
- * occur in the same tick of the event loop.
1953
- * e.g., `['notifications/tools/list_changed']`
1954
- */
1955
- debouncedNotificationMethods?: string[];
1956
- };
1957
- /**
1958
- * The default request timeout, in milliseconds.
1959
- */
1960
- declare const DEFAULT_REQUEST_TIMEOUT_MSEC = 60000;
1961
- /**
1962
- * Options that can be given per request.
1963
- */
1964
- type RequestOptions = {
1965
- /**
1966
- * If set, requests progress notifications from the remote end (if supported). When progress notifications are received, this callback will be invoked.
1967
- */
1968
- onprogress?: ProgressCallback;
1969
- /**
1970
- * Can be used to cancel an in-flight request. This will cause an `AbortError` to be raised from {@linkcode Protocol.request | request()}.
1971
- */
1972
- signal?: AbortSignal;
1973
- /**
1974
- * A timeout (in milliseconds) for this request. If exceeded, an {@linkcode SdkError} with code {@linkcode SdkErrorCode.RequestTimeout} will be raised from {@linkcode Protocol.request | request()}.
1975
- *
1976
- * If not specified, {@linkcode DEFAULT_REQUEST_TIMEOUT_MSEC} will be used as the timeout.
1977
- */
1978
- timeout?: number;
1979
- /**
1980
- * If `true`, receiving a progress notification will reset the request timeout.
1981
- * This is useful for long-running operations that send periodic progress updates.
1982
- * Default: `false`
1983
- */
1984
- resetTimeoutOnProgress?: boolean;
1985
- /**
1986
- * Maximum total time (in milliseconds) to wait for a response.
1987
- * If exceeded, an {@linkcode SdkError} with code {@linkcode SdkErrorCode.RequestTimeout} will be raised, regardless of progress notifications.
1988
- * If not specified, there is no maximum total timeout.
1989
- *
1990
- * For multi-round-trip requests fulfilled by the auto-fulfilment driver
1991
- * (protocol revision 2026-07-28), the budget bounds the WHOLE flow: every
1992
- * retry leg is given only the time remaining.
1993
- */
1994
- maxTotalTimeout?: number;
1995
- /**
1996
- * Manual multi-round-trip mode for this call (protocol revision
1997
- * 2026-07-28): when the response is an `input_required` result, hand it
1998
- * back to the caller instead of auto-fulfilling it (or raising a typed
1999
- * error). The resolved value is the neutral input-required shape
2000
- * (`resultType: 'input_required'`, `inputRequests?`, `requestState?`);
2001
- * wrap the result schema with `withInputRequired()` on the explicit
2002
- * schema path to type both outcomes. The caller is then responsible for
2003
- * gathering the requested input and retrying the original request with
2004
- * `inputResponses` / `requestState` params and a fresh request.
2005
- *
2006
- * Default: `false`.
2007
- */
2008
- allowInputRequired?: boolean;
2009
- } & TransportSendOptions;
2010
- /**
2011
- * Flow context handed to {@linkcode Protocol._resolveNonCompleteResult}: the
2012
- * originating request, its options, the wire codec that decoded the response,
2013
- * the timestamp the originating leg was issued at (for whole-flow timeout
2014
- * accounting), and a `retry` closure that re-enters the request funnel with
2015
- * fresh params on a fresh request id.
2016
- */
2017
- interface NonCompleteResultFlow<T$1 extends StandardSchemaV1 = StandardSchemaV1> {
2018
- codec: WireCodec;
2019
- request: Request$1;
2020
- resultSchema: T$1;
2021
- options: RequestOptions | undefined;
2022
- flowStartedAt: number;
2023
- /** Re-issue the originating request with the given params and per-leg options. */
2024
- retry(params: Record<string, unknown> | undefined, legOptions: RequestOptions): Promise<unknown>;
2025
- }
2026
- /**
2027
- * Options that can be given per notification.
2028
- */
2029
- type NotificationOptions = {
2030
- /**
2031
- * May be used to indicate to the transport which incoming request to associate this outgoing notification with.
2032
- */
2033
- relatedRequestId?: RequestId;
2034
- };
2035
- /**
2036
- * The type of `ctx.mcpReq.requestState`. The type parameter is
2037
- * caller-asserted (no validation, like the two-argument `acceptedContent<T>`)
2038
- * — pair with `createRequestStateCodec<T>` so the claim is backed by the
2039
- * codec's verification.
2040
- */
2041
- type RequestStateAccessor = <T$1 = unknown>() => T$1 | undefined;
2042
- /**
2043
- * Base context provided to all request handlers.
2044
- */
2045
- type BaseContext = {
2046
- /**
2047
- * The session ID from the transport, if available.
2048
- */
2049
- sessionId?: string;
2050
- /**
2051
- * Information about the MCP request being handled.
2052
- */
2053
- mcpReq: {
2054
- /**
2055
- * The JSON-RPC ID of the request being handled.
2056
- */
2057
- id: RequestId;
2058
- /**
2059
- * The method name of the request (e.g., 'tools/call', 'ping').
2060
- */
2061
- method: string;
2062
- /**
2063
- * Metadata from the original request, with the reserved
2064
- * `io.modelcontextprotocol/*` envelope keys already lifted out
2065
- * (readable via `ctx.mcpReq.envelope`).
2066
- */
2067
- _meta?: RequestMeta;
2068
- /**
2069
- * The per-request `_meta` envelope (protocol revision 2026-07-28):
2070
- * the reserved `io.modelcontextprotocol/*` keys carried by the
2071
- * request, lifted out of the `_meta` the handler sees. Surfaced as
2072
- * received — `Partial` because only the keys the request actually
2073
- * carried are present (envelope requiredness is enforced per request
2074
- * at dispatch time, not by the lift); only present at all when the
2075
- * request carried envelope keys.
2076
- */
2077
- envelope?: Partial<RequestMetaEnvelope>;
2078
- /**
2079
- * Multi-round-trip input responses carried by a retried request
2080
- * (protocol revision 2026-07-28), lifted out of the params the
2081
- * handler sees. Entries are the BARE response objects keyed by the
2082
- * identifiers the server assigned in `inputRequests`; entries that do
2083
- * not look like bare responses (e.g. a `{method, result}` wrapper)
2084
- * are dropped and their keys recorded in `droppedInputResponseKeys`.
2085
- *
2086
- * The values arrive from the client and are NOT validated by the SDK
2087
- * — treat them as untrusted input.
2088
- */
2089
- inputResponses?: Record<string, unknown>;
2090
- /**
2091
- * Keys of `inputResponses` entries the SDK dropped because they were
2092
- * not bare response objects (for example the wrapped `{method,
2093
- * result}` shape some peers emit). Surfaced so a handler can re-issue
2094
- * the corresponding input request rather than hard-fail.
2095
- */
2096
- droppedInputResponseKeys?: string[];
2097
- /**
2098
- * Reads the multi-round-trip request state for the current round:
2099
- * the value the configured `ServerOptions.requestState.verify` hook
2100
- * resolved with (e.g. `createRequestStateCodec.verify`'s decoded
2101
- * payload — `mint<T>`/`requestState<T>()` are the typed pair), the
2102
- * raw wire string when no hook is configured, or `undefined` when
2103
- * the round carried no state. The type parameter is a compile-time
2104
- * cast only.
2105
- *
2106
- * SECURITY: `requestState` round-trips through the client and MUST
2107
- * be treated as attacker-controlled input. The SDK applies no
2108
- * integrity protection by default — servers whose state influences
2109
- * authorization or business logic MUST integrity-protect it and
2110
- * verify via the `requestState.verify` hook (spec:
2111
- * basic/patterns/mrtr, server requirements 4–5).
2112
- */
2113
- requestState: RequestStateAccessor;
2114
- /**
2115
- * An abort signal used to communicate if the request was cancelled from the sender's side.
2116
- */
2117
- signal: AbortSignal;
2118
- /**
2119
- * Sends a request that relates to the current request being handled.
2120
- *
2121
- * This is used by certain transports to correctly associate related messages.
2122
- *
2123
- * For spec methods the result type is inferred from the method name.
2124
- * For custom (non-spec) methods, pass a result schema as the second argument.
2125
- */
2126
- send: {
2127
- <M$1 extends RequestMethod>(request: {
2128
- method: M$1;
2129
- params?: Record<string, unknown>;
2130
- }, options?: RequestOptions): Promise<ResultTypeMap[M$1]>;
2131
- <T$1 extends StandardSchemaV1>(request: Request$1, resultSchema: T$1, options?: RequestOptions): Promise<StandardSchemaV1.InferOutput<T$1>>;
2132
- };
2133
- /**
2134
- * Sends a notification that relates to the current request being handled.
2135
- *
2136
- * This is used by certain transports to correctly associate related messages.
2137
- */
2138
- notify: (notification: Notification) => Promise<void>;
2139
- };
2140
- /**
2141
- * HTTP transport information, only available when using an HTTP-based transport.
2142
- */
2143
- http?: {
2144
- /**
2145
- * Information about a validated access token, provided to request handlers.
2146
- */
2147
- authInfo?: AuthInfo;
2148
- };
2149
- };
2150
- /**
2151
- * Context provided to server-side request handlers, extending {@linkcode BaseContext} with server-specific fields.
2152
- */
2153
- type ServerContext = BaseContext & {
2154
- mcpReq: {
2155
- /**
2156
- * Send a log message notification to the client.
2157
- * Respects the client's log level filter set via logging/setLevel.
2158
- *
2159
- * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
2160
- * Remains functional during the deprecation window (at least twelve months).
2161
- * Migrate to stderr logging (STDIO servers) or OpenTelemetry.
2162
- */
2163
- log: (level: LoggingLevel, data: unknown, logger?: string) => Promise<void>;
2164
- /**
2165
- * Send an elicitation request to the client, requesting user input.
2166
- *
2167
- * @deprecated Throws on a 2026-07-28-era request — return `inputRequired(...)`
2168
- * (multi-round-trip) from the handler instead. The 2025 push-style server-to-client request model is
2169
- * replaced by input_required results in the 2026-07-28 protocol. If your factory serves
2170
- * both eras, this only works on the legacy path.
2171
- */
2172
- elicitInput: (params: ElicitRequestFormParams | ElicitRequestURLParams, options?: RequestOptions) => Promise<ElicitResult>;
2173
- /**
2174
- * Request LLM sampling from the client.
2175
- *
2176
- * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
2177
- * Throws on a 2026-07-28-era request — return `inputRequired(...)` (multi-round-trip)
2178
- * from the handler instead, or migrate to calling LLM provider APIs directly. The 2025 push-style
2179
- * server-to-client request model is replaced by input_required results in the 2026-07-28
2180
- * protocol. If your factory serves both eras, this only works on the legacy path.
2181
- */
2182
- requestSampling: (params: CreateMessageRequest['params'], options?: RequestOptions) => Promise<CreateMessageResult | CreateMessageResultWithTools>;
2183
- };
2184
- http?: {
2185
- /**
2186
- * The original HTTP request.
2187
- */
2188
- req?: globalThis.Request;
2189
- /**
2190
- * Closes the SSE stream for this request, triggering client reconnection.
2191
- * Only available when using a StreamableHTTPServerTransport with eventStore configured.
2192
- */
2193
- closeSSE?: () => void;
2194
- /**
2195
- * Closes the standalone GET SSE stream, triggering client reconnection.
2196
- * Only available when using a StreamableHTTPServerTransport with eventStore configured.
2197
- */
2198
- closeStandaloneSSE?: () => void;
2199
- };
2200
- };
2201
- /**
2202
- * Context provided to client-side request handlers.
2203
- */
2204
- type ClientContext = BaseContext;
2205
- /**
2206
- * Implements MCP protocol framing on top of a pluggable transport, including
2207
- * features like request/response linking, notifications, and progress.
2208
- *
2209
- * `Protocol` is abstract; `Client` and `Server` are the concrete role-specific
2210
- * implementations most code should use.
2211
- */
2212
- declare abstract class Protocol<ContextT extends BaseContext> {
2213
- private _options?;
2214
- private _transport?;
2215
- private _requestMessageId;
2216
- private _requestHandlers;
2217
- private _requestHandlerAbortControllers;
2218
- private _notificationHandlers;
2219
- private _responseHandlers;
2220
- private _progressHandlers;
2221
- private _timeoutInfo;
2222
- private _pendingDebouncedNotifications;
2223
- /**
2224
- * The protocol version negotiated for the current connection (`undefined`
2225
- * before negotiation completes), which determines the wire era this
2226
- * instance speaks. Set by the SDK's negotiation and initialize paths
2227
- * (`Client.connect`, `Server._oninitialize`).
2228
- */
2229
- protected _negotiatedProtocolVersion?: string;
2230
- protected _supportedProtocolVersions: string[];
2231
- /**
2232
- * Callback for when the connection is closed for any reason.
2233
- *
2234
- * This is invoked when {@linkcode Protocol.close | close()} is called as well.
2235
- */
2236
- onclose?: () => void;
2237
- /**
2238
- * Callback for when an error occurs.
2239
- *
2240
- * Note that errors are not necessarily fatal; they are used for reporting any kind of exceptional condition out of band.
2241
- */
2242
- onerror?: (error: Error) => void;
2243
- /**
2244
- * A handler to invoke for any request types that do not have their own handler installed.
2245
- */
2246
- fallbackRequestHandler?: (request: JSONRPCRequest, ctx: ContextT) => Promise<Result$1>;
2247
- /**
2248
- * A handler to invoke for any notification types that do not have their own handler installed.
2249
- */
2250
- fallbackNotificationHandler?: (notification: Notification) => Promise<void>;
2251
- constructor(_options?: ProtocolOptions | undefined);
2252
- /**
2253
- * Builds the context object for request handlers. Subclasses must override
2254
- * to return the appropriate context type (e.g., ServerContext adds HTTP request info).
2255
- */
2256
- protected abstract buildContext(ctx: BaseContext, transportInfo?: MessageExtraInfo): ContextT;
2257
- /**
2258
- * Drop consult for inbound messages whose transport did not classify them
2259
- * at the edge — long-lived channels such as stdio, where a role class may
2260
- * need to decline traffic the negotiated era has no answer for (the
2261
- * client-side inbound-request drop on modern-era connections: the
2262
- * 2026-07-28 era has no server→client request channel, and on stdio the
2263
- * client must never write JSON-RPC responses).
2264
- *
2265
- * Consulted ONLY when the transport supplied no
2266
- * {@linkcode MessageExtraInfo.classification}: edge-classified traffic
2267
- * never reaches the hook. Returning `'drop'` discards the message without
2268
- * writing any response (requests are surfaced via `onerror`). The base
2269
- * implementation returns `undefined`: unclassified traffic keeps today's
2270
- * dispatch path unchanged. Era selection never happens here — era is
2271
- * instance state, owned by the serving entry that constructed and
2272
- * connected the instance.
2273
- */
2274
- protected _shouldDropInbound(_message: JSONRPCRequest | JSONRPCNotification): 'drop' | undefined;
2275
- /**
2276
- * The per-request `_meta` envelope this instance attaches to every outgoing
2277
- * request and notification, when one applies. The base implementation
2278
- * returns `undefined` (no envelope — the 2025-era posture, so legacy-era
2279
- * outbound traffic is byte-identical to a build without this seam).
2280
- * `Client` overrides it on a connection that negotiated a modern (2026-07-28+)
2281
- * era to return the reserved protocol-version / client-info /
2282
- * client-capabilities keys. User-supplied `_meta` keys take precedence over
2283
- * the auto-attached ones.
2284
- */
2285
- protected _outboundMetaEnvelope(): Readonly<Record<string, unknown>> | undefined;
2286
- /**
2287
- * Attach this instance's outbound `_meta` envelope (when one is configured)
2288
- * to a request or notification. A no-op when the seam returns `undefined`
2289
- * — the message returns by reference, so the legacy-era wire stays
2290
- * byte-identical. User-supplied `_meta` keys are spread last so they win
2291
- * over the auto-attached envelope keys.
2292
- */
2293
- private _envelopeOutbound;
2294
- /**
2295
- * Extension point for non-`complete` decoded results in the response
2296
- * funnel: a result the wire codec discriminated into a kind other than
2297
- * `'complete'` or `'invalid'` is handed here for the role class to
2298
- * resolve. The base default surfaces it as a typed
2299
- * {@linkcode SdkErrorCode.UnsupportedResultType} error (no retry).
2300
- *
2301
- * Intended consumers (named so the seam stays accountable):
2302
- * - the `Client`'s multi-round-trip auto-fulfilment engine, which fulfils
2303
- * `'input_required'` results through the registered
2304
- * elicitation/sampling/roots handlers and retries via `flow.retry`;
2305
- * - a future client-side terminal-result handler for
2306
- * `subscriptions/listen`, when the spec defines one.
2307
- *
2308
- * `Server` instances never receive `input_required` responses on their
2309
- * outbound legs and leave the base behavior in place.
2310
- */
2311
- protected _resolveNonCompleteResult<T$1 extends StandardSchemaV1>(decoded: ReturnType<WireCodec['decodeResult']> & {
2312
- kind: 'input_required';
2313
- }, flow: NonCompleteResultFlow<T$1>): Promise<unknown>;
2314
- /**
2315
- * Protected accessor for a registered request handler. Used by role
2316
- * classes that dispatch synthesized requests through the same stored
2317
- * handler chain (e.g. the `Client` fulfilling an embedded multi-round-trip
2318
- * input request).
2319
- */
2320
- protected _getRequestHandler(method: string): ((request: JSONRPCRequest, ctx: ContextT) => Promise<Result$1>) | undefined;
2321
- private _oncancel;
2322
- private _setupTimeout;
2323
- private _resetTimeout;
2324
- private _cleanupTimeout;
2325
- /**
2326
- * Attaches to the given transport, starts it, and starts listening for messages.
2327
- *
2328
- * The caller assumes ownership of the {@linkcode Transport}, replacing any callbacks that have already been set, and expects that it is the only user of the {@linkcode Transport} instance going forward.
2329
- */
2330
- connect(transport: Transport): Promise<void>;
2331
- /**
2332
- * Transport-close hook. Subclass overrides MUST call `super._onclose()`
2333
- * after their own cleanup — base teardown (response-handler settlement,
2334
- * timeout clearing, in-flight request abort) does not run otherwise.
2335
- */
2336
- protected _onclose(): void;
2337
- private _onerror;
2338
- /**
2339
- * Inbound-notification dispatch. Subclass overrides MUST delegate
2340
- * unmatched traffic to `super._onnotification(rawNotification, extra)` —
2341
- * an override that consumes only what it owns and falls through to base
2342
- * dispatch for everything else.
2343
- */
2344
- protected _onnotification(rawNotification: JSONRPCNotification, extra?: MessageExtraInfo): void;
2345
- private _onrequest;
2346
- private _onprogress;
2347
- /**
2348
- * Inbound-response dispatch. Subclass overrides MUST delegate unmatched
2349
- * traffic to `super._onresponse(response)` — an override that consumes
2350
- * only what it owns and falls through to base dispatch for everything
2351
- * else.
2352
- */
2353
- protected _onresponse(response: JSONRPCResponse | JSONRPCErrorResponse): void;
2354
- get transport(): Transport | undefined;
2355
- /**
2356
- * Closes the connection.
2357
- */
2358
- close(): Promise<void>;
2359
- /**
2360
- * A method to check if a capability is supported by the remote side, for the given method to be called.
2361
- *
2362
- * This should be implemented by subclasses.
2363
- */
2364
- protected abstract assertCapabilityForMethod(method: RequestMethod | string): void;
2365
- /**
2366
- * A method to check if a notification is supported by the local side, for the given method to be sent.
2367
- *
2368
- * This should be implemented by subclasses.
2369
- */
2370
- protected abstract assertNotificationCapability(method: NotificationMethod | string): void;
2371
- /**
2372
- * A method to check if a request handler is supported by the local side, for the given method to be handled.
2373
- *
2374
- * This should be implemented by subclasses.
2375
- */
2376
- protected abstract assertRequestHandlerCapability(method: string): void;
2377
- /**
2378
- * Sends a request and waits for a response.
2379
- *
2380
- * For spec methods the result schema is resolved automatically from the method name
2381
- * and the return type is method-keyed. For custom (non-spec) methods, pass a
2382
- * `resultSchema` as the second argument; the response is validated against it and
2383
- * the return type is inferred from the schema.
2384
- *
2385
- * Do not use this method to emit notifications! Use {@linkcode Protocol.notification | notification()} instead.
2386
- */
2387
- request<M$1 extends RequestMethod>(request: {
2388
- method: M$1;
2389
- params?: Record<string, unknown>;
2390
- }, options?: RequestOptions): Promise<ResultTypeMap[M$1]>;
2391
- request<T$1 extends StandardSchemaV1>(request: Request$1, resultSchema: T$1, options?: RequestOptions): Promise<StandardSchemaV1.InferOutput<T$1>>;
2392
- /**
2393
- * The wire codec for this instance's negotiated era — the phase-2 truth:
2394
- * everything an established connection sends and receives resolves
2395
- * through it. Legacy until a version has been negotiated.
2396
- */
2397
- private _negotiatedWireCodec;
2398
- /**
2399
- * Protected accessor for the instance's negotiated wire codec, for role
2400
- * classes (Client/Server/McpServer) routing era-dependent behavior
2401
- * through the codec's function-only surface — `samplingResultVariant`,
2402
- * `outboundEnvelope`, `projectCallToolResult` — instead of branching on
2403
- * the protocol version themselves.
2404
- */
2405
- protected _wireCodec(): WireCodec;
2406
- /**
2407
- * Outbound codec resolution: while the negotiated version is still unset
2408
- * (the negotiation window), lifecycle messages are bootstrap-pinned BY
2409
- * METHOD — they self-identify their era (`initialize` IS the legacy
2410
- * handshake, `server/discover` IS the modern probe). Once a version has
2411
- * been negotiated, the instance era is authoritative for everything — a
2412
- * negotiated session never re-routes a method onto the other era.
2413
- */
2414
- private _resolveOutboundCodec;
2415
- /**
2416
- * Era gate for outbound requests — deletions are physical in BOTH
2417
- * directions: sending a spec method that the resolved era does not define
2418
- * dies locally with a typed error before anything reaches the transport.
2419
- * Methods outside the spec universe are consumer-owned extension methods
2420
- * and stay era-blind.
2421
- */
2422
- private _assertOutboundRequestInEra;
2423
- /**
2424
- * Sends a request and waits for a response, using the provided schema for
2425
- * validation instead of the era registry's method-keyed entry.
2426
- *
2427
- * This is the internal implementation used by SDK methods whose result
2428
- * schema cannot be expressed as a method-keyed registry entry — the one
2429
- * surviving case is `server.createMessage`, whose result schema depends
2430
- * on the REQUEST params (tools vs no tools) — and by callers passing
2431
- * explicit compatibility schemas. Spec methods are still era-gated here:
2432
- * an explicit schema never smuggles a deleted method onto the wire.
2433
- */
2434
- protected _requestWithSchema<T$1 extends StandardSchemaV1>(request: Request$1, resultSchema: T$1, options?: RequestOptions): Promise<StandardSchemaV1.InferOutput<T$1>>;
2435
- /**
2436
- * The request funnel proper, keyed by the resolved era codec: the codec
2437
- * owns result decoding (raw-first `resultType` discrimination — V-1 —
2438
- * and the era's lift posture) before the schema validation step.
2439
- */
2440
- private _requestWithSchemaViaCodec;
2441
- /**
2442
- * Emits a notification, which is a one-way message that does not expect a response.
2443
- */
2444
- notification(notification: Notification, options?: NotificationOptions): Promise<void>;
2445
- /**
2446
- * The notification funnel proper, keyed by the resolved era codec —
2447
- * direct sends and related notifications (`ctx.mcpReq.notify`) alike
2448
- * resolve through the instance's negotiated era at send time.
2449
- */
2450
- private _notificationViaCodec;
2451
- /**
2452
- * Registers a handler to invoke when this protocol object receives a request with the given method.
2453
- *
2454
- * Note that this will replace any previous request handler for the same method.
2455
- *
2456
- * For spec methods, pass `(method, handler)`; the request is parsed with the spec
2457
- * schema and the handler receives the typed `Request`. For custom (non-spec)
2458
- * methods, pass `(method, schemas, handler)`; `params` are validated against
2459
- * `schemas.params` and the handler receives the parsed params object directly.
2460
- * Supplying `schemas.result` types the handler's return value.
2461
- *
2462
- * @example Custom request method
2463
- * ```ts source="./protocol.examples.ts#Protocol_setRequestHandler_customMethod"
2464
- * const SearchParams = z.object({ query: z.string(), limit: z.number().optional() });
2465
- * const SearchResult = z.object({ hits: z.array(z.string()) });
2466
- *
2467
- * protocol.setRequestHandler('acme/search', { params: SearchParams, result: SearchResult }, async (params, _ctx) => {
2468
- * return { hits: [`result for ${params.query}`] };
2469
- * });
2470
- * ```
2471
- */
2472
- setRequestHandler<M$1 extends RequestMethod>(method: M$1, handler: (request: RequestTypeMap[M$1], ctx: ContextT) => HandlerResultTypeMap[M$1] | Promise<HandlerResultTypeMap[M$1]>): void;
2473
- setRequestHandler<P extends StandardSchemaV1, R extends StandardSchemaV1 | undefined = undefined>(method: string, schemas: {
2474
- params: P;
2475
- result?: R;
2476
- }, handler: (params: StandardSchemaV1.InferOutput<P>, ctx: ContextT) => InferHandlerResult<R> | Promise<InferHandlerResult<R>>): void;
2477
- /**
2478
- * Hook for subclasses to wrap a registered request handler with role-specific
2479
- * validation or behavior (e.g. `Server` validates `tools/call` results, `Client`
2480
- * validates `elicitation/create` mode and result). Runs for both the 2-arg and
2481
- * 3-arg registration paths. The default implementation is identity.
2482
- *
2483
- * Subclasses overriding this hook avoid redeclaring `setRequestHandler`'s overload set.
2484
- */
2485
- protected _wrapHandler(_method: string, handler: (request: JSONRPCRequest, ctx: ContextT) => Promise<Result$1>): (request: JSONRPCRequest, ctx: ContextT) => Promise<Result$1>;
2486
- /**
2487
- * Removes the request handler for the given method.
2488
- */
2489
- removeRequestHandler(method: RequestMethod | string): void;
2490
- /**
2491
- * Asserts that a request handler has not already been set for the given method, in preparation for a new one being automatically installed.
2492
- */
2493
- assertCanSetRequestHandler(method: RequestMethod | string): void;
2494
- /**
2495
- * Registers a handler to invoke when this protocol object receives a notification with the given method.
2496
- *
2497
- * Note that this will replace any previous notification handler for the same method.
2498
- *
2499
- * For spec methods, pass `(method, handler)`; the notification is parsed with the
2500
- * spec schema. For custom (non-spec) methods, pass `(method, schemas, handler)`;
2501
- * `params` are validated against `schemas.params` and the handler receives the
2502
- * parsed params object directly. The raw notification is passed as the second
2503
- * argument; `_meta` is recoverable via `notification.params?._meta` (minus the
2504
- * reserved `io.modelcontextprotocol/*` envelope keys, which the protocol layer
2505
- * lifts out before dispatch).
2506
- */
2507
- setNotificationHandler<M$1 extends NotificationMethod>(method: M$1, handler: (notification: NotificationTypeMap[M$1]) => void | Promise<void>): void;
2508
- setNotificationHandler<P extends StandardSchemaV1>(method: string, schemas: {
2509
- params: P;
2510
- }, handler: (params: StandardSchemaV1.InferOutput<P>, notification: Notification) => void | Promise<void>): void;
2511
- /**
2512
- * Removes the notification handler for the given method.
2513
- */
2514
- removeNotificationHandler(method: NotificationMethod | string): void;
2515
- }
2516
- /**
2517
- * Schema bundle accepted by {@linkcode Protocol.setRequestHandler | setRequestHandler}'s 3-arg form.
2518
- *
2519
- * `params` is required and validates the inbound `request.params`. `result` is optional;
2520
- * when supplied it types the handler's return value (no runtime validation is performed
2521
- * on the result).
2522
- */
2523
- interface RequestHandlerSchemas<P extends StandardSchemaV1 = StandardSchemaV1, R extends StandardSchemaV1 | undefined = StandardSchemaV1 | undefined> {
2524
- params: P;
2525
- result?: R;
2526
- }
2527
- type InferHandlerResult<R extends StandardSchemaV1 | undefined> = R extends StandardSchemaV1 ? StandardSchemaV1.InferOutput<R> : Result$1;
2528
- //#endregion
2529
- //#region ../core-internal/src/shared/mediaType.d.ts
2530
- /**
2531
- * Whether a raw `Content-Type` header value denotes `application/json`.
2532
- * Parameters (for example `charset=utf-8`) are allowed and ignored; malformed
2533
- * parameter sections do not reject a header whose media type is unambiguously
2534
- * `application/json` (see `mediaTypeEssence` for the exact grammar).
2535
- */
2536
- declare function isJsonContentType(header: string | null | undefined): boolean;
2537
- //#endregion
2538
- //#region ../core-internal/src/shared/metadataUtils.d.ts
2539
- /**
2540
- * Utilities for working with {@linkcode BaseMetadata} objects.
2541
- */
2542
- /**
2543
- * Gets the display name for an object with {@linkcode BaseMetadata}.
2544
- * For tools, the precedence is: `title` → {@linkcode index.ToolAnnotations | annotations}.`title` → `name`
2545
- * For other objects: `title` → `name`
2546
- * This implements the spec requirement: "if no title is provided, name should be used for display purposes"
2547
- */
2548
- declare function getDisplayName(metadata: BaseMetadata | (BaseMetadata & {
2549
- annotations?: {
2550
- title?: string;
2551
- };
2552
- })): string;
2553
- //#endregion
2554
- //#region ../core-internal/src/shared/protocolEras.d.ts
2555
- /**
2556
- * Protocol-era helpers (pure module). The MCP wire protocol splits into two eras:
2557
- * legacy (the 2025-11-25 family and earlier; the version is negotiated via the
2558
- * `initialize` handshake) and modern (2026-07-28 and later; no `initialize` —
2559
- * servers advertise versions via `server/discover` and every request carries a
2560
- * `_meta` envelope).
2561
- *
2562
- * An operation that belongs to one era must only ever consult that era's subset
2563
- * of a supported-versions list: `initialize` never accepts or counter-offers a
2564
- * modern revision, and the `server/discover` advertisement only ever contains
2565
- * modern revisions.
2566
- */
2567
- /**
2568
- * The protocol era of a connection: `'legacy'` for the 2025-11-25 family and
2569
- * earlier (negotiated via `initialize`), `'modern'` for 2026-07-28 and later
2570
- * (negotiated via `server/discover`; every request carries a `_meta` envelope).
2571
- */
2572
- type ProtocolEra = 'legacy' | 'modern';
2573
- //#endregion
2574
- //#region ../core-internal/src/shared/resultCacheHints.d.ts
2575
- /**
2576
- * Cache-hint plumbing for cacheable results (protocol revision 2026-07-28).
2577
- *
2578
- * The 2026-07-28 revision requires `ttlMs`/`cacheScope` on the cacheable
2579
- * result types (SEP-2549 `CacheableResult`). The values are resolved at the
2580
- * era-aware encode seam (the 2026 wire codec's `encodeResult`), most specific
2581
- * author first:
2582
- *
2583
- * 1. fields the handler returned on the result itself (when valid),
2584
- * 2. a configured cache hint attached by the server layer
2585
- * (per-registration hint, then the server-level per-operation hint,
2586
- * combined per field — see {@linkcode attachCacheHintFallback}),
2587
- * 3. the conservative defaults `{ ttlMs: 0, cacheScope: 'private' }`.
2588
- *
2589
- * The configured hint travels from the (era-blind) server configuration to the
2590
- * (era-aware) encode seam on a symbol-keyed property of the result object —
2591
- * {@linkcode RESULT_CACHE_HINT_FALLBACK}. Symbol-keyed properties are never
2592
- * serialized to JSON, so attaching a hint can never change what a 2025-era
2593
- * response looks like on the wire: only the 2026-era codec reads (and removes)
2594
- * it while filling the required fields. The 2025-era codec has no cache code
2595
- * path at all.
2596
- */
2597
- /** The cache scopes defined for cacheable results (SEP-2549). */
2598
- type CacheScope = 'public' | 'private';
2599
- /**
2600
- * A cache hint for a cacheable result (protocol revision 2026-07-28): the
2601
- * values to emit for `ttlMs` / `cacheScope` when the handler does not provide
2602
- * them itself. Absent fields fall back to the conservative defaults
2603
- * (`ttlMs: 0`, `cacheScope: 'private'`).
2604
- */
2605
- interface CacheHint {
2606
- /** Cache lifetime in milliseconds. Must be a non-negative safe integer. */
2607
- ttlMs?: number;
2608
- /** Whether the result may be cached by shared caches (`public`) or only by the requesting client (`private`). */
2609
- cacheScope?: CacheScope;
2610
- }
2611
- /**
2612
- * The operations whose results are cacheable on the 2026-07-28 revision (the
2613
- * `CacheableResult` extenders). This list is closed: no other operation's
2614
- * result ever receives cache fields from the SDK.
2615
- */
2616
- declare const CACHEABLE_RESULT_METHODS: readonly ["tools/list", "prompts/list", "resources/list", "resources/templates/list", "resources/read", "server/discover"];
2617
- /** A method whose result is cacheable on the 2026-07-28 revision. */
2618
- type CacheableResultMethod = (typeof CACHEABLE_RESULT_METHODS)[number];
2619
- //#endregion
2620
- //#region ../core-internal/src/shared/stdio.d.ts
2621
- declare const STDIO_DEFAULT_MAX_BUFFER_SIZE: number;
2622
- /**
2623
- * Buffers a continuous stdio stream into discrete JSON-RPC messages.
2624
- */
2625
- declare class ReadBuffer {
2626
- private _buffer?;
2627
- private _maxBufferSize;
2628
- constructor(options?: {
2629
- maxBufferSize?: number;
2630
- });
2631
- append(chunk: Buffer): void;
2632
- readMessage(): JSONRPCMessage | null;
2633
- clear(): void;
2634
- }
2635
- declare function deserializeMessage(line: string): JSONRPCMessage;
2636
- declare function serializeMessage(message: JSONRPCMessage): string;
2637
- //#endregion
2638
- //#region ../core-internal/src/shared/uriTemplate.d.ts
2639
- type Variables = Record<string, string | string[]>;
2640
- declare class UriTemplate {
2641
- /**
2642
- * Returns true if the given string contains any URI template expressions.
2643
- * A template expression is a sequence of characters enclosed in curly braces,
2644
- * like `{foo}` or `{?bar}`.
2645
- */
2646
- static isTemplate(str: string): boolean;
2647
- private static validateLength;
2648
- private readonly template;
2649
- private readonly parts;
2650
- get variableNames(): string[];
2651
- constructor(template: string);
2652
- toString(): string;
2653
- private parse;
2654
- private getOperator;
2655
- private getNames;
2656
- private encodeValue;
2657
- private expandPart;
2658
- expand(variables: Variables): string;
2659
- private escapeRegExp;
2660
- private partToRegExp;
2661
- match(uri: string): Variables | null;
2662
- }
2663
- //#endregion
2664
- //#region ../core-internal/src/util/inMemory.d.ts
2665
- /**
2666
- * In-memory transport for creating clients and servers that talk to each other within the same process.
2667
- *
2668
- * Intended for testing and development. For production in-process connections, use
2669
- * `StreamableHTTPClientTransport` against a local server URL.
2670
- */
2671
- declare class InMemoryTransport implements Transport {
2672
- private _otherTransport?;
2673
- private _messageQueue;
2674
- private _closed;
2675
- onclose?: () => void;
2676
- onerror?: (error: Error) => void;
2677
- onmessage?: (message: JSONRPCMessage, extra?: {
2678
- authInfo?: AuthInfo;
2679
- }) => void;
2680
- sessionId?: string;
2681
- /**
2682
- * Creates a pair of linked in-memory transports that can communicate with each other. One should be passed to a {@linkcode @modelcontextprotocol/client!client/client.Client | Client} and one to a {@linkcode @modelcontextprotocol/server!server/server.Server | Server}.
2683
- */
2684
- static createLinkedPair(): [InMemoryTransport, InMemoryTransport];
2685
- start(): Promise<void>;
2686
- close(): Promise<void>;
2687
- /**
2688
- * Sends a message with optional auth info.
2689
- * This is useful for testing authentication scenarios.
2690
- */
2691
- send(message: JSONRPCMessage, options?: {
2692
- relatedRequestId?: RequestId;
2693
- authInfo?: AuthInfo;
2694
- }): Promise<void>;
2695
- }
2696
- //#endregion
2697
- //#region ../core-internal/src/wire/preload.d.ts
2698
- /**
2699
- * Eagerly builds every lazily-constructed wire-schema layer, so that no later
2700
- * validation pays schema-construction cost.
2701
- *
2702
- * Synchronous and idempotent: every layer is a memo, so the first call does
2703
- * all the work and subsequent calls return immediately. Reference identity is
2704
- * unaffected — this forces the same memos every lazy consumer pulls through.
2705
- *
2706
- * Call it at module scope on platforms that bill per-request CPU but not
2707
- * module evaluation (isolate-based edge/serverless runtimes), where deferring
2708
- * construction would move it into the first request of every fresh isolate:
2709
- *
2710
- * ```ts
2711
- * // from '@modelcontextprotocol/server' or '@modelcontextprotocol/client' —
2712
- * // each package bundles its own schema copy, so warm the one(s) you import.
2713
- * preloadSchemas(); // module scope — runs during isolate warm-up
2714
- * ```
2715
- *
2716
- * On Node CLIs and other process-per-invocation runtimes, prefer the lazy
2717
- * default — there, module-scope construction is pure added boot latency.
2718
- */
2719
- declare function preloadSchemas(): void;
2720
- //#endregion
2721
- //#region src/server/server.d.ts
2722
- type ServerOptions = ProtocolOptions & {
2723
- /**
2724
- * Capabilities to advertise as being supported by this server.
2725
- *
2726
- * Note: per the MCP spec, a server that declares a capability MUST respond to that
2727
- * capability's requests (e.g. `tools/list` for `tools`) — potentially with an empty
2728
- * result — rather than with a "Method not found" error. {@linkcode server/mcp.McpServer | McpServer}
2729
- * handles this automatically for capabilities declared here; when using the low-level
2730
- * {@linkcode Server} directly, you are responsible for registering a request handler for
2731
- * every capability you declare.
2732
- */
2733
- capabilities?: ServerCapabilities;
2734
- /**
2735
- * Optional instructions describing how to use the server and its features.
2736
- */
2737
- instructions?: string;
2738
- /**
2739
- * JSON Schema validator for elicitation response validation.
2740
- *
2741
- * The validator is used to validate user input returned from elicitation
2742
- * requests against the requested schema.
2743
- *
2744
- * @default Runtime-selected validator (AJV-backed on Node.js, `@cfworker/json-schema`-backed on browser/workerd runtimes)
2745
- */
2746
- jsonSchemaValidator?: jsonSchemaValidator;
2747
- /**
2748
- * Cache hints for the cacheable results of the 2026-07-28 protocol
2749
- * revision (`ttlMs` / `cacheScope`), keyed by operation. The cacheable
2750
- * operations are `tools/list`, `prompts/list`, `resources/list`,
2751
- * `resources/templates/list`, `resources/read` and `server/discover`. The
2752
- * hint is used when the result for that operation does not provide its own
2753
- * cache fields — most useful for the list results and `server/discover`,
2754
- * which the SDK builds itself. A hint registered with an individual
2755
- * resource (`registerResource(..., { cacheHint })`) takes precedence for
2756
- * that resource's `resources/read` results, field by field: a field the
2757
- * per-resource hint leaves unset still falls back to the per-operation
2758
- * hint configured here.
2759
- *
2760
- * Absent hints (or omitting this option entirely) keep today's behavior:
2761
- * cacheable 2026-07-28 results are emitted with `ttlMs: 0` and
2762
- * `cacheScope: 'private'`. Responses to 2025-era requests are never
2763
- * affected. Invalid values throw a `RangeError` at construction time.
2764
- */
2765
- cacheHints?: Partial<Record<CacheableResultMethod, CacheHint>>;
2766
- /**
2767
- * Multi-round-trip serving knobs. On 2026-era requests the client
2768
- * fulfils `input_required` returns; on 2025-era connections the SDK's
2769
- * legacy shim fulfils them server-side (real server→client requests +
2770
- * handler re-entry), so handlers are written once and serve both eras.
2771
- */
2772
- inputRequired?: {
2773
- /**
2774
- * Handler re-entries per originating request before the shim fails
2775
- * (tools/call: `isError` result; prompts/resources: JSON-RPC error).
2776
- * @default 8
2777
- */
2778
- maxRounds?: number;
2779
- /**
2780
- * Per-leg timeout (ms) for the shim's embedded server→client
2781
- * requests, sent with `resetTimeoutOnProgress: true`. Human-paced —
2782
- * deliberately far above the 60s protocol default.
2783
- * @default 600_000
2784
- */
2785
- roundTimeoutMs?: number;
2786
- /**
2787
- * `false` disables the shim: an `input_required` return on a
2788
- * 2025-era request fails loudly (the pre-shim behavior).
2789
- * @default true
2790
- */
2791
- legacyShim?: boolean;
2792
- };
2793
- /**
2794
- * Multi-round-trip `requestState` integrity hook (protocol revision
2795
- * 2026-07-28).
2796
- */
2797
- requestState?: {
2798
- /**
2799
- * Called on every multi-round-trip request round whose echoed
2800
- * `requestState` is a string (i.e. whenever
2801
- * `ctx.mcpReq.requestState()` would return one), BEFORE the handler
2802
- * runs — including the legacy shim's in-process rounds. Throw or
2803
- * reject to refuse the request: the seam answers with a wire-level
2804
- * `-32602` Invalid Params error whose message is frozen to
2805
- * `"Invalid or expired requestState"` and whose `data.reason` is
2806
- * `'invalid_request_state'` — the thrown reason is surfaced via the
2807
- * server's `onerror` callback only and never reaches the wire.
2808
- *
2809
- * This is the place to put HMAC or AEAD verification of
2810
- * `requestState`. The spec MUST for integrity-protecting state that
2811
- * influences authorization, resource access, or business logic is on
2812
- * the server author (basic/patterns/mrtr, server requirements 4–5);
2813
- * the SDK provides NO default verification —
2814
- * {@linkcode server/requestStateCodec.createRequestStateCodec | createRequestStateCodec}
2815
- * is the SDK-provided HMAC helper whose `verify` drops in here
2816
- * directly. Leaving this option unconfigured keeps the passthrough
2817
- * behavior — `ctx.mcpReq.requestState()` returns the raw wire string,
2818
- * which MUST be treated as attacker-controlled input.
2819
- *
2820
- * The resolved value is LOAD-BEARING: when the hook resolves with a
2821
- * non-`undefined` value — as
2822
- * {@linkcode server/requestStateCodec.RequestStateCodec | RequestStateCodec}`.verify`
2823
- * does (the decoded payload) — the seam hands THAT value to the
2824
- * handler via the typed `ctx.mcpReq.requestState<T>()` accessor, so a
2825
- * codec-using handler reads its verified state with no second decode
2826
- * call. A verifier that is not also the decoder should resolve
2827
- * `undefined` (return nothing) to keep the accessor on the raw wire
2828
- * string — resolving an incidental value (e.g. a boolean
2829
- * verification flag) would replace what the handler reads.
2830
- */
2831
- verify?: (state: string, ctx: ServerContext) => unknown | Promise<unknown>;
2832
- };
2833
- };
2834
- /**
2835
- * An MCP server on top of a pluggable transport.
2836
- *
2837
- * This server will automatically respond to the initialization flow as initiated from the client.
2838
- *
2839
- * @deprecated Use {@linkcode server/mcp.McpServer | McpServer} instead for the high-level API. Only use `Server` for advanced use cases.
2840
- */
2841
- declare class Server extends Protocol<ServerContext> {
2842
- private _serverInfo;
2843
- private _clientCapabilities?;
2844
- private _clientVersion?;
2845
- private _capabilities;
2846
- private _instructions?;
2847
- private _jsonSchemaValidator;
2848
- private _cacheHints?;
2849
- private _requestStateVerify?;
2850
- private _inputRequiredServing;
2851
- private _legacyShim?;
2852
- /** Lazily-built legacy shim; the loop lives in legacyInputRequiredShim.ts behind a narrow host contract. */
2853
- private _legacyInputRequiredShim;
2854
- /**
2855
- * Callback for when initialization has fully completed (i.e., the client has sent an `notifications/initialized` notification).
2856
- */
2857
- oninitialized?: () => void;
2858
- /**
2859
- * Initializes this server with the given name and version information.
2860
- */
2861
- constructor(_serverInfo: Implementation, options?: ServerOptions);
2862
- /**
2863
- * Registers the built-in `logging/setLevel` request handler.
2864
- *
2865
- * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
2866
- * Remains functional during the deprecation window (at least twelve months).
2867
- * Migrate to stderr logging (STDIO servers) or OpenTelemetry.
2868
- */
2869
- private _registerLoggingHandler;
2870
- protected buildContext(ctx: BaseContext, transportInfo?: MessageExtraInfo): ServerContext;
2871
- private _loggingLevels;
2872
- private readonly LOG_LEVEL_SEVERITY;
2873
- private isMessageIgnored;
2874
- /**
2875
- * Registers new capabilities. This can only be called before connecting to a transport.
2876
- *
2877
- * The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization).
2878
- */
2879
- registerCapabilities(capabilities: ServerCapabilities): void;
2880
- /**
2881
- * Enforces server-side validation for `tools/call` results regardless of how the
2882
- * handler was registered, attaches the configured per-operation cache hint
2883
- * (when one exists) so the 2026-07-28 encode seam can fill `ttlMs`/`cacheScope`
2884
- * for results that do not provide their own, and owns the multi-round-trip
2885
- * seam: on the methods whose 2026-07-28 result vocabulary includes
2886
- * `input_required` (`tools/call`, `prompts/get`, `resources/read`) an
2887
- * input-required return skips result-schema validation and is checked
2888
- * against the served era, the at-least-one rule, and the request's own
2889
- * declared client capabilities; on every other method an input-required
2890
- * return is a server bug and fails loudly. The hint rides a symbol-keyed
2891
- * property that is never serialized, so 2025-era responses are unaffected.
2892
- */
2893
- protected _wrapHandler(method: string, handler: (request: JSONRPCRequest, ctx: ServerContext) => Promise<Result$1>): (request: JSONRPCRequest, ctx: ServerContext) => Promise<Result$1>;
2894
- /**
2895
- * Whether this instance is bound to a 2026-07-28-or-later protocol
2896
- * revision. Era is instance state — a serving entry (`createMcpHandler`,
2897
- * `serveStdio`) marks the instance modern at construction; a 2025-era
2898
- * `initialize` handshake binds it legacy. The multi-round-trip seam reads
2899
- * this directly: there is no per-request era consult.
2900
- */
2901
- private _servedModernEra;
2902
- /**
2903
- * Invokes a handler for one of the multi-round-trip methods and applies
2904
- * the input-required seam:
2905
- *
2906
- * - a `UrlElicitationRequiredError` (or any 2025-style server→client
2907
- * request idiom) escaping the handler on a request served on the
2908
- * 2026-07-28 era fails LOUDLY with a clear steer to
2909
- * `inputRequired.elicitUrl(...)` — the `-32042` error never reaches the
2910
- * 2026-07-28 wire and the throw is not silently converted. Requests
2911
- * served on the 2025 era keep today's `-32042` behavior byte-exact (the
2912
- * error is rethrown unchanged).
2913
- * - an input-required RETURN toward a 2026-07-28 request must satisfy
2914
- * the at-least-one rule, and every embedded request must be covered by
2915
- * the capabilities declared on the request's envelope (violations
2916
- * answer the typed `-32021` error). Toward a 2025-era request the
2917
- * return is fulfilled by the default-on legacy shim, whose own gate
2918
- * consults the initialize-declared capabilities and surfaces
2919
- * violations per family; `inputRequired.legacyShim: false` restores
2920
- * the pre-shim loud failure.
2921
- */
2922
- private _invokeInputRequiredCapableHandler;
2923
- /**
2924
- * Runs the configured `requestState.verify` hook and returns its
2925
- * resolved value (`undefined` when unconfigured or the hook returns
2926
- * nothing). Deny-on-error: any hook failure answers the frozen `-32602`;
2927
- * the reason goes to `onerror` only.
2928
- */
2929
- private _verifyRequestState;
2930
- /**
2931
- * The per-request resolved client-capabilities view: the request's own
2932
- * `_meta` envelope on the 2026 era; the `initialize`-declared state on a
2933
- * 2025-era connection. Per-request instances that never saw an
2934
- * initialize (stateless legacy) hold nothing, so gates refuse there.
2935
- */
2936
- private _inputRequestCapabilityView;
2937
- /**
2938
- * Guard for the push-style server→client request APIs ({@linkcode createMessage},
2939
- * {@linkcode elicitInput}, {@linkcode listRoots}, {@linkcode ping}) on a
2940
- * modern-era instance: the 2026-07-28 revision has no server→client request
2941
- * channel, so the call fails before any wire traffic with a typed error
2942
- * whose message steers to `inputRequired(...)`. The base era gate would
2943
- * also reject it; this guard runs first to carry the steer.
2944
- */
2945
- private _assertPushApiInServedEra;
2946
- protected assertCapabilityForMethod(method: RequestMethod | string): void;
2947
- protected assertNotificationCapability(method: NotificationMethod | string): void;
2948
- protected assertRequestHandlerCapability(method: string): void;
2949
- private _oninitialize;
2950
- /**
2951
- * Answers `server/discover` (protocol revision 2026-07-28). `supportedVersions`
2952
- * lists only modern revisions (2025-era versions are negotiated via `initialize`);
2953
- * the advertised capabilities exclude the listChanged/subscribe-class capabilities
2954
- * (see {@linkcode discoverAdvertisedCapabilities}).
2955
- */
2956
- private _ondiscover;
2957
- /**
2958
- * After initialization has completed, this will be populated with the client's reported capabilities.
2959
- *
2960
- * @deprecated Read client identity from the per-request handler context instead: on
2961
- * 2026-07-28 (per-request envelope) requests `ctx.mcpReq.envelope` carries the client's
2962
- * declared capabilities, while on 2025-era connections this accessor keeps returning the
2963
- * `initialize`-scoped value. The accessor remains functional — instances serving the
2964
- * 2026-07-28 era are backfilled per request from the validated envelope.
2965
- */
2966
- getClientCapabilities(): ClientCapabilities | undefined;
2967
- /**
2968
- * After initialization has completed, this will be populated with information about the client's name and version.
2969
- *
2970
- * @deprecated Read client identity from the per-request handler context instead: on
2971
- * 2026-07-28 (per-request envelope) requests `ctx.mcpReq.envelope` carries the client's
2972
- * name and version, while on 2025-era connections this accessor keeps returning the
2973
- * `initialize`-scoped value. The accessor remains functional — instances serving the
2974
- * 2026-07-28 era are backfilled per request from the validated envelope.
2975
- */
2976
- getClientVersion(): Implementation | undefined;
2977
- /**
2978
- * After initialization has completed, this will be populated with the protocol version negotiated
2979
- * with the client (the version the server responded with during the initialize handshake), or
2980
- * `undefined` before initialization.
2981
- *
2982
- * @deprecated Read the protocol revision from the per-request handler context instead: on
2983
- * 2026-07-28 (per-request envelope) requests `ctx.mcpReq.envelope` names the revision the
2984
- * request was sent for, while on 2025-era connections this accessor keeps returning the
2985
- * `initialize`-negotiated version. The accessor remains functional — instances serving the
2986
- * 2026-07-28 era report that revision.
2987
- */
2988
- getNegotiatedProtocolVersion(): string | undefined;
2989
- /**
2990
- * Project a `tools/call` result through this instance's negotiated wire
2991
- * codec — the era-agnostic SEP-2106 §4.3 TextContent auto-append, plus on
2992
- * the 2025 era the `{result:…}` wrap when `structuredContent` is a
2993
- * non-object value or the advertised `outputSchema` had a non-object root.
2994
- * Identity for object-shaped `structuredContent` on the 2026 era.
2995
- *
2996
- * `McpServer`'s built-in `tools/call` handler routes through this method.
2997
- * Low-level `setRequestHandler('tools/call', …)` authors call it
2998
- * themselves so the projection lives in one place (the codec) and the
2999
- * server-side handler stays era-blind.
3000
- *
3001
- * This is the only codec function exposed on `Server` — the full
3002
- * `WireCodec` is intentionally not part of the public surface.
3003
- */
3004
- projectCallToolResult(result: CallToolResult, advertisedOutputSchema: Readonly<Record<string, unknown>> | undefined): CallToolResult;
3005
- /**
3006
- * Returns the current server capabilities.
3007
- */
3008
- getCapabilities(): ServerCapabilities;
3009
- /**
3010
- * Sends a `ping` request to the connected client.
3011
- *
3012
- * @deprecated The 2026-07-28 protocol removed ping; it throws on a 2026-07-28-era instance.
3013
- * If your factory serves both eras, this only works on the legacy path.
3014
- */
3015
- ping(): Promise<EmptyResult>;
3016
- /**
3017
- * Request LLM sampling from the client (without tools).
3018
- * Returns single content block for backwards compatibility.
3019
- *
3020
- * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
3021
- * Throws on a 2026-07-28-era request — use {@link index.inputRequired | inputRequired} (multi-round-trip) instead,
3022
- * or migrate to calling LLM provider APIs directly. The 2025 push-style server-to-client
3023
- * request model is replaced by input_required results in the 2026-07-28 protocol. If your
3024
- * factory serves both eras, this only works on the legacy path.
3025
- */
3026
- createMessage(params: CreateMessageRequestParamsBase, options?: RequestOptions): Promise<CreateMessageResult>;
3027
- /**
3028
- * Request LLM sampling from the client with tool support.
3029
- * Returns content that may be a single block or array (for parallel tool calls).
3030
- *
3031
- * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
3032
- * Throws on a 2026-07-28-era request — use {@link index.inputRequired | inputRequired} (multi-round-trip) instead,
3033
- * or migrate to calling LLM provider APIs directly. The 2025 push-style server-to-client
3034
- * request model is replaced by input_required results in the 2026-07-28 protocol. If your
3035
- * factory serves both eras, this only works on the legacy path.
3036
- */
3037
- createMessage(params: CreateMessageRequestParamsWithTools, options?: RequestOptions): Promise<CreateMessageResultWithTools>;
3038
- /**
3039
- * Request LLM sampling from the client.
3040
- * When tools may or may not be present, returns the union type.
3041
- *
3042
- * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
3043
- * Throws on a 2026-07-28-era request — use {@link index.inputRequired | inputRequired} (multi-round-trip) instead,
3044
- * or migrate to calling LLM provider APIs directly. The 2025 push-style server-to-client
3045
- * request model is replaced by input_required results in the 2026-07-28 protocol. If your
3046
- * factory serves both eras, this only works on the legacy path.
3047
- */
3048
- createMessage(params: CreateMessageRequest['params'], options?: RequestOptions): Promise<CreateMessageResult | CreateMessageResultWithTools>;
3049
- /**
3050
- * Creates an elicitation request for the given parameters.
3051
- * For backwards compatibility, `mode` may be omitted for form requests and will default to `"form"`.
3052
- * @param params The parameters for the elicitation request.
3053
- * @param options Optional request options.
3054
- * @returns The result of the elicitation request.
3055
- *
3056
- * @deprecated Throws on a 2026-07-28-era request — use {@link index.inputRequired | inputRequired} (multi-round-trip)
3057
- * instead. The 2025 push-style server-to-client request model is replaced by input_required
3058
- * results in the 2026-07-28 protocol. If your factory serves both eras, this only works on the
3059
- * legacy path.
3060
- */
3061
- elicitInput(params: ElicitRequestFormParams | ElicitRequestURLParams, options?: RequestOptions): Promise<ElicitResult>;
3062
- /**
3063
- * The capability-check-free core of {@linkcode elicitInput}. The shim
3064
- * uses it because its gate differs from the public checks: a bare
3065
- * `elicitation: {}` counts as form support (the pre-mode rule), and
3066
- * accepted content passes through unvalidated for parity with the
3067
- * modern client driver (handlers validate via the schema-aware
3068
- * `acceptedContent` overload and can re-ask).
3069
- */
3070
- private _sendElicitationLeg;
3071
- /**
3072
- * Creates a reusable callback that, when invoked, will send a `notifications/elicitation/complete`
3073
- * notification for the specified elicitation ID.
3074
- *
3075
- * The notification (and the `elicitationId` it references) exists only on protocol revision
3076
- * 2025-11-25 — the 2026-07-28 draft removed both. On a connection negotiated at 2026-07-28 the
3077
- * returned callback rejects with a typed local error before anything reaches the transport
3078
- * (the method is not part of that revision's wire registry).
3079
- *
3080
- * @param elicitationId The ID of the elicitation to mark as complete.
3081
- * @param options Optional notification options. Useful when the completion notification should be related to a prior request.
3082
- * @returns A function that emits the completion notification when awaited.
3083
- */
3084
- createElicitationCompletionNotifier(elicitationId: string, options?: NotificationOptions): () => Promise<void>;
3085
- /**
3086
- * Requests the list of roots from the client.
3087
- *
3088
- * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
3089
- * Throws on a 2026-07-28-era request — use {@link index.inputRequired | inputRequired} (multi-round-trip) instead,
3090
- * or migrate to passing paths via tool parameters, resource URIs, or configuration. The 2025
3091
- * push-style server-to-client request model is replaced by input_required results in the
3092
- * 2026-07-28 protocol. If your factory serves both eras, this only works on the legacy path.
3093
- */
3094
- listRoots(params?: ListRootsRequest['params'], options?: RequestOptions): Promise<ListRootsResult>;
3095
- /**
3096
- * Sends a logging message to the client, if connected.
3097
- * Note: You only need to send the parameters object, not the entire JSON-RPC message.
3098
- * @see {@linkcode LoggingMessageNotification}
3099
- * @param params
3100
- * @param sessionId Optional for stateless transports and backward compatibility.
3101
- *
3102
- * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
3103
- * Remains functional during the deprecation window (at least twelve months).
3104
- * Migrate to stderr logging (STDIO servers) or OpenTelemetry.
3105
- */
3106
- sendLoggingMessage(params: LoggingMessageNotification['params'], sessionId?: string): Promise<void>;
3107
- sendResourceUpdated(params: ResourceUpdatedNotification['params']): Promise<void>;
3108
- sendResourceListChanged(): Promise<void>;
3109
- sendToolListChanged(): Promise<void>;
3110
- sendPromptListChanged(): Promise<void>;
3111
- }
3112
- //#endregion
3113
- //#region src/server/mcp.d.ts
3114
- /**
3115
- * High-level MCP server that provides a simpler API for working with resources, tools, and prompts.
3116
- * For advanced usage (like sending notifications or setting custom request handlers), use the underlying
3117
- * {@linkcode Server} instance available via the {@linkcode McpServer.server | server} property.
3118
- *
3119
- * @example
3120
- * ```ts source="./mcp.examples.ts#McpServer_basicUsage"
3121
- * const server = new McpServer({
3122
- * name: 'my-server',
3123
- * version: '1.0.0'
3124
- * });
3125
- * ```
3126
- */
3127
- declare class McpServer {
3128
- /**
3129
- * The underlying {@linkcode Server} instance, useful for advanced operations like sending notifications.
3130
- */
3131
- readonly server: Server;
3132
- private _registeredResources;
3133
- private _registeredResourceTemplates;
3134
- private _registeredTools;
3135
- private _registeredPrompts;
3136
- /**
3137
- * Per-tool JSON-converted `inputSchema`, memoized so the SEP-2243
3138
- * registration-time scan and the pre-dispatch validation step share one
3139
- * conversion instead of paying it twice per request under the
3140
- * per-request-factory `createMcpHandler` model.
3141
- */
3142
- private _toolInputSchemaJson;
3143
- /**
3144
- * The JSON-serialized `inputSchema` of a registered tool, or `undefined`
3145
- * when no such tool is registered. Used by the HTTP entry's pre-dispatch
3146
- * SEP-2243 `Mcp-Param-*` validation step (which needs the same JSON Schema
3147
- * `tools/list` would emit, before dispatch reaches the handler).
3148
- *
3149
- * @internal
3150
- */
3151
- toolInputSchemaJson(name: string): Record<string, unknown> | undefined;
3152
- constructor(serverInfo: Implementation, options?: ServerOptions);
3153
- /**
3154
- * Attaches to the given transport, starts it, and starts listening for messages.
3155
- *
3156
- * The `server` object assumes ownership of the {@linkcode Transport}, replacing any callbacks that have already been set, and expects that it is the only user of the {@linkcode Transport} instance going forward.
3157
- *
3158
- * @example
3159
- * ```ts source="./mcp.examples.ts#McpServer_connect_stdio"
3160
- * const server = new McpServer({ name: 'my-server', version: '1.0.0' });
3161
- * const transport = new StdioServerTransport();
3162
- * await server.connect(transport);
3163
- * ```
3164
- */
3165
- connect(transport: Transport): Promise<void>;
3166
- /**
3167
- * Closes the connection.
3168
- */
3169
- close(): Promise<void>;
3170
- private _toolHandlersInitialized;
3171
- private setToolRequestHandlers;
3172
- /**
3173
- * Creates a tool error result.
3174
- *
3175
- * @param errorMessage - The error message.
3176
- * @returns The tool error result.
3177
- */
3178
- private createToolError;
3179
- /**
3180
- * Validates tool input arguments against the tool's input schema.
3181
- */
3182
- private validateToolInput;
3183
- /**
3184
- * Validates tool output against the tool's output schema.
3185
- */
3186
- private validateToolOutput;
3187
- /**
3188
- * Executes a tool handler.
3189
- */
3190
- private executeToolHandler;
3191
- private _completionHandlerInitialized;
3192
- private setCompletionRequestHandler;
3193
- private handlePromptCompletion;
3194
- private handleResourceCompletion;
3195
- private _resourceHandlersInitialized;
3196
- private setResourceRequestHandlers;
3197
- private _promptHandlersInitialized;
3198
- private setPromptRequestHandlers;
3199
- /**
3200
- * Registers a resource with a config object and callback.
3201
- * For static resources, use a URI string. For dynamic resources, use a {@linkcode ResourceTemplate}.
3202
- *
3203
- * @example
3204
- * ```ts source="./mcp.examples.ts#McpServer_registerResource_static"
3205
- * server.registerResource(
3206
- * 'config',
3207
- * 'config://app',
3208
- * {
3209
- * title: 'Application Config',
3210
- * mimeType: 'text/plain'
3211
- * },
3212
- * async uri => ({
3213
- * contents: [{ uri: uri.href, text: 'App configuration here' }]
3214
- * })
3215
- * );
3216
- * ```
3217
- */
3218
- registerResource(name: string, uriOrTemplate: string, config: ResourceMetadata & {
3219
- cacheHint?: CacheHint;
3220
- }, readCallback: ReadResourceCallback): RegisteredResource;
3221
- registerResource(name: string, uriOrTemplate: ResourceTemplate, config: ResourceMetadata & {
3222
- cacheHint?: CacheHint;
3223
- }, readCallback: ReadResourceTemplateCallback): RegisteredResourceTemplate;
3224
- private _createRegisteredResource;
3225
- private _createRegisteredResourceTemplate;
3226
- private _createRegisteredPrompt;
3227
- private _createRegisteredTool;
3228
- /**
3229
- * Registers a tool with a config object and callback.
3230
- *
3231
- * @example
3232
- * ```ts source="./mcp.examples.ts#McpServer_registerTool_basic"
3233
- * server.registerTool(
3234
- * 'calculate-bmi',
3235
- * {
3236
- * title: 'BMI Calculator',
3237
- * description: 'Calculate Body Mass Index',
3238
- * inputSchema: z.object({
3239
- * weightKg: z.number(),
3240
- * heightM: z.number()
3241
- * }),
3242
- * outputSchema: z.object({ bmi: z.number() })
3243
- * },
3244
- * async ({ weightKg, heightM }) => {
3245
- * const output = { bmi: weightKg / (heightM * heightM) };
3246
- * return {
3247
- * content: [{ type: 'text', text: JSON.stringify(output) }],
3248
- * structuredContent: output
3249
- * };
3250
- * }
3251
- * );
3252
- * ```
3253
- */
3254
- registerTool<OutputArgs extends StandardSchemaWithJSON, InputArgs extends StandardSchemaWithJSON | undefined = undefined>(name: string, config: {
3255
- title?: string;
3256
- description?: string;
3257
- inputSchema?: InputArgs;
3258
- outputSchema?: OutputArgs;
3259
- annotations?: ToolAnnotations;
3260
- icons?: Icon[];
3261
- _meta?: Record<string, unknown>;
3262
- }, cb: ToolCallback<InputArgs>): RegisteredTool;
3263
- /** @deprecated Wrap with `z.object({...})` instead. Raw-shape form: `inputSchema`/`outputSchema` may be a plain `{ field: z.string() }` record; it is auto-wrapped with `z.object()`. */
3264
- registerTool<InputArgs extends ZodRawShape, OutputArgs extends ZodRawShape | StandardSchemaWithJSON | undefined = undefined>(name: string, config: {
3265
- title?: string;
3266
- description?: string;
3267
- inputSchema?: InputArgs;
3268
- outputSchema?: OutputArgs;
3269
- annotations?: ToolAnnotations;
3270
- icons?: Icon[];
3271
- _meta?: Record<string, unknown>;
3272
- }, cb: LegacyToolCallback<InputArgs>): RegisteredTool;
3273
- /**
3274
- * Registers a prompt with a config object and callback.
3275
- *
3276
- * @example
3277
- * ```ts source="./mcp.examples.ts#McpServer_registerPrompt_basic"
3278
- * server.registerPrompt(
3279
- * 'review-code',
3280
- * {
3281
- * title: 'Code Review',
3282
- * description: 'Review code for best practices',
3283
- * argsSchema: z.object({ code: z.string() })
3284
- * },
3285
- * ({ code }) => ({
3286
- * messages: [
3287
- * {
3288
- * role: 'user' as const,
3289
- * content: {
3290
- * type: 'text' as const,
3291
- * text: `Please review this code:\n\n${code}`
3292
- * }
3293
- * }
3294
- * ]
3295
- * })
3296
- * );
3297
- * ```
3298
- */
3299
- registerPrompt<Args extends StandardSchemaWithJSON>(name: string, config: {
3300
- title?: string;
3301
- description?: string;
3302
- argsSchema?: Args;
3303
- icons?: Icon[];
3304
- _meta?: Record<string, unknown>;
3305
- }, cb: PromptCallback<Args>): RegisteredPrompt;
3306
- /** @deprecated Wrap with `z.object({...})` instead. Raw-shape form: `argsSchema` may be a plain `{ field: z.string() }` record; it is auto-wrapped with `z.object()`. */
3307
- registerPrompt<Args extends ZodRawShape>(name: string, config: {
3308
- title?: string;
3309
- description?: string;
3310
- argsSchema?: Args;
3311
- icons?: Icon[];
3312
- _meta?: Record<string, unknown>;
3313
- }, cb: LegacyPromptCallback<Args>): RegisteredPrompt;
3314
- /**
3315
- * Checks if the server is connected to a transport.
3316
- * @returns `true` if the server is connected
3317
- */
3318
- isConnected(): boolean;
3319
- /**
3320
- * Sends a logging message to the client, if connected.
3321
- * Note: You only need to send the parameters object, not the entire JSON-RPC message.
3322
- * @see {@linkcode LoggingMessageNotification}
3323
- * @param params
3324
- * @param sessionId Optional for stateless transports and backward compatibility.
3325
- *
3326
- * @example
3327
- * ```ts source="./mcp.examples.ts#McpServer_sendLoggingMessage_basic"
3328
- * await server.sendLoggingMessage({
3329
- * level: 'info',
3330
- * data: 'Processing complete'
3331
- * });
3332
- * ```
3333
- *
3334
- * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
3335
- * Remains functional during the deprecation window (at least twelve months).
3336
- * Migrate to stderr logging (STDIO servers) or OpenTelemetry.
3337
- */
3338
- sendLoggingMessage(params: LoggingMessageNotification['params'], sessionId?: string): Promise<void>;
3339
- /**
3340
- * Sends a resource list changed event to the client, if connected.
3341
- */
3342
- sendResourceListChanged(): void;
3343
- /**
3344
- * Sends a tool list changed event to the client, if connected.
3345
- */
3346
- sendToolListChanged(): void;
3347
- /**
3348
- * Sends a prompt list changed event to the client, if connected.
3349
- */
3350
- sendPromptListChanged(): void;
3351
- }
3352
- /**
3353
- * A callback to complete one variable within a resource template's URI template.
3354
- */
3355
- type CompleteResourceTemplateCallback = (value: string, context?: {
3356
- arguments?: Record<string, string>;
3357
- }) => string[] | Promise<string[]>;
3358
- /**
3359
- * A resource template combines a URI pattern with optional functionality to enumerate
3360
- * all resources matching that pattern.
3361
- */
3362
- declare class ResourceTemplate {
3363
- private _callbacks;
3364
- private _uriTemplate;
3365
- constructor(uriTemplate: string | UriTemplate, _callbacks: {
3366
- /**
3367
- * A callback to list all resources matching this template. This is required to be specified, even if `undefined`, to avoid accidentally forgetting resource listing.
3368
- */
3369
- list: ListResourcesCallback | undefined;
3370
- /**
3371
- * An optional callback to autocomplete variables within the URI template. Useful for clients and users to discover possible values.
3372
- */
3373
- complete?: {
3374
- [variable: string]: CompleteResourceTemplateCallback;
3375
- };
3376
- });
3377
- /**
3378
- * Gets the URI template pattern.
3379
- */
3380
- get uriTemplate(): UriTemplate;
3381
- /**
3382
- * Gets the list callback, if one was provided.
3383
- */
3384
- get listCallback(): ListResourcesCallback | undefined;
3385
- /**
3386
- * Gets the callback for completing a specific URI template variable, if one was provided.
3387
- */
3388
- completeCallback(variable: string): CompleteResourceTemplateCallback | undefined;
3389
- }
3390
- /**
3391
- * A plain record of Zod field schemas, e.g. `{ name: z.string() }`. Accepted by
3392
- * `registerTool`/`registerPrompt` as a shorthand; auto-wrapped with `z.object()`.
3393
- * Zod schemas only — `z.object()` cannot wrap other Standard Schema libraries.
3394
- */
3395
- type ZodRawShape = Record<string, z.ZodType>;
3396
- /** Infers the parsed-output type of a {@linkcode ZodRawShape}. */
3397
- type InferRawShape<S extends ZodRawShape> = z.infer<z.ZodObject<S>>;
3398
- /** {@linkcode ToolCallback} variant used when `inputSchema` is a {@linkcode ZodRawShape}. */
3399
- type LegacyToolCallback<Args extends ZodRawShape | undefined> = Args extends ZodRawShape ? (args: InferRawShape<Args>, ctx: ServerContext) => CallToolResult | InputRequiredResult | Promise<CallToolResult | InputRequiredResult> : (ctx: ServerContext) => CallToolResult | InputRequiredResult | Promise<CallToolResult | InputRequiredResult>;
3400
- /** {@linkcode PromptCallback} variant used when `argsSchema` is a {@linkcode ZodRawShape}. */
3401
- type LegacyPromptCallback<Args extends ZodRawShape | undefined> = Args extends ZodRawShape ? (args: InferRawShape<Args>, ctx: ServerContext) => GetPromptResult | InputRequiredResult | Promise<GetPromptResult | InputRequiredResult> : (ctx: ServerContext) => GetPromptResult | InputRequiredResult | Promise<GetPromptResult | InputRequiredResult>;
3402
- type BaseToolCallback<SendResultT extends Result$1, Ctx extends ServerContext, Args extends StandardSchemaWithJSON | undefined> = Args extends StandardSchemaWithJSON ? (args: StandardSchemaWithJSON.InferOutput<Args>, ctx: Ctx) => SendResultT | Promise<SendResultT> : (ctx: Ctx) => SendResultT | Promise<SendResultT>;
3403
- /**
3404
- * Callback for a tool handler registered with {@linkcode McpServer.registerTool}.
3405
- */
3406
- type ToolCallback<Args extends StandardSchemaWithJSON | undefined = undefined> = BaseToolCallback<CallToolResult | InputRequiredResult, ServerContext, Args>;
3407
- /**
3408
- * Tool handler callback type.
3409
- */
3410
- type AnyToolHandler<Args extends StandardSchemaWithJSON | undefined = undefined> = ToolCallback<Args>;
3411
- /**
3412
- * Internal executor type that encapsulates handler invocation with proper types.
3413
- */
3414
- type ToolExecutor = (args: unknown, ctx: ServerContext) => Promise<CallToolResult | InputRequiredResult>;
3415
- type RegisteredTool = {
3416
- title?: string;
3417
- description?: string;
3418
- inputSchema?: StandardSchemaWithJSON;
3419
- outputSchema?: StandardSchemaWithJSON;
3420
- /**
3421
- * @hidden
3422
- * The converted JSON Schema of `outputSchema`, memoised at registration (and on
3423
- * `update({outputSchema})`) so the `tools/call` handler passes the SAME advertised schema
3424
- * `tools/list` emits to the wire codec's `projectCallToolResult` — the SEP-2106 `{result:…}`
3425
- * wrap predicate follows the schema's root, never the runtime value shape. `undefined` when
3426
- * no `outputSchema` is registered or its conversion threw (see {@link convertOutputSchemaJson}).
3427
- */
3428
- outputSchemaJson?: Record<string, unknown>;
3429
- annotations?: ToolAnnotations;
3430
- icons?: Icon[];
3431
- execution?: ToolExecution;
3432
- _meta?: Record<string, unknown>;
3433
- handler: AnyToolHandler<StandardSchemaWithJSON | undefined>;
3434
- /** @hidden */
3435
- executor: ToolExecutor;
3436
- enabled: boolean;
3437
- enable(): void;
3438
- disable(): void;
3439
- update(updates: {
3440
- name?: string | null;
3441
- title?: string;
3442
- description?: string;
3443
- paramsSchema?: StandardSchemaWithJSON;
3444
- outputSchema?: StandardSchemaWithJSON;
3445
- annotations?: ToolAnnotations;
3446
- icons?: Icon[];
3447
- _meta?: Record<string, unknown>;
3448
- callback?: ToolCallback<StandardSchemaWithJSON>;
3449
- enabled?: boolean;
3450
- }): void;
3451
- remove(): void;
3452
- };
3453
- /**
3454
- * Additional, optional information for annotating a resource.
3455
- */
3456
- type ResourceMetadata = Omit<Resource, 'uri' | 'name'>;
3457
- /**
3458
- * Callback to list all resources matching a given template.
3459
- */
3460
- type ListResourcesCallback = (ctx: ServerContext) => ListResourcesResult | Promise<ListResourcesResult>;
3461
- /**
3462
- * Callback to read a resource at a given URI.
3463
- */
3464
- type ReadResourceCallback = (uri: URL, ctx: ServerContext) => ReadResourceResult | InputRequiredResult | Promise<ReadResourceResult | InputRequiredResult>;
3465
- type RegisteredResource = {
3466
- name: string;
3467
- title?: string;
3468
- metadata?: ResourceMetadata;
3469
- /** Cache hint applied to this resource's `resources/read` results on the 2026-07-28 revision. */
3470
- cacheHint?: CacheHint;
3471
- readCallback: ReadResourceCallback;
3472
- enabled: boolean;
3473
- enable(): void;
3474
- disable(): void;
3475
- update(updates: {
3476
- name?: string;
3477
- title?: string;
3478
- uri?: string | null;
3479
- metadata?: ResourceMetadata;
3480
- callback?: ReadResourceCallback;
3481
- enabled?: boolean;
3482
- }): void;
3483
- remove(): void;
3484
- };
3485
- /**
3486
- * Callback to read a resource at a given URI, following a filled-in URI template.
3487
- */
3488
- type ReadResourceTemplateCallback = (uri: URL, variables: Variables, ctx: ServerContext) => ReadResourceResult | InputRequiredResult | Promise<ReadResourceResult | InputRequiredResult>;
3489
- type RegisteredResourceTemplate = {
3490
- resourceTemplate: ResourceTemplate;
3491
- title?: string;
3492
- metadata?: ResourceMetadata;
3493
- /** Cache hint applied to this template's `resources/read` results on the 2026-07-28 revision. */
3494
- cacheHint?: CacheHint;
3495
- readCallback: ReadResourceTemplateCallback;
3496
- enabled: boolean;
3497
- enable(): void;
3498
- disable(): void;
3499
- update(updates: {
3500
- name?: string | null;
3501
- title?: string;
3502
- template?: ResourceTemplate;
3503
- metadata?: ResourceMetadata;
3504
- callback?: ReadResourceTemplateCallback;
3505
- enabled?: boolean;
3506
- }): void;
3507
- remove(): void;
3508
- };
3509
- type PromptCallback<Args extends StandardSchemaWithJSON | undefined = undefined> = Args extends StandardSchemaWithJSON ? (args: StandardSchemaWithJSON.InferOutput<Args>, ctx: ServerContext) => GetPromptResult | InputRequiredResult | Promise<GetPromptResult | InputRequiredResult> : (ctx: ServerContext) => GetPromptResult | InputRequiredResult | Promise<GetPromptResult | InputRequiredResult>;
3510
- /**
3511
- * Internal handler type that encapsulates parsing and callback invocation.
3512
- * This allows type-safe handling without runtime type assertions.
3513
- */
3514
- type PromptHandler = (args: Record<string, unknown> | undefined, ctx: ServerContext) => Promise<GetPromptResult | InputRequiredResult>;
3515
- type RegisteredPrompt = {
3516
- title?: string;
3517
- description?: string;
3518
- argsSchema?: StandardSchemaWithJSON;
3519
- icons?: Icon[];
3520
- _meta?: Record<string, unknown>;
3521
- /** @hidden */
3522
- handler: PromptHandler;
3523
- enabled: boolean;
3524
- enable(): void;
3525
- disable(): void;
3526
- update<Args extends StandardSchemaWithJSON>(updates: {
3527
- name?: string | null;
3528
- title?: string;
3529
- description?: string;
3530
- argsSchema?: Args;
3531
- icons?: Icon[];
3532
- _meta?: Record<string, unknown>;
3533
- callback?: PromptCallback<Args>;
3534
- enabled?: boolean;
3535
- }): void;
3536
- remove(): void;
3537
- };
3538
- //#endregion
3539
- //#region src/server/perRequestTransport.d.ts
3540
- /**
3541
- * How the transport shapes its HTTP response for a request:
3542
- *
3543
- * - `auto` (default): answer with a single JSON body unless the handler emits
3544
- * a related message before its result, in which case the response upgrades
3545
- * to an SSE stream.
3546
- * - `sse`: always answer handler output over an SSE stream. The stream opens
3547
- * once the request has passed the pre-dispatch validation gates, so ladder
3548
- * rejections keep their mapped HTTP status instead of being framed onto a
3549
- * 200 stream.
3550
- * - `json`: never stream; related messages other than the terminal response
3551
- * are dropped.
3552
- */
3553
- type PerRequestResponseMode = 'auto' | 'sse' | 'json';
3554
- /** Constructor options for {@linkcode PerRequestHTTPServerTransport}. */
3555
- interface PerRequestHTTPServerTransportOptions {
3556
- /** The edge classification of the message this transport will serve. */
3557
- classification: MessageClassification;
3558
- /** Response shaping for the exchange; defaults to `auto`. */
3559
- responseMode?: PerRequestResponseMode;
3560
- }
3561
- /** Per-exchange context handed to {@linkcode PerRequestHTTPServerTransport.handleMessage}. */
3562
- interface PerRequestMessageExtra {
3563
- /**
3564
- * The original HTTP request. Used for handler context and, when the
3565
- * runtime provides an abort signal on it, to cancel the exchange when the
3566
- * client disconnects.
3567
- */
3568
- request?: globalThis.Request;
3569
- /**
3570
- * Validated authentication information supplied by the caller. Strictly
3571
- * pass-through: the transport never populates this from request headers.
3572
- */
3573
- authInfo?: AuthInfo;
3574
- }
3575
- /**
3576
- * The per-request micro-transport: a real, connected `Transport` whose whole
3577
- * lifetime is one HTTP exchange. See the module documentation for the
3578
- * response shapes it produces.
3579
- */
3580
- declare class PerRequestHTTPServerTransport implements Transport {
3581
- onclose?: () => void;
3582
- onerror?: (error: Error) => void;
3583
- onmessage?: <T$1 extends JSONRPCMessage>(message: T$1, extra?: MessageExtraInfo) => void;
3584
- private readonly _classification;
3585
- private readonly _responseMode;
3586
- private _started;
3587
- private _used;
3588
- private _closed;
3589
- private _terminalDelivered;
3590
- /**
3591
- * `true` only while the inbound message is being delivered synchronously
3592
- * to the connected protocol layer. The pre-handler gates (the era
3593
- * registry gate, the edge→instance handoff check, the missing-handler
3594
- * rejection) answer inside this window; request handlers always run
3595
- * after it (the protocol layer defers them to a microtask). An error
3596
- * sent inside the window is therefore ladder-originated, and an error
3597
- * sent after it is handler-produced.
3598
- */
3599
- private _dispatchWindowOpen;
3600
- private _requestId?;
3601
- private _deferredResponse?;
3602
- private _sse?;
3603
- private _abortCleanup?;
3604
- constructor(options: PerRequestHTTPServerTransportOptions);
3605
- start(): Promise<void>;
3606
- /**
3607
- * Serves the single exchange: delivers the classified message to the
3608
- * connected server instance and resolves with the HTTP response.
3609
- *
3610
- * Throws when called a second time (the transport is strictly
3611
- * single-use), or before a server has been connected to the transport.
3612
- * The returned promise rejects with a connection-closed error when the
3613
- * transport is closed before a response was produced (for example because
3614
- * the client disconnected).
3615
- */
3616
- handleMessage(message: JSONRPCRequest | JSONRPCNotification, extra?: PerRequestMessageExtra): Promise<Response>;
3617
- send(message: JSONRPCMessage, options?: TransportSendOptions): Promise<void>;
3618
- /**
3619
- * Writes an SSE comment frame (a keep-alive heartbeat). Dropped when the
3620
- * exchange is not currently streaming.
3621
- */
3622
- writeCommentFrame(comment: string): void;
3623
- close(): Promise<void>;
3624
- private settleResponse;
3625
- private upgradeToSse;
3626
- private finalizeStream;
3627
- private writeMessageFrame;
3628
- private writeFrame;
3629
- }
3630
- //#endregion
3631
- //#region src/server/serverEventBus.d.ts
3632
- /**
3633
- * A change event a server publishes for delivery on open `subscriptions/listen`
3634
- * streams. Each variant maps onto exactly one notification method:
3635
- *
3636
- * - `tools_list_changed` → `notifications/tools/list_changed`
3637
- * - `prompts_list_changed` → `notifications/prompts/list_changed`
3638
- * - `resources_list_changed` → `notifications/resources/list_changed`
3639
- * - `resource_updated` → `notifications/resources/updated` (carries the URI)
3640
- *
3641
- * The bus carries the EVENT, not the wire shape — the entry's listen router
3642
- * owns subscription-id stamping and per-stream filtering.
3643
- */
3644
- type ServerEvent = {
3645
- kind: 'tools_list_changed';
3646
- } | {
3647
- kind: 'prompts_list_changed';
3648
- } | {
3649
- kind: 'resources_list_changed';
3650
- } | {
3651
- kind: 'resource_updated';
3652
- uri: string;
3653
- };
3654
- /**
3655
- * The server-side change-event seam for `subscriptions/listen`.
3656
- *
3657
- * The serving entry (`createMcpHandler`) owns the per-stream listen router:
3658
- * each open `subscriptions/listen` stream registers a listener via
3659
- * `subscribe()`, and consumer code (typically via `handler.notify.*` sugar)
3660
- * publishes change events via `publish()`. In-process servers can use the
3661
- * default {@linkcode InMemoryServerEventBus}; multi-process deployments
3662
- * implement this interface over their own pub/sub.
3663
- *
3664
- * The SDK owns wire semantics (ack-first, filtering, subscription-id
3665
- * stamping, teardown); a `ServerEventBus` only sources the events. It MUST
3666
- * NOT echo back to the listener that published an event when called from
3667
- * inside that listener (no surprise here — the default delivers
3668
- * synchronously and listeners never publish).
3669
- */
3670
- interface ServerEventBus {
3671
- /**
3672
- * Publish a change event to every registered listener.
3673
- */
3674
- publish(event: ServerEvent): void;
3675
- /**
3676
- * Register a listener; returns an idempotent unsubscribe function.
3677
- */
3678
- subscribe(listener: (event: ServerEvent) => void): () => void;
3679
- }
3680
- /**
3681
- * A `ServerEventBus` backed by an in-process listener set.
3682
- *
3683
- * `publish()` delivers synchronously to the live listener set (a listener
3684
- * unsubscribing itself mid-dispatch is safe; the entry's listen-router
3685
- * listeners never unsubscribe peers). A throwing listener does not stop
3686
- * delivery to the others.
3687
- */
3688
- declare class InMemoryServerEventBus implements ServerEventBus {
3689
- private readonly onerror?;
3690
- private readonly _listeners;
3691
- /**
3692
- * @param onerror - Optional callback for errors thrown by listeners
3693
- * during dispatch.
3694
- */
3695
- constructor(onerror?: ((error: Error) => void) | undefined);
3696
- publish(event: ServerEvent): void;
3697
- subscribe(listener: (event: ServerEvent) => void): () => void;
3698
- /** The number of currently registered listeners (test/introspection only — the routers track capacity via their own open-subscription set). */
3699
- get listenerCount(): number;
3700
- }
3701
- /**
3702
- * Typed publish-side facade over `bus.publish` returned by `createMcpHandler`:
3703
- * each method publishes the corresponding {@linkcode ServerEvent}. Prefer this
3704
- * over calling `bus.publish` directly — the names match the wire methods.
3705
- */
3706
- interface ServerNotifier {
3707
- /** Publish `notifications/tools/list_changed` to every open subscription that opted in. */
3708
- toolsChanged(): void;
3709
- /** Publish `notifications/prompts/list_changed` to every open subscription that opted in. */
3710
- promptsChanged(): void;
3711
- /** Publish `notifications/resources/list_changed` to every open subscription that opted in. */
3712
- resourcesChanged(): void;
3713
- /** Publish `notifications/resources/updated` for `uri` to every open subscription that opted in to that URI. */
3714
- resourceUpdated(uri: string): void;
3715
- }
3716
- //#endregion
3717
- //#region src/server/createMcpHandler.d.ts
3718
- /**
3719
- * Construction context handed to an {@linkcode McpServerFactory}.
3720
- *
3721
- * Both serving entries call the factory with this context whenever they need
3722
- * a fresh instance: {@linkcode createMcpHandler} once per HTTP request, and
3723
- * `serveStdio` (from `@modelcontextprotocol/server/stdio`) once per
3724
- * connection — plus once for a `server/discover` probe instance that is
3725
- * discarded again if the client falls back to `initialize`.
3726
- *
3727
- * Zero-argument factories remain assignable unchanged; the context exists for
3728
- * factories that vary by principal or era (for example multi-tenant servers
3729
- * keyed off `authInfo`, or a factory that registers extra surface only for one
3730
- * era).
3731
- */
3732
- interface McpRequestContext {
3733
- /**
3734
- * The protocol era the constructed instance will serve: `modern` for
3735
- * 2026-07-28 (per-request envelope) traffic, `legacy` for 2025-era
3736
- * traffic. Under {@linkcode createMcpHandler} a `legacy` instance serves
3737
- * one request through the stateless legacy fallback (the default —
3738
- * `legacy: 'reject'` endpoints are strict and never construct one); under
3739
- * `serveStdio` it serves a connection that opened with the 2025 handshake
3740
- * and stays pinned to that era for its lifetime.
3741
- */
3742
- era: 'legacy' | 'modern';
3743
- /**
3744
- * Validated authentication information passed by the caller of the
3745
- * handler face (pass-through; HTTP only — `serveStdio` never sets it).
3746
- */
3747
- authInfo?: AuthInfo;
3748
- /** The original HTTP request being served, when available (HTTP only — `serveStdio` never sets it). */
3749
- requestInfo?: Request;
3750
- }
3751
- /**
3752
- * A factory producing a fresh {@linkcode McpServer} (or low-level
3753
- * {@linkcode Server}) instance for one serving unit: one HTTP request under
3754
- * {@linkcode createMcpHandler}, or one connection (or one discarded
3755
- * `server/discover` probe) under `serveStdio`. The same factory backs every
3756
- * era either entry serves — define your tools, resources and prompts once and
3757
- * serve them to both eras.
3758
- */
3759
- type McpServerFactory = (ctx: McpRequestContext) => McpServer | Server | Promise<McpServer | Server>;
3760
- /** Caller-provided per-request inputs for {@linkcode McpHttpHandler.fetch} and fetch-shaped legacy handlers ({@linkcode LegacyHttpHandler}). */
3761
- interface McpHandlerRequestOptions {
3762
- /**
3763
- * Validated authentication information for the request. Strictly
3764
- * pass-through: the handler never populates this from request headers and
3765
- * performs no token verification of its own.
3766
- */
3767
- authInfo?: AuthInfo;
3768
- /** A pre-parsed JSON request body (e.g. `req.body` from `express.json()`). */
3769
- parsedBody?: unknown;
3770
- }
3771
- /**
3772
- * A fetch-shaped handler serving 2025-era traffic: the shape produced by
3773
- * {@linkcode legacyStatelessFallback}, and the shape a hand-wired composition
3774
- * routes legacy requests to (see {@linkcode isLegacyRequest}). It is not a
3775
- * `legacy` option value — the entry's own legacy serving is selected by the
3776
- * `'stateless' | 'reject'` posture only.
3777
- */
3778
- type LegacyHttpHandler = (request: Request, options?: McpHandlerRequestOptions) => Promise<Response>;
3779
- /** Options for {@linkcode createMcpHandler}. */
3780
- interface CreateMcpHandlerOptions {
3781
- /**
3782
- * How 2025-era (non-envelope) traffic is served:
3783
- *
3784
- * - `'stateless'` (the default, also when the option is omitted) —
3785
- * old-school stateless serving: each legacy request is answered by a
3786
- * fresh instance from the same factory over a streamable HTTP transport
3787
- * constructed with only `sessionIdGenerator: undefined` (the established
3788
- * stateless idiom). Because serving is per-request and stateless, GET and
3789
- * DELETE (2025 session operations) are answered with `405` /
3790
- * `Method not allowed.`.
3791
- * - `'reject'` — modern-only strict: legacy-classified requests are
3792
- * rejected with the unsupported-protocol-version error naming the
3793
- * endpoint's supported revisions (legacy-classified notifications are
3794
- * acknowledged with `202` and dropped). **There is no 2025 serving in
3795
- * this mode.**
3796
- *
3797
- * There is no handler-valued option: to keep an existing legacy deployment
3798
- * (for example a sessionful streamable HTTP wiring) serving 2025 traffic
3799
- * next to this entry, route in user land with {@linkcode isLegacyRequest}
3800
- * in front of a `legacy: 'reject'` handler — see that predicate's
3801
- * documentation for the pattern.
3802
- */
3803
- legacy?: 'stateless' | 'reject';
3804
- /** Callback for out-of-band errors and rejected requests (reporting only; it never alters the response). */
3805
- onerror?: (error: Error) => void;
3806
- /**
3807
- * Response shaping for modern (2026-07-28) request exchanges:
3808
- *
3809
- * - `'auto'` (default) — a single JSON body unless the handler emits a
3810
- * related message before its result, in which case the response upgrades
3811
- * to an SSE stream.
3812
- * - `'sse'` — always stream.
3813
- * - `'json'` — never stream. **Mid-call notifications (progress, logging,
3814
- * any related message emitted before the result) are dropped** — only the
3815
- * terminal result is delivered. Listen-class subscription streams are
3816
- * always served over SSE regardless of this setting.
3817
- */
3818
- responseMode?: PerRequestResponseMode;
3819
- /**
3820
- * The change-event bus `subscriptions/listen` streams subscribe to.
3821
- *
3822
- * When omitted, an in-process {@link InMemoryServerEventBus} is created
3823
- * and the returned handler's `notify` sugar publishes onto it.
3824
- * Multi-process deployments supply their own implementation over their
3825
- * pub/sub backend; the same instance can be shared across handlers.
3826
- */
3827
- bus?: ServerEventBus;
3828
- /**
3829
- * Reject a new `subscriptions/listen` with `-32603` 'Subscription limit
3830
- * reached' (in-band, HTTP 200, before the ack) when this many subscription
3831
- * streams are already open on this handler.
3832
- * @default 1024
3833
- */
3834
- maxSubscriptions?: number;
3835
- /**
3836
- * SSE comment-frame keepalive interval for `subscriptions/listen` streams,
3837
- * in milliseconds. Set to `0` to disable.
3838
- * @default 15000
3839
- */
3840
- keepAliveMs?: number;
3841
- }
3842
- /**
3843
- * The handler returned by {@linkcode createMcpHandler}: a web-standard
3844
- * `{ fetch, close, notify, bus }` object — the shape Workers/Bun/Deno expect
3845
- * from `export default`. `fetch` is an arrow-assigned bound property: it can be
3846
- * detached and passed around (`const { fetch } = handler`) without losing its
3847
- * binding.
3848
- *
3849
- * Node frameworks (Express, Fastify, plain `node:http`) wrap the handler once
3850
- * with `toNodeHandler(handler)` from `@modelcontextprotocol/node`.
3851
- */
3852
- interface McpHttpHandler {
3853
- /** Web-standard face: serve one HTTP request and resolve with the response. */
3854
- fetch: (request: Request, options?: McpHandlerRequestOptions) => Promise<Response>;
3855
- /**
3856
- * Tears down the modern leg: aborts in-flight modern exchanges and closes
3857
- * their per-request instances. Legacy serving is unaffected — the
3858
- * stateless fallback is per-request by construction and holds nothing
3859
- * between exchanges.
3860
- */
3861
- close: () => Promise<void>;
3862
- /**
3863
- * Typed publish-side facade over the handler's `subscriptions/listen` bus:
3864
- * each method publishes the corresponding change event to every open
3865
- * subscription stream that opted in to that notification type.
3866
- *
3867
- * Safe to call when no subscription is open (no-op).
3868
- */
3869
- notify: ServerNotifier;
3870
- /**
3871
- * The change-event bus this handler's `subscriptions/listen` streams
3872
- * subscribe to (the supplied `bus` option, or the auto-created in-process
3873
- * default).
3874
- */
3875
- bus: ServerEventBus;
3876
- }
3877
- /**
3878
- * The entry's default legacy serving (`legacy: 'stateless'`): per-request
3879
- * stateless serving of 2025-era traffic using the same factory as the modern
3880
- * path. Exported as a standalone building block for hand-wired compositions
3881
- * (for example mounting legacy stateless serving on its own route next to a
3882
- * strict modern endpoint).
3883
- *
3884
- * Each POST is served by a fresh instance from the factory connected to a
3885
- * fresh streamable HTTP transport constructed with only
3886
- * `sessionIdGenerator: undefined` — the established stateless idiom, unchanged.
3887
- * Because serving is per-request and stateless, GET and DELETE (2025 session
3888
- * operations) are answered with `405` / `Method not allowed.`, exactly like the
3889
- * canonical stateless example.
3890
- *
3891
- * The optional `onerror` callback receives factory and serving failures on
3892
- * this leg (reporting only — the response stays the 500 internal-error body).
3893
- * The entry passes its own `onerror` here when expanding the default, so
3894
- * legacy-leg failures are never silently swallowed.
3895
- */
3896
- declare function legacyStatelessFallback(factory: McpServerFactory, onerror?: (error: Error) => void): LegacyHttpHandler;
3897
- /**
3898
- * Whether {@linkcode createMcpHandler} would route this request to its legacy
3899
- * (2025-era) serving rather than the modern (2026-07-28) path.
3900
- *
3901
- * Call it with just the request: `await isLegacyRequest(request)`. For a
3902
- * `POST` the body is read from an internal clone, so the request you pass
3903
- * stays fully readable for whichever handler you route it to — no second
3904
- * argument is needed. (In a Node `(req, res)` handler, build that `Request`
3905
- * with `toWebRequest(req)` from `@modelcontextprotocol/node`; behind a body
3906
- * parser, which has already drained the Node stream, build it as
3907
- * `toWebRequest(req, req.body)` so the bytes come from the parsed body —
3908
- * either way the predicate still takes just the request.) The optional
3909
- * `parsedBody` is a perf escape hatch for a body you already hold parsed:
3910
- * pass it and the predicate classifies from the value directly, reading and
3911
- * cloning nothing. It is needed, not just faster, when the request's own
3912
- * body was already read — the internal clone is then impossible (cloning a
3913
- * used body throws a `TypeError`), so such a single-argument call rejects
3914
- * instead of guessing.
3915
- *
3916
- * This is the entry's own classification step exported as a predicate — it
3917
- * runs exactly the code `createMcpHandler` runs to make the routing decision,
3918
- * not a re-implementation — so a hand-wired composition that branches on it
3919
- * can never disagree with the entry. It is classification only: hand-wired
3920
- * compositions must validate Content-Type themselves (415 for POSTs whose
3921
- * media type is not `application/json`, via {@linkcode isJsonContentType})
3922
- * before dispatching either leg — routing the legacy leg into the SDK
3923
- * transports gets their built-in check, but a custom modern leg has none. Use it to keep an existing legacy
3924
- * deployment (for example a sessionful streamable HTTP wiring) serving 2025
3925
- * traffic next to a strict modern endpoint, now that the entry has no
3926
- * handler-valued `legacy` option:
3927
- *
3928
- * ```ts
3929
- * import { createMcpHandler, isLegacyRequest } from '@modelcontextprotocol/server';
3930
- *
3931
- * const modern = createMcpHandler(factory, { legacy: 'reject' });
3932
- *
3933
- * export default {
3934
- * async fetch(request: Request): Promise<Response> {
3935
- * if (await isLegacyRequest(request)) {
3936
- * // e.g. an existing sessionful WebStandardStreamableHTTPServerTransport wiring
3937
- * return myExistingLegacyHandler(request);
3938
- * }
3939
- * return modern.fetch(request);
3940
- * }
3941
- * };
3942
- * ```
3943
- *
3944
- * Semantics (identical to the entry's routing):
3945
- *
3946
- * - Returns `true` only for requests with no per-request `_meta` envelope
3947
- * claim: claim-less POSTs (including the `initialize` handshake and 2025-era
3948
- * notification POSTs without a modern protocol-version header), body-less
3949
- * GET/DELETE session operations, all-legacy JSON-RPC batch arrays, posted
3950
- * JSON-RPC responses, and POSTs whose body is empty or not valid JSON.
3951
- * - Returns `false` for everything the modern path answers, including its
3952
- * validation-ladder rejections: a request carrying the envelope claim (even
3953
- * one naming a revision the endpoint does not serve — the modern path
3954
- * answers it with the unsupported-protocol-version error), a malformed
3955
- * envelope behind a present claim (answered `-32602`), a request whose
3956
- * `MCP-Protocol-Version` header names a modern revision but that lacks the
3957
- * envelope (`-32602`), and header/body mismatches (`-32020`). Consumers
3958
- * routing on the predicate must send `false` traffic to the modern handler,
3959
- * never to a legacy handler — the modern path owns those error answers.
3960
- * - `server/discover` probes sent by negotiating clients always carry the
3961
- * envelope claim, so they are never legacy; a hand-built claim-less POST to
3962
- * a method named `server/discover` has no claim and classifies legacy,
3963
- * exactly as the entry itself routes it.
3964
- */
3965
- declare function isLegacyRequest(request: Request, parsedBody?: unknown): Promise<boolean>;
3966
- /**
3967
- * Creates an HTTP handler that serves the 2026-07-28 protocol revision from a
3968
- * per-request server factory and, by default, falls back to old-school
3969
- * stateless serving for 2025-era traffic. Pass `legacy: 'reject'` for a
3970
- * modern-only strict endpoint.
3971
- *
3972
- * Mounting: `handler.fetch` is the web-standard face (Cloudflare Workers,
3973
- * Deno, Bun, Hono's `c.req.raw`); for Express/Fastify/plain `node:http`, wrap
3974
- * the handler once with `toNodeHandler(handler)` from
3975
- * `@modelcontextprotocol/node`. When mounting bare on a fetch-native runtime,
3976
- * put Origin/Host validation in front of the handler — the entry itself is
3977
- * deliberately validation-free:
3978
- *
3979
- * ```ts
3980
- * import { hostHeaderValidationResponse, originValidationResponse, localhostAllowedHostnames, localhostAllowedOrigins } from '@modelcontextprotocol/server';
3981
- *
3982
- * export default {
3983
- * async fetch(request: Request): Promise<Response> {
3984
- * const rejected =
3985
- * hostHeaderValidationResponse(request, localhostAllowedHostnames()) ??
3986
- * originValidationResponse(request, localhostAllowedOrigins());
3987
- * return rejected ?? handler.fetch(request);
3988
- * }
3989
- * };
3990
- * ```
3991
- *
3992
- * Use ONE factory for both legs: the same tools/resources/prompts definition
3993
- * backs the modern path and the stateless legacy fallback, so the two eras can
3994
- * never drift apart. To keep an existing legacy deployment (for example a
3995
- * sessionful streamable HTTP wiring) serving 2025 traffic instead of the
3996
- * stateless fallback, route in user land with {@linkcode isLegacyRequest} in
3997
- * front of a strict handler — see that predicate's documentation for the
3998
- * pattern. Power users composing transport-neutral routing can also use the
3999
- * exported building blocks directly: {@linkcode classifyInboundRequest} for
4000
- * the era decision and `PerRequestHTTPServerTransport` for single-exchange
4001
- * serving — such compositions must reject POSTs whose Content-Type media type
4002
- * is not `application/json` (415) before parsing the body, using
4003
- * {@linkcode isJsonContentType}; neither building block performs this
4004
- * validation itself.
4005
- *
4006
- * The entry performs no token verification: `authInfo` given to `fetch` is
4007
- * passed through to handlers and the factory as-is and is never derived from
4008
- * request headers.
4009
- */
4010
- declare function createMcpHandler(factory: McpServerFactory, options?: CreateMcpHandlerOptions): McpHttpHandler;
4011
- //#endregion
4012
- export { ProtocolOptions as $, OAuthClientInformation as $a, SubscriptionsListenRequestParams as $i, InitializedNotification as $n, PingRequest as $r, BooleanSchema as $t, ResourceMetadata as A, INVALID_PARAMS as Aa, ResourceUpdatedNotificationParams as Ai, ElicitRequestParams as An, ListTasksResult as Ar, ProtocolErrorCode as At, STDIO_DEFAULT_MAX_BUFFER_SIZE as B, SUPPORTED_PROTOCOL_VERSIONS as Ba, ServerNotification as Bi, GetPromptResult as Bn, MissingRequiredClientCapabilityErrorData as Br, InboundClassificationOutcome as Bt, PromptCallback as C, UntitledMultiSelectEnumSchema as Ca, ResourceContents as Ci, CreateMessageResultWithTools as Cn, ListResourceTemplatesRequest as Cr, isTaskAugmentedRequestParams as Ct, RegisteredResource as D, CLIENT_INFO_META_KEY as Da, ResourceTemplateReference as Di, DiscoverResult as Dn, ListRootsRequest as Dr, ResourceNotFoundError as Dt, RegisteredPrompt as E, CLIENT_CAPABILITIES_META_KEY as Ea, ResourceRequestParams as Ei, DiscoverRequest as En, ListResourcesResult as Er, ProtocolError as Et, preloadSchemas as F, METHOD_NOT_FOUND as Fa, RootsListChangedNotification as Fi, EmbeddedResource as Fn, LoggingMessageNotificationParams as Fr, inputResponse as Ft, ProtocolEra as G, SdkError as Ga, SingleSelectEnumSchema as Gi, HandlerResultTypeMap as Gn, NotificationMethod as Gr, InboundModernRoute as Gt, serializeMessage as H, TRACESTATE_META_KEY as Ha, ServerResult as Hi, GetTaskPayloadResult as Hn, ModelPreferences as Hr, InboundLadderRejection as Ht, InMemoryTransport as I, PARSE_ERROR as Ia, SamplingContent as Ii, EmptyResult as In, MessageClassification as Ir, ElicitInputParams as It, BaseContext as J, SdkHttpErrorData as Ja, SubscribeRequestParams as Ji, ImageContent as Jn, NumberSchema as Jr, Annotations as Jt, getDisplayName as K, SdkErrorCode as Ka, StringSchema as Ki, Icon as Kn, NotificationParams as Kr, InboundValidationRung as Kt, UriTemplate as L, PROTOCOL_VERSION_META_KEY as La, SamplingMessage as Li, EnumSchema as Ln, MessageExtraInfo as Lr, StandardSchemaV1 as Lt, ToolCallback as M, JSONRPC_VERSION as Ma, ResultTypeMap as Mi, ElicitResult as Mn, ListToolsResult as Mr, InputResponseView as Mt, Server as N, LATEST_PROTOCOL_VERSION as Na, Role as Ni, ElicitationCompleteNotification as Nn, LoggingLevel as Nr, acceptedContent as Nt, RegisteredResourceTemplate as O, DEFAULT_NEGOTIATED_PROTOCOL_VERSION as Oa, ResourceTemplateType as Oi, ElicitRequest as On, ListRootsResult as Or, UnsupportedProtocolVersionError as Ot, ServerOptions as P, LOG_LEVEL_META_KEY as Pa, Root as Pi, ElicitationCompleteNotificationParams as Pn, LoggingMessageNotification as Pr, inputRequired as Pt, ProgressCallback as Q, IdJagTokenExchangeResponse as Qa, SubscriptionsListenRequest as Qi, InitializeResult as Qn, ParseError as Qr, BlobResourceContents as Qt, Variables as R, RELATED_TASK_META_KEY as Ra, SamplingMessageContentBlock as Ri, GetPromptRequest as Rn, MetaObject as Rr, StandardSchemaV1Sync as Rt, McpServer as S, UnsupportedProtocolVersionErrorData as Sa, Resource as Si, CreateMessageResult as Sn, ListPromptsResult as Sr, isJSONRPCResultResponse as St, ReadResourceTemplateCallback as T, BAGGAGE_META_KEY as Ta, ResourceListChangedNotification as Ti, Cursor as Tn, ListResourcesRequest as Tr, MissingRequiredClientCapabilityError as Tt, CacheHint as U, checkResourceAllowed as Ua, SetLevelRequest as Ui, GetTaskRequest as Un, MultiSelectEnumSchema as Ur, InboundLegacyRoute as Ut, deserializeMessage as V, TRACEPARENT_META_KEY as Va, ServerRequest as Vi, GetTaskPayloadRequest as Vn, ModelHint as Vr, InboundHttpRequest as Vt, CacheScope as W, resourceUrlFromServerUrl as Wa, SetLevelRequestParams as Wi, GetTaskResult as Wn, Notification as Wr, InboundLegacyRouteReason as Wt, DEFAULT_REQUEST_TIMEOUT_MSEC as X, OAuthErrorCode as Xa, SubscriptionsAcknowledgedNotification as Xi, InitializeRequest as Xn, PaginatedRequestParams as Xr, AuthInfo as Xt, ClientContext as Y, OAuthError as Ya, SubscriptionFilter as Yi, Implementation as Yn, PaginatedRequest as Yr, AudioContent as Yt, NotificationOptions as Z, AuthorizationServerMetadata as Za, SubscriptionsAcknowledgedNotificationParams as Zi, InitializeRequestParams as Zn, PaginatedResult as Zr, BaseMetadata as Zt, PerRequestResponseMode as _, ToolListChangedNotification as _a, RequestMetaEnvelope as _i, ContentBlock as _n, LegacyTitledEnumSchema as _r, isInputRequiredResult as _t, McpRequestContext as a, TaskMetadata as aa, Prompt as ai, CancelledNotification as an, OAuthMetadata as ao, InternalError as ar, Transport as at, CompleteResourceTemplateCallback as b, UnsubscribeRequest as ba, RequestParams as bi, CreateMessageRequestParamsBase as bn, ListChangedOptions as br, isJSONRPCRequest as bt, isLegacyRequest as c, TaskStatusNotificationParams as ca, PromptMessage as ci, ClientNotification as cn, OAuthTokens as co, JSONArray as cr, SpecTypeName as ct, ServerEvent as d, TitledMultiSelectEnumSchema as da, ReadResourceRequestParams as di, CompatibilityCallToolResult as dn, StoredOAuthClientInformation as do, JSONRPCMessage as dr, specTypeSchemas as dt, SubscriptionsListenResult as ea, PrimitiveSchemaDefinition as ei, CallToolRequest as en, OAuthClientInformationFull as eo, InputRequest as er, RequestHandlerSchemas as et, ServerEventBus as f, TitledSingleSelectEnumSchema as fa, ReadResourceResult as fi, CompleteRequest as fn, StoredOAuthTokens as fo, JSONRPCNotification as fr, assertCompleteRequestPrompt as ft, PerRequestMessageExtra as g, ToolExecution as ga, RequestMeta as gi, CompleteResult as gn, JSONValue as gr, isInitializedNotification as gt, PerRequestHTTPServerTransportOptions as h, ToolChoice as ha, RequestId as hi, CompleteRequestResourceTemplate as hn, JSONRPCResultResponse as hr, isInitializeRequest as ht, McpHttpHandler as i, TaskCreationParams as ia, ProgressToken as ii, CancelTaskResult as in, OAuthErrorResponse as io, InputResponses as ir, FetchLike as it, ResourceTemplate as j, INVALID_REQUEST as ja, Result$1 as ji, ElicitRequestURLParams as jn, ListToolsRequest as jr, InputRequiredSpec as jt, RegisteredTool as k, INTERNAL_ERROR as ka, ResourceUpdatedNotification as ki, ElicitRequestFormParams as kn, ListTasksRequest as kr, UrlElicitationRequiredError as kt, legacyStatelessFallback as l, TextContent as la, PromptReference as li, ClientRequest as ln, OpenIdProviderDiscoveryMetadata as lo, JSONObject as lr, SpecTypes as lt, PerRequestHTTPServerTransport as m, ToolAnnotations as ma, Request$1 as mi, CompleteRequestPrompt as mn, JSONRPCResponse as mr, isCallToolResult as mt, LegacyHttpHandler as n, Task as na, ProgressNotification as ni, CallToolResult as nn, OAuthClientMetadata as no, InputRequiredResult as nr, RequestStateAccessor as nt, McpServerFactory as o, TaskStatus as oa, PromptArgument as oi, CancelledNotificationParams as on, OAuthProtectedResourceMetadata as oo, InvalidParamsError as or, TransportSendOptions as ot, ServerNotifier as p, Tool as pa, RelatedTaskMetadata as pi, CompleteRequestParams as pn, JSONRPCRequest as pr, assertCompleteRequestResourceTemplate as pt, isJsonContentType as q, SdkHttpError as qa, SubscribeRequest as qi, Icons as qn, NotificationTypeMap as qr, classifyInboundRequest as qt, McpHandlerRequestOptions as r, TaskAugmentedRequestParams as ra, ProgressNotificationParams as ri, CancelTaskRequest as rn, OAuthClientRegistrationError as ro, InputResponse as rr, ServerContext as rt, createMcpHandler as s, TaskStatusNotification as sa, PromptListChangedNotification as si, ClientCapabilities as sn, OAuthTokenRevocationRequest as so, InvalidRequestError as sr, createFetchWithInit as st, CreateMcpHandlerOptions as t, SubscriptionsListenResultMeta as ta, Progress as ti, CallToolRequestParams as tn, OAuthClientInformationMixed as to, InputRequests as tr, RequestOptions as tt, InMemoryServerEventBus as u, TextResourceContents as ua, ReadResourceRequest as ui, ClientResult as un, OpenIdProviderMetadata as uo, JSONRPCErrorResponse as ur, isSpecType as ut, AnyToolHandler as v, ToolResultContent as va, RequestMetaObject as vi, CreateMessageRequest as vn, ListChangedCallback as vr, isJSONRPCErrorResponse as vt, ReadResourceCallback as w, UntitledSingleSelectEnumSchema as wa, ResourceLink as wi, CreateTaskResult as wn, ListResourceTemplatesResult as wr, parseJSONRPCMessage as wt, ListResourcesCallback as x, UnsubscribeRequestParams as xa, RequestTypeMap as xi, CreateMessageRequestParamsWithTools as xn, ListPromptsRequest as xr, isJSONRPCResponse as xt, BaseToolCallback as y, ToolUseContent as ya, RequestMethod as yi, CreateMessageRequestParams as yn, ListChangedHandlers as yr, isJSONRPCNotification as yt, ReadBuffer as z, SUBSCRIPTION_ID_META_KEY as za, ServerCapabilities as zi, GetPromptRequestParams as zn, MethodNotFoundError as zr, StandardSchemaWithJSON as zt };
4013
- //# sourceMappingURL=createMcpHandler-D93NefGZ.d.mts.map