mcp-use 2.0.0-beta.8 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1234) hide show
  1. package/dist/bin.js +1 -179
  2. package/dist/branding.d.ts +81 -0
  3. package/dist/buffered-response.d.ts +27 -0
  4. package/dist/chunk-273ZVKJJ.js +2 -0
  5. package/dist/{chunk-FCGJJVL2.js → chunk-GX6PGIEO.js} +33 -142
  6. package/dist/chunk-IS7FKXFR.js +1 -0
  7. package/dist/chunk-KGTOBJW2.js +1 -0
  8. package/dist/chunk-MIZQEWZS.js +1 -0
  9. package/dist/chunk-OJF6B5EU.js +1 -0
  10. package/dist/chunk-PSKSL567.js +1 -0
  11. package/dist/chunk-XYHHP43G.js +1 -0
  12. package/dist/chunk-Y26DNVWA.js +3 -0
  13. package/dist/chunk-ZMU5USAZ.js +1 -0
  14. package/dist/completable.d.ts +0 -1
  15. package/dist/config.d.ts +88 -80
  16. package/dist/context.d.ts +154 -60
  17. package/dist/fetch-app.d.ts +3 -28
  18. package/dist/index-node.js +781 -0
  19. package/dist/index.d.ts +34 -14
  20. package/dist/index.js +41 -2229
  21. package/dist/internal/node-http-unavailable.js +1 -0
  22. package/dist/internal/node-http.js +1 -0
  23. package/dist/internal/resource-completion.js +1 -7
  24. package/dist/internal/usage.js +1 -0
  25. package/dist/landing-handler-TG6LVQBI.js +1 -0
  26. package/dist/landing-handler.d.ts +3 -2
  27. package/dist/landing.d.ts +19 -5
  28. package/dist/landing.js +1 -7
  29. package/dist/listen-address.d.ts +8 -0
  30. package/dist/logging.d.ts +0 -1
  31. package/dist/mcp-proxy-NETCUGUD.js +2 -0
  32. package/dist/mcp-proxy.d.ts +158 -0
  33. package/dist/middleware/cors.d.ts +0 -1
  34. package/dist/middleware/mcp-middleware.d.ts +178 -104
  35. package/dist/mount-mcp.d.ts +0 -1
  36. package/dist/next/config.d.ts +67 -0
  37. package/dist/next/handler.d.ts +32 -0
  38. package/dist/next/index.d.ts +9 -0
  39. package/dist/next/index.js +1 -0
  40. package/dist/node-bridge.d.ts +33 -4
  41. package/dist/node-bridge.js +1 -151
  42. package/dist/node-http-unavailable.d.ts +9 -0
  43. package/dist/node-http.d.ts +2 -0
  44. package/dist/oauth/adapters.d.ts +0 -1
  45. package/dist/oauth/auth0.d.ts +24 -1
  46. package/dist/oauth/auth0.js +1 -61
  47. package/dist/oauth/better-auth.d.ts +23 -1
  48. package/dist/oauth/better-auth.js +1 -76
  49. package/dist/oauth/clerk.d.ts +30 -3
  50. package/dist/oauth/clerk.js +1 -70
  51. package/dist/oauth/errors.d.ts +3 -0
  52. package/dist/oauth/guards.d.ts +0 -1
  53. package/dist/oauth/index.d.ts +0 -1
  54. package/dist/oauth/index.js +1 -28
  55. package/dist/oauth/internal.d.ts +0 -1
  56. package/dist/oauth/jwt.d.ts +10 -4
  57. package/dist/oauth/keycloak.d.ts +28 -1
  58. package/dist/oauth/keycloak.js +1 -94
  59. package/dist/oauth/provider.d.ts +17 -2
  60. package/dist/oauth/supabase.d.ts +38 -2
  61. package/dist/oauth/supabase.js +1 -101
  62. package/dist/oauth/workos.d.ts +27 -1
  63. package/dist/oauth/workos.js +1 -77
  64. package/dist/openapi/index.d.ts +0 -1
  65. package/dist/openapi/index.js +1 -7
  66. package/dist/openapi/types.d.ts +0 -1
  67. package/dist/prompts.d.ts +7 -4
  68. package/dist/public-route-DAQJGS6K.js +1 -0
  69. package/dist/react/components/error-boundary.d.ts +3 -1
  70. package/dist/react/components/image.d.ts +0 -1
  71. package/dist/react/components/model-context.d.ts +8 -57
  72. package/dist/react/components/theme-provider.d.ts +7 -4
  73. package/dist/react/components/view-controls.d.ts +0 -1
  74. package/dist/react/hooks/use-call-tool.d.ts +29 -12
  75. package/dist/react/hooks/use-display-mode.d.ts +0 -1
  76. package/dist/react/hooks/use-files.d.ts +0 -1
  77. package/dist/react/hooks/use-host-context.d.ts +5 -1
  78. package/dist/react/hooks/use-open-external.d.ts +0 -1
  79. package/dist/react/hooks/use-send-follow-up.d.ts +0 -1
  80. package/dist/react/hooks/use-send-size-changed.d.ts +0 -1
  81. package/dist/react/hooks/use-tool-context.d.ts +0 -1
  82. package/dist/react/hooks/use-view-state.d.ts +23 -0
  83. package/dist/react/hooks/use-view-theme.d.ts +0 -1
  84. package/dist/react/hooks/use-view-tool.d.ts +3 -4
  85. package/dist/react/index.d.ts +9 -9
  86. package/dist/react/index.js +286 -131
  87. package/dist/react/public-assets.d.ts +21 -6
  88. package/dist/react/runtime/bootstrap-view.d.ts +3 -4
  89. package/dist/react/runtime/model-context-store.d.ts +34 -69
  90. package/dist/react/runtime/view-config.d.ts +0 -1
  91. package/dist/react/runtime/view-runtime-context.d.ts +0 -1
  92. package/dist/react/runtime/view-runtime.d.ts +4 -6
  93. package/dist/react/types/file-types.d.ts +2 -1
  94. package/dist/react/types/host-types.d.ts +2 -1
  95. package/dist/react/types/register.d.ts +11 -4
  96. package/dist/react/types/result-types.d.ts +0 -1
  97. package/dist/resource-completion.d.ts +0 -1
  98. package/dist/resources.d.ts +14 -6
  99. package/dist/response-conversion.d.ts +25 -0
  100. package/dist/response-helpers.d.ts +231 -0
  101. package/dist/server.d.ts +134 -50
  102. package/dist/tools.d.ts +14 -14
  103. package/dist/usage.d.ts +14 -0
  104. package/dist/views/capabilities.d.ts +0 -1
  105. package/dist/views/constants.d.ts +1 -2
  106. package/dist/views/csp-env.d.ts +0 -1
  107. package/dist/views/document.d.ts +9 -11
  108. package/dist/views/index.d.ts +0 -1
  109. package/dist/views/origin.d.ts +0 -1
  110. package/dist/views/public-route.d.ts +5 -4
  111. package/dist/views/register.d.ts +1 -2
  112. package/dist/views/routes.d.ts +4 -3
  113. package/dist/views/types.d.ts +21 -17
  114. package/dist/views/wire.d.ts +7 -7
  115. package/dist/vite-client.d.ts +1 -0
  116. package/package.json +41 -21
  117. package/dist/.tsbuildinfo +0 -1
  118. package/dist/bin/args.d.ts +0 -61
  119. package/dist/bin/args.d.ts.map +0 -1
  120. package/dist/bin/main.d.ts +0 -32
  121. package/dist/bin/main.d.ts.map +0 -1
  122. package/dist/bin/start.d.ts +0 -40
  123. package/dist/bin/start.d.ts.map +0 -1
  124. package/dist/bin.d.ts +0 -3
  125. package/dist/bin.d.ts.map +0 -1
  126. package/dist/bin.js.map +0 -1
  127. package/dist/chunk-AATFAERC.js +0 -384
  128. package/dist/chunk-AATFAERC.js.map +0 -1
  129. package/dist/chunk-DPL7OEXC.js +0 -518
  130. package/dist/chunk-DPL7OEXC.js.map +0 -1
  131. package/dist/chunk-DQ7LE4ZA.js +0 -237
  132. package/dist/chunk-DQ7LE4ZA.js.map +0 -1
  133. package/dist/chunk-FC2Z2VFO.js +0 -99
  134. package/dist/chunk-FC2Z2VFO.js.map +0 -1
  135. package/dist/chunk-FCGJJVL2.js.map +0 -1
  136. package/dist/chunk-IG2BCCMU.js +0 -98
  137. package/dist/chunk-IG2BCCMU.js.map +0 -1
  138. package/dist/chunk-KIZ72TIK.js +0 -38
  139. package/dist/chunk-KIZ72TIK.js.map +0 -1
  140. package/dist/chunk-QUUANIE4.js +0 -125
  141. package/dist/chunk-QUUANIE4.js.map +0 -1
  142. package/dist/chunk-RQRT27Q3.js +0 -454
  143. package/dist/chunk-RQRT27Q3.js.map +0 -1
  144. package/dist/chunk-STCR3P5O.js +0 -95
  145. package/dist/chunk-STCR3P5O.js.map +0 -1
  146. package/dist/chunk-XUD22N3Y.js +0 -156
  147. package/dist/chunk-XUD22N3Y.js.map +0 -1
  148. package/dist/chunk-Z326HADF.js +0 -82
  149. package/dist/chunk-Z326HADF.js.map +0 -1
  150. package/dist/chunk-ZMIKQPSO.js +0 -151
  151. package/dist/chunk-ZMIKQPSO.js.map +0 -1
  152. package/dist/cli/build.d.ts +0 -61
  153. package/dist/cli/build.d.ts.map +0 -1
  154. package/dist/cli/dev-api.d.ts +0 -49
  155. package/dist/cli/dev-api.d.ts.map +0 -1
  156. package/dist/cli/dev.d.ts +0 -101
  157. package/dist/cli/dev.d.ts.map +0 -1
  158. package/dist/cli/entry.d.ts +0 -31
  159. package/dist/cli/entry.d.ts.map +0 -1
  160. package/dist/cli/index.d.ts +0 -17
  161. package/dist/cli/index.d.ts.map +0 -1
  162. package/dist/cli/port.d.ts +0 -30
  163. package/dist/cli/port.d.ts.map +0 -1
  164. package/dist/cli/tools-declaration.d.ts +0 -22
  165. package/dist/cli/tools-declaration.d.ts.map +0 -1
  166. package/dist/cli/tunnel.d.ts +0 -46
  167. package/dist/cli/tunnel.d.ts.map +0 -1
  168. package/dist/cli/views-bindings.d.ts +0 -30
  169. package/dist/cli/views-bindings.d.ts.map +0 -1
  170. package/dist/cli/views-plugin.d.ts +0 -47
  171. package/dist/cli/views-plugin.d.ts.map +0 -1
  172. package/dist/cli/views.d.ts +0 -75
  173. package/dist/cli/views.d.ts.map +0 -1
  174. package/dist/cli/vite-config.d.ts +0 -21
  175. package/dist/cli/vite-config.d.ts.map +0 -1
  176. package/dist/cli/workspace.d.ts +0 -107
  177. package/dist/cli/workspace.d.ts.map +0 -1
  178. package/dist/commands/build.d.ts +0 -8
  179. package/dist/commands/build.d.ts.map +0 -1
  180. package/dist/commands/build.js +0 -370
  181. package/dist/commands/build.js.map +0 -1
  182. package/dist/commands/client.d.ts +0 -22
  183. package/dist/commands/client.d.ts.map +0 -1
  184. package/dist/commands/client.js +0 -14
  185. package/dist/commands/client.js.map +0 -1
  186. package/dist/commands/cloud-api.d.ts +0 -70
  187. package/dist/commands/cloud-api.d.ts.map +0 -1
  188. package/dist/commands/deploy.d.ts +0 -3
  189. package/dist/commands/deploy.d.ts.map +0 -1
  190. package/dist/commands/deploy.js +0 -242
  191. package/dist/commands/deploy.js.map +0 -1
  192. package/dist/commands/deployments.d.ts +0 -3
  193. package/dist/commands/deployments.d.ts.map +0 -1
  194. package/dist/commands/deployments.js +0 -213
  195. package/dist/commands/deployments.js.map +0 -1
  196. package/dist/commands/dev.d.ts +0 -8
  197. package/dist/commands/dev.d.ts.map +0 -1
  198. package/dist/commands/dev.js +0 -656
  199. package/dist/commands/dev.js.map +0 -1
  200. package/dist/commands/identity.d.ts +0 -3
  201. package/dist/commands/identity.d.ts.map +0 -1
  202. package/dist/commands/identity.js +0 -192
  203. package/dist/commands/identity.js.map +0 -1
  204. package/dist/commands/load-client.d.ts +0 -11
  205. package/dist/commands/load-client.d.ts.map +0 -1
  206. package/dist/commands/organizations.d.ts +0 -3
  207. package/dist/commands/organizations.d.ts.map +0 -1
  208. package/dist/commands/organizations.js +0 -97
  209. package/dist/commands/organizations.js.map +0 -1
  210. package/dist/commands/screenshot.d.ts +0 -3
  211. package/dist/commands/screenshot.d.ts.map +0 -1
  212. package/dist/commands/screenshot.js +0 -463
  213. package/dist/commands/screenshot.js.map +0 -1
  214. package/dist/commands/servers.d.ts +0 -3
  215. package/dist/commands/servers.d.ts.map +0 -1
  216. package/dist/commands/servers.js +0 -278
  217. package/dist/commands/servers.js.map +0 -1
  218. package/dist/commands/shared.d.ts +0 -44
  219. package/dist/commands/shared.d.ts.map +0 -1
  220. package/dist/commands/skills.d.ts +0 -3
  221. package/dist/commands/skills.d.ts.map +0 -1
  222. package/dist/commands/skills.js +0 -84
  223. package/dist/commands/skills.js.map +0 -1
  224. package/dist/commands/start.d.ts +0 -8
  225. package/dist/commands/start.d.ts.map +0 -1
  226. package/dist/commands/start.js +0 -72
  227. package/dist/commands/start.js.map +0 -1
  228. package/dist/completable.d.ts.map +0 -1
  229. package/dist/config.d.ts.map +0 -1
  230. package/dist/context.d.ts.map +0 -1
  231. package/dist/fetch-app.d.ts.map +0 -1
  232. package/dist/index.d.ts.map +0 -1
  233. package/dist/index.js.map +0 -1
  234. package/dist/inspector-shell.d.ts +0 -87
  235. package/dist/inspector-shell.d.ts.map +0 -1
  236. package/dist/internal/resource-completion.js.map +0 -1
  237. package/dist/landing-handler-VQRYCQOV.js +0 -31
  238. package/dist/landing-handler-VQRYCQOV.js.map +0 -1
  239. package/dist/landing-handler.d.ts.map +0 -1
  240. package/dist/landing.d.ts.map +0 -1
  241. package/dist/landing.js.map +0 -1
  242. package/dist/logging.d.ts.map +0 -1
  243. package/dist/middleware/cors.d.ts.map +0 -1
  244. package/dist/middleware/mcp-middleware.d.ts.map +0 -1
  245. package/dist/mount-mcp.d.ts.map +0 -1
  246. package/dist/node-bridge.d.ts.map +0 -1
  247. package/dist/node-bridge.js.map +0 -1
  248. package/dist/oauth/adapters.d.ts.map +0 -1
  249. package/dist/oauth/auth0.d.ts.map +0 -1
  250. package/dist/oauth/auth0.js.map +0 -1
  251. package/dist/oauth/better-auth.d.ts.map +0 -1
  252. package/dist/oauth/better-auth.js.map +0 -1
  253. package/dist/oauth/clerk.d.ts.map +0 -1
  254. package/dist/oauth/clerk.js.map +0 -1
  255. package/dist/oauth/guards.d.ts.map +0 -1
  256. package/dist/oauth/index.d.ts.map +0 -1
  257. package/dist/oauth/index.js.map +0 -1
  258. package/dist/oauth/internal.d.ts.map +0 -1
  259. package/dist/oauth/jwt.d.ts.map +0 -1
  260. package/dist/oauth/keycloak.d.ts.map +0 -1
  261. package/dist/oauth/keycloak.js.map +0 -1
  262. package/dist/oauth/provider.d.ts.map +0 -1
  263. package/dist/oauth/supabase.d.ts.map +0 -1
  264. package/dist/oauth/supabase.js.map +0 -1
  265. package/dist/oauth/workos.d.ts.map +0 -1
  266. package/dist/oauth/workos.js.map +0 -1
  267. package/dist/openapi/index.d.ts.map +0 -1
  268. package/dist/openapi/index.js.map +0 -1
  269. package/dist/openapi/types.d.ts.map +0 -1
  270. package/dist/prompts.d.ts.map +0 -1
  271. package/dist/public-route-26FUVRO5.js +0 -62
  272. package/dist/public-route-26FUVRO5.js.map +0 -1
  273. package/dist/react/components/error-boundary.d.ts.map +0 -1
  274. package/dist/react/components/image.d.ts.map +0 -1
  275. package/dist/react/components/model-context.d.ts.map +0 -1
  276. package/dist/react/components/theme-provider.d.ts.map +0 -1
  277. package/dist/react/components/view-controls.d.ts.map +0 -1
  278. package/dist/react/hooks/use-call-tool.d.ts.map +0 -1
  279. package/dist/react/hooks/use-display-mode.d.ts.map +0 -1
  280. package/dist/react/hooks/use-files.d.ts.map +0 -1
  281. package/dist/react/hooks/use-host-context.d.ts.map +0 -1
  282. package/dist/react/hooks/use-open-external.d.ts.map +0 -1
  283. package/dist/react/hooks/use-send-follow-up.d.ts.map +0 -1
  284. package/dist/react/hooks/use-send-size-changed.d.ts.map +0 -1
  285. package/dist/react/hooks/use-tool-context.d.ts.map +0 -1
  286. package/dist/react/hooks/use-view-theme.d.ts.map +0 -1
  287. package/dist/react/hooks/use-view-tool.d.ts.map +0 -1
  288. package/dist/react/index.d.ts.map +0 -1
  289. package/dist/react/index.js.map +0 -1
  290. package/dist/react/public-assets.d.ts.map +0 -1
  291. package/dist/react/runtime/bootstrap-view.d.ts.map +0 -1
  292. package/dist/react/runtime/model-context-store.d.ts.map +0 -1
  293. package/dist/react/runtime/view-config.d.ts.map +0 -1
  294. package/dist/react/runtime/view-runtime-context.d.ts.map +0 -1
  295. package/dist/react/runtime/view-runtime.d.ts.map +0 -1
  296. package/dist/react/types/file-types.d.ts.map +0 -1
  297. package/dist/react/types/host-types.d.ts.map +0 -1
  298. package/dist/react/types/register.d.ts.map +0 -1
  299. package/dist/react/types/result-types.d.ts.map +0 -1
  300. package/dist/resource-completion.d.ts.map +0 -1
  301. package/dist/resources.d.ts.map +0 -1
  302. package/dist/server.d.ts.map +0 -1
  303. package/dist/tools.d.ts.map +0 -1
  304. package/dist/views/capabilities.d.ts.map +0 -1
  305. package/dist/views/constants.d.ts.map +0 -1
  306. package/dist/views/csp-env.d.ts.map +0 -1
  307. package/dist/views/document.d.ts.map +0 -1
  308. package/dist/views/index.d.ts.map +0 -1
  309. package/dist/views/origin.d.ts.map +0 -1
  310. package/dist/views/public-route.d.ts.map +0 -1
  311. package/dist/views/register.d.ts.map +0 -1
  312. package/dist/views/routes.d.ts.map +0 -1
  313. package/dist/views/types.d.ts.map +0 -1
  314. package/dist/views/wire.d.ts.map +0 -1
  315. package/node_modules/@modelcontextprotocol/client/LICENSE +0 -216
  316. package/node_modules/@modelcontextprotocol/client/README.md +0 -26
  317. package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-Asx17_Co.mjs +0 -7069
  318. package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-Asx17_Co.mjs.map +0 -1
  319. package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-B7GnTXYx.d.mts +0 -1054
  320. package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-B7GnTXYx.d.mts.map +0 -1
  321. package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-B_4czhCS.d.cts +0 -1054
  322. package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-B_4czhCS.d.cts.map +0 -1
  323. package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-DNzBrkxq.cjs +0 -7086
  324. package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-DNzBrkxq.cjs.map +0 -1
  325. package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-D9GAttn8.d.cts +0 -59
  326. package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-D9GAttn8.d.cts.map +0 -1
  327. package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-DbU8BxXO.mjs +0 -970
  328. package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-DbU8BxXO.mjs.map +0 -1
  329. package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-Djgwc46-.cjs +0 -976
  330. package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-Djgwc46-.cjs.map +0 -1
  331. package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-Xtj52JOa.d.mts +0 -59
  332. package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-Xtj52JOa.d.mts.map +0 -1
  333. package/node_modules/@modelcontextprotocol/client/dist/chunk-Bnu9O96Y.cjs +0 -60
  334. package/node_modules/@modelcontextprotocol/client/dist/chunk-Br0eD_fh.mjs +0 -42
  335. package/node_modules/@modelcontextprotocol/client/dist/index-ZagFkUbt.d.mts +0 -2675
  336. package/node_modules/@modelcontextprotocol/client/dist/index-ZagFkUbt.d.mts.map +0 -1
  337. package/node_modules/@modelcontextprotocol/client/dist/index-gN3EXmil.d.cts +0 -2678
  338. package/node_modules/@modelcontextprotocol/client/dist/index-gN3EXmil.d.cts.map +0 -1
  339. package/node_modules/@modelcontextprotocol/client/dist/index.cjs +0 -5427
  340. package/node_modules/@modelcontextprotocol/client/dist/index.cjs.map +0 -1
  341. package/node_modules/@modelcontextprotocol/client/dist/index.d.cts +0 -3196
  342. package/node_modules/@modelcontextprotocol/client/dist/index.d.cts.map +0 -1
  343. package/node_modules/@modelcontextprotocol/client/dist/index.d.mts +0 -3196
  344. package/node_modules/@modelcontextprotocol/client/dist/index.d.mts.map +0 -1
  345. package/node_modules/@modelcontextprotocol/client/dist/index.mjs +0 -5224
  346. package/node_modules/@modelcontextprotocol/client/dist/index.mjs.map +0 -1
  347. package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.cjs +0 -14
  348. package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.cjs.map +0 -1
  349. package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.d.cts +0 -13
  350. package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.d.cts.map +0 -1
  351. package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.d.mts +0 -13
  352. package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.d.mts.map +0 -1
  353. package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.mjs +0 -13
  354. package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.mjs.map +0 -1
  355. package/node_modules/@modelcontextprotocol/client/dist/shimsNode.cjs +0 -14
  356. package/node_modules/@modelcontextprotocol/client/dist/shimsNode.cjs.map +0 -1
  357. package/node_modules/@modelcontextprotocol/client/dist/shimsNode.d.cts +0 -13
  358. package/node_modules/@modelcontextprotocol/client/dist/shimsNode.d.cts.map +0 -1
  359. package/node_modules/@modelcontextprotocol/client/dist/shimsNode.d.mts +0 -13
  360. package/node_modules/@modelcontextprotocol/client/dist/shimsNode.d.mts.map +0 -1
  361. package/node_modules/@modelcontextprotocol/client/dist/shimsNode.mjs +0 -13
  362. package/node_modules/@modelcontextprotocol/client/dist/shimsNode.mjs.map +0 -1
  363. package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.cjs +0 -21
  364. package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.cjs.map +0 -1
  365. package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.d.cts +0 -13
  366. package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.d.cts.map +0 -1
  367. package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.d.mts +0 -13
  368. package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.d.mts.map +0 -1
  369. package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.mjs +0 -20
  370. package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.mjs.map +0 -1
  371. package/node_modules/@modelcontextprotocol/client/dist/src-BzzZSQyL.cjs +0 -7331
  372. package/node_modules/@modelcontextprotocol/client/dist/src-BzzZSQyL.cjs.map +0 -1
  373. package/node_modules/@modelcontextprotocol/client/dist/src-DGeA9On3.mjs +0 -6963
  374. package/node_modules/@modelcontextprotocol/client/dist/src-DGeA9On3.mjs.map +0 -1
  375. package/node_modules/@modelcontextprotocol/client/dist/stdio.cjs +0 -181
  376. package/node_modules/@modelcontextprotocol/client/dist/stdio.cjs.map +0 -1
  377. package/node_modules/@modelcontextprotocol/client/dist/stdio.d.cts +0 -87
  378. package/node_modules/@modelcontextprotocol/client/dist/stdio.d.cts.map +0 -1
  379. package/node_modules/@modelcontextprotocol/client/dist/stdio.d.mts +0 -87
  380. package/node_modules/@modelcontextprotocol/client/dist/stdio.d.mts.map +0 -1
  381. package/node_modules/@modelcontextprotocol/client/dist/stdio.mjs +0 -176
  382. package/node_modules/@modelcontextprotocol/client/dist/stdio.mjs.map +0 -1
  383. package/node_modules/@modelcontextprotocol/client/dist/types-BDNQEPSs.d.mts +0 -1099
  384. package/node_modules/@modelcontextprotocol/client/dist/types-BDNQEPSs.d.mts.map +0 -1
  385. package/node_modules/@modelcontextprotocol/client/dist/types-DsbMXNFL.d.cts +0 -1099
  386. package/node_modules/@modelcontextprotocol/client/dist/types-DsbMXNFL.d.cts.map +0 -1
  387. package/node_modules/@modelcontextprotocol/client/dist/validators/ajv.cjs +0 -5
  388. package/node_modules/@modelcontextprotocol/client/dist/validators/ajv.d.cts +0 -2
  389. package/node_modules/@modelcontextprotocol/client/dist/validators/ajv.d.mts +0 -2
  390. package/node_modules/@modelcontextprotocol/client/dist/validators/ajv.mjs +0 -3
  391. package/node_modules/@modelcontextprotocol/client/dist/validators/cfWorker.cjs +0 -3
  392. package/node_modules/@modelcontextprotocol/client/dist/validators/cfWorker.d.cts +0 -2
  393. package/node_modules/@modelcontextprotocol/client/dist/validators/cfWorker.d.mts +0 -2
  394. package/node_modules/@modelcontextprotocol/client/dist/validators/cfWorker.mjs +0 -3
  395. package/node_modules/@modelcontextprotocol/client/package.json +0 -166
  396. package/node_modules/@modelcontextprotocol/core/LICENSE +0 -216
  397. package/node_modules/@modelcontextprotocol/core/README.md +0 -40
  398. package/node_modules/@modelcontextprotocol/core/dist/auth-BUWfrB3C.d.cts +0 -8198
  399. package/node_modules/@modelcontextprotocol/core/dist/auth-BUWfrB3C.d.cts.map +0 -1
  400. package/node_modules/@modelcontextprotocol/core/dist/auth-CEFpHq32.cjs +0 -2862
  401. package/node_modules/@modelcontextprotocol/core/dist/auth-CEFpHq32.cjs.map +0 -1
  402. package/node_modules/@modelcontextprotocol/core/dist/auth-CNbu4K4a.d.mts +0 -8198
  403. package/node_modules/@modelcontextprotocol/core/dist/auth-CNbu4K4a.d.mts.map +0 -1
  404. package/node_modules/@modelcontextprotocol/core/dist/auth-DFgbUATV.mjs +0 -1653
  405. package/node_modules/@modelcontextprotocol/core/dist/auth-DFgbUATV.mjs.map +0 -1
  406. package/node_modules/@modelcontextprotocol/core/dist/index.cjs +0 -174
  407. package/node_modules/@modelcontextprotocol/core/dist/index.d.cts +0 -2
  408. package/node_modules/@modelcontextprotocol/core/dist/index.d.mts +0 -2
  409. package/node_modules/@modelcontextprotocol/core/dist/index.mjs +0 -3
  410. package/node_modules/@modelcontextprotocol/core/dist/internal.cjs +0 -199
  411. package/node_modules/@modelcontextprotocol/core/dist/internal.d.cts +0 -87
  412. package/node_modules/@modelcontextprotocol/core/dist/internal.d.cts.map +0 -1
  413. package/node_modules/@modelcontextprotocol/core/dist/internal.d.mts +0 -87
  414. package/node_modules/@modelcontextprotocol/core/dist/internal.d.mts.map +0 -1
  415. package/node_modules/@modelcontextprotocol/core/dist/internal.mjs +0 -3
  416. package/node_modules/@modelcontextprotocol/core/package.json +0 -85
  417. package/node_modules/jose/LICENSE.md +0 -21
  418. package/node_modules/jose/README.md +0 -153
  419. package/node_modules/jose/dist/types/index.d.ts +0 -55
  420. package/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +0 -31
  421. package/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +0 -65
  422. package/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +0 -31
  423. package/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +0 -83
  424. package/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +0 -31
  425. package/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +0 -74
  426. package/node_modules/jose/dist/types/jwk/embedded.d.ts +0 -17
  427. package/node_modules/jose/dist/types/jwk/thumbprint.d.ts +0 -32
  428. package/node_modules/jose/dist/types/jwks/local.d.ts +0 -29
  429. package/node_modules/jose/dist/types/jwks/remote.d.ts +0 -237
  430. package/node_modules/jose/dist/types/jws/compact/sign.d.ts +0 -36
  431. package/node_modules/jose/dist/types/jws/compact/verify.d.ts +0 -33
  432. package/node_modules/jose/dist/types/jws/flattened/sign.d.ts +0 -42
  433. package/node_modules/jose/dist/types/jws/flattened/verify.d.ts +0 -33
  434. package/node_modules/jose/dist/types/jws/general/sign.d.ts +0 -53
  435. package/node_modules/jose/dist/types/jws/general/verify.d.ts +0 -33
  436. package/node_modules/jose/dist/types/jwt/decrypt.d.ts +0 -35
  437. package/node_modules/jose/dist/types/jwt/encrypt.d.ts +0 -91
  438. package/node_modules/jose/dist/types/jwt/sign.d.ts +0 -43
  439. package/node_modules/jose/dist/types/jwt/unsecured.d.ts +0 -43
  440. package/node_modules/jose/dist/types/jwt/verify.d.ts +0 -37
  441. package/node_modules/jose/dist/types/key/export.d.ts +0 -33
  442. package/node_modules/jose/dist/types/key/generate_key_pair.d.ts +0 -47
  443. package/node_modules/jose/dist/types/key/generate_secret.d.ts +0 -35
  444. package/node_modules/jose/dist/types/key/import.d.ts +0 -83
  445. package/node_modules/jose/dist/types/types.d.ts +0 -841
  446. package/node_modules/jose/dist/types/util/base64url.d.ts +0 -9
  447. package/node_modules/jose/dist/types/util/decode_jwt.d.ts +0 -18
  448. package/node_modules/jose/dist/types/util/decode_protected_header.d.ts +0 -17
  449. package/node_modules/jose/dist/types/util/errors.d.ts +0 -213
  450. package/node_modules/jose/dist/webapi/index.js +0 -32
  451. package/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +0 -27
  452. package/node_modules/jose/dist/webapi/jwe/compact/encrypt.js +0 -27
  453. package/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +0 -165
  454. package/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +0 -169
  455. package/node_modules/jose/dist/webapi/jwe/general/decrypt.js +0 -31
  456. package/node_modules/jose/dist/webapi/jwe/general/encrypt.js +0 -187
  457. package/node_modules/jose/dist/webapi/jwk/embedded.js +0 -17
  458. package/node_modules/jose/dist/webapi/jwk/thumbprint.js +0 -68
  459. package/node_modules/jose/dist/webapi/jwks/local.js +0 -119
  460. package/node_modules/jose/dist/webapi/jwks/remote.js +0 -179
  461. package/node_modules/jose/dist/webapi/jws/compact/sign.js +0 -18
  462. package/node_modules/jose/dist/webapi/jws/compact/verify.js +0 -21
  463. package/node_modules/jose/dist/webapi/jws/flattened/sign.js +0 -92
  464. package/node_modules/jose/dist/webapi/jws/flattened/verify.js +0 -120
  465. package/node_modules/jose/dist/webapi/jws/general/sign.js +0 -73
  466. package/node_modules/jose/dist/webapi/jws/general/verify.js +0 -24
  467. package/node_modules/jose/dist/webapi/jwt/decrypt.js +0 -23
  468. package/node_modules/jose/dist/webapi/jwt/encrypt.js +0 -108
  469. package/node_modules/jose/dist/webapi/jwt/sign.js +0 -52
  470. package/node_modules/jose/dist/webapi/jwt/unsecured.js +0 -63
  471. package/node_modules/jose/dist/webapi/jwt/verify.js +0 -15
  472. package/node_modules/jose/dist/webapi/key/export.js +0 -11
  473. package/node_modules/jose/dist/webapi/key/generate_key_pair.js +0 -97
  474. package/node_modules/jose/dist/webapi/key/generate_secret.js +0 -40
  475. package/node_modules/jose/dist/webapi/key/import.js +0 -57
  476. package/node_modules/jose/dist/webapi/lib/aesgcmkw.js +0 -16
  477. package/node_modules/jose/dist/webapi/lib/aeskw.js +0 -25
  478. package/node_modules/jose/dist/webapi/lib/asn1.js +0 -243
  479. package/node_modules/jose/dist/webapi/lib/base64.js +0 -22
  480. package/node_modules/jose/dist/webapi/lib/buffer_utils.js +0 -43
  481. package/node_modules/jose/dist/webapi/lib/cek.js +0 -19
  482. package/node_modules/jose/dist/webapi/lib/check_cek_length.js +0 -7
  483. package/node_modules/jose/dist/webapi/lib/check_iv_length.js +0 -7
  484. package/node_modules/jose/dist/webapi/lib/check_key_length.js +0 -8
  485. package/node_modules/jose/dist/webapi/lib/check_key_type.js +0 -122
  486. package/node_modules/jose/dist/webapi/lib/crypto_key.js +0 -143
  487. package/node_modules/jose/dist/webapi/lib/decrypt.js +0 -106
  488. package/node_modules/jose/dist/webapi/lib/decrypt_key_management.js +0 -127
  489. package/node_modules/jose/dist/webapi/lib/digest.js +0 -4
  490. package/node_modules/jose/dist/webapi/lib/ecdhes.js +0 -52
  491. package/node_modules/jose/dist/webapi/lib/encrypt.js +0 -74
  492. package/node_modules/jose/dist/webapi/lib/encrypt_key_management.js +0 -92
  493. package/node_modules/jose/dist/webapi/lib/get_sign_verify_key.js +0 -12
  494. package/node_modules/jose/dist/webapi/lib/invalid_key_input.js +0 -27
  495. package/node_modules/jose/dist/webapi/lib/is_disjoint.js +0 -21
  496. package/node_modules/jose/dist/webapi/lib/is_jwk.js +0 -6
  497. package/node_modules/jose/dist/webapi/lib/is_key_like.js +0 -17
  498. package/node_modules/jose/dist/webapi/lib/is_object.js +0 -14
  499. package/node_modules/jose/dist/webapi/lib/iv.js +0 -19
  500. package/node_modules/jose/dist/webapi/lib/jwk_to_key.js +0 -109
  501. package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +0 -238
  502. package/node_modules/jose/dist/webapi/lib/key_to_jwk.js +0 -31
  503. package/node_modules/jose/dist/webapi/lib/normalize_key.js +0 -176
  504. package/node_modules/jose/dist/webapi/lib/pbes2kw.js +0 -39
  505. package/node_modules/jose/dist/webapi/lib/private_symbols.js +0 -1
  506. package/node_modules/jose/dist/webapi/lib/rsaes.js +0 -24
  507. package/node_modules/jose/dist/webapi/lib/sign.js +0 -9
  508. package/node_modules/jose/dist/webapi/lib/subtle_dsa.js +0 -31
  509. package/node_modules/jose/dist/webapi/lib/validate_algorithms.js +0 -10
  510. package/node_modules/jose/dist/webapi/lib/validate_crit.js +0 -33
  511. package/node_modules/jose/dist/webapi/lib/verify.js +0 -14
  512. package/node_modules/jose/dist/webapi/util/base64url.js +0 -30
  513. package/node_modules/jose/dist/webapi/util/decode_jwt.js +0 -32
  514. package/node_modules/jose/dist/webapi/util/decode_protected_header.js +0 -34
  515. package/node_modules/jose/dist/webapi/util/errors.js +0 -99
  516. package/node_modules/jose/package.json +0 -200
  517. package/node_modules/zod/LICENSE +0 -21
  518. package/node_modules/zod/README.md +0 -191
  519. package/node_modules/zod/index.cjs +0 -33
  520. package/node_modules/zod/index.d.cts +0 -4
  521. package/node_modules/zod/index.d.ts +0 -4
  522. package/node_modules/zod/index.js +0 -4
  523. package/node_modules/zod/locales/index.cjs +0 -17
  524. package/node_modules/zod/locales/index.d.cts +0 -1
  525. package/node_modules/zod/locales/index.d.ts +0 -1
  526. package/node_modules/zod/locales/index.js +0 -1
  527. package/node_modules/zod/locales/package.json +0 -7
  528. package/node_modules/zod/mini/index.cjs +0 -32
  529. package/node_modules/zod/mini/index.d.cts +0 -3
  530. package/node_modules/zod/mini/index.d.ts +0 -3
  531. package/node_modules/zod/mini/index.js +0 -3
  532. package/node_modules/zod/mini/package.json +0 -7
  533. package/node_modules/zod/package.json +0 -135
  534. package/node_modules/zod/src/index.ts +0 -4
  535. package/node_modules/zod/src/locales/index.ts +0 -1
  536. package/node_modules/zod/src/mini/index.ts +0 -3
  537. package/node_modules/zod/src/v3/ZodError.ts +0 -330
  538. package/node_modules/zod/src/v3/benchmarks/datetime.ts +0 -58
  539. package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +0 -80
  540. package/node_modules/zod/src/v3/benchmarks/index.ts +0 -59
  541. package/node_modules/zod/src/v3/benchmarks/ipv4.ts +0 -57
  542. package/node_modules/zod/src/v3/benchmarks/object.ts +0 -69
  543. package/node_modules/zod/src/v3/benchmarks/primitives.ts +0 -162
  544. package/node_modules/zod/src/v3/benchmarks/realworld.ts +0 -63
  545. package/node_modules/zod/src/v3/benchmarks/string.ts +0 -55
  546. package/node_modules/zod/src/v3/benchmarks/union.ts +0 -80
  547. package/node_modules/zod/src/v3/errors.ts +0 -13
  548. package/node_modules/zod/src/v3/external.ts +0 -6
  549. package/node_modules/zod/src/v3/helpers/enumUtil.ts +0 -17
  550. package/node_modules/zod/src/v3/helpers/errorUtil.ts +0 -8
  551. package/node_modules/zod/src/v3/helpers/parseUtil.ts +0 -176
  552. package/node_modules/zod/src/v3/helpers/partialUtil.ts +0 -34
  553. package/node_modules/zod/src/v3/helpers/typeAliases.ts +0 -2
  554. package/node_modules/zod/src/v3/helpers/util.ts +0 -224
  555. package/node_modules/zod/src/v3/index.ts +0 -4
  556. package/node_modules/zod/src/v3/locales/en.ts +0 -124
  557. package/node_modules/zod/src/v3/standard-schema.ts +0 -113
  558. package/node_modules/zod/src/v3/tests/Mocker.ts +0 -54
  559. package/node_modules/zod/src/v3/tests/all-errors.test.ts +0 -157
  560. package/node_modules/zod/src/v3/tests/anyunknown.test.ts +0 -28
  561. package/node_modules/zod/src/v3/tests/array.test.ts +0 -71
  562. package/node_modules/zod/src/v3/tests/async-parsing.test.ts +0 -388
  563. package/node_modules/zod/src/v3/tests/async-refinements.test.ts +0 -46
  564. package/node_modules/zod/src/v3/tests/base.test.ts +0 -29
  565. package/node_modules/zod/src/v3/tests/bigint.test.ts +0 -55
  566. package/node_modules/zod/src/v3/tests/branded.test.ts +0 -53
  567. package/node_modules/zod/src/v3/tests/catch.test.ts +0 -220
  568. package/node_modules/zod/src/v3/tests/coerce.test.ts +0 -133
  569. package/node_modules/zod/src/v3/tests/complex.test.ts +0 -70
  570. package/node_modules/zod/src/v3/tests/custom.test.ts +0 -31
  571. package/node_modules/zod/src/v3/tests/date.test.ts +0 -32
  572. package/node_modules/zod/src/v3/tests/deepmasking.test.ts +0 -186
  573. package/node_modules/zod/src/v3/tests/default.test.ts +0 -112
  574. package/node_modules/zod/src/v3/tests/description.test.ts +0 -33
  575. package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +0 -315
  576. package/node_modules/zod/src/v3/tests/enum.test.ts +0 -80
  577. package/node_modules/zod/src/v3/tests/error.test.ts +0 -551
  578. package/node_modules/zod/src/v3/tests/firstparty.test.ts +0 -87
  579. package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +0 -21
  580. package/node_modules/zod/src/v3/tests/function.test.ts +0 -261
  581. package/node_modules/zod/src/v3/tests/generics.test.ts +0 -48
  582. package/node_modules/zod/src/v3/tests/instanceof.test.ts +0 -37
  583. package/node_modules/zod/src/v3/tests/intersection.test.ts +0 -110
  584. package/node_modules/zod/src/v3/tests/language-server.source.ts +0 -76
  585. package/node_modules/zod/src/v3/tests/language-server.test.ts +0 -207
  586. package/node_modules/zod/src/v3/tests/literal.test.ts +0 -36
  587. package/node_modules/zod/src/v3/tests/map.test.ts +0 -110
  588. package/node_modules/zod/src/v3/tests/masking.test.ts +0 -4
  589. package/node_modules/zod/src/v3/tests/mocker.test.ts +0 -19
  590. package/node_modules/zod/src/v3/tests/nan.test.ts +0 -24
  591. package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +0 -87
  592. package/node_modules/zod/src/v3/tests/nullable.test.ts +0 -42
  593. package/node_modules/zod/src/v3/tests/number.test.ts +0 -176
  594. package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +0 -29
  595. package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +0 -29
  596. package/node_modules/zod/src/v3/tests/object.test.ts +0 -434
  597. package/node_modules/zod/src/v3/tests/optional.test.ts +0 -42
  598. package/node_modules/zod/src/v3/tests/parseUtil.test.ts +0 -23
  599. package/node_modules/zod/src/v3/tests/parser.test.ts +0 -41
  600. package/node_modules/zod/src/v3/tests/partials.test.ts +0 -243
  601. package/node_modules/zod/src/v3/tests/pickomit.test.ts +0 -111
  602. package/node_modules/zod/src/v3/tests/pipeline.test.ts +0 -29
  603. package/node_modules/zod/src/v3/tests/preprocess.test.ts +0 -186
  604. package/node_modules/zod/src/v3/tests/primitive.test.ts +0 -440
  605. package/node_modules/zod/src/v3/tests/promise.test.ts +0 -90
  606. package/node_modules/zod/src/v3/tests/readonly.test.ts +0 -194
  607. package/node_modules/zod/src/v3/tests/record.test.ts +0 -171
  608. package/node_modules/zod/src/v3/tests/recursive.test.ts +0 -197
  609. package/node_modules/zod/src/v3/tests/refine.test.ts +0 -313
  610. package/node_modules/zod/src/v3/tests/safeparse.test.ts +0 -27
  611. package/node_modules/zod/src/v3/tests/set.test.ts +0 -142
  612. package/node_modules/zod/src/v3/tests/standard-schema.test.ts +0 -83
  613. package/node_modules/zod/src/v3/tests/string.test.ts +0 -916
  614. package/node_modules/zod/src/v3/tests/transformer.test.ts +0 -233
  615. package/node_modules/zod/src/v3/tests/tuple.test.ts +0 -90
  616. package/node_modules/zod/src/v3/tests/unions.test.ts +0 -57
  617. package/node_modules/zod/src/v3/tests/validations.test.ts +0 -133
  618. package/node_modules/zod/src/v3/tests/void.test.ts +0 -15
  619. package/node_modules/zod/src/v3/types.ts +0 -5138
  620. package/node_modules/zod/src/v4/classic/checks.ts +0 -32
  621. package/node_modules/zod/src/v4/classic/coerce.ts +0 -27
  622. package/node_modules/zod/src/v4/classic/compat.ts +0 -70
  623. package/node_modules/zod/src/v4/classic/errors.ts +0 -82
  624. package/node_modules/zod/src/v4/classic/external.ts +0 -52
  625. package/node_modules/zod/src/v4/classic/from-json-schema.ts +0 -659
  626. package/node_modules/zod/src/v4/classic/index.ts +0 -5
  627. package/node_modules/zod/src/v4/classic/iso.ts +0 -90
  628. package/node_modules/zod/src/v4/classic/parse.ts +0 -82
  629. package/node_modules/zod/src/v4/classic/schemas.ts +0 -2672
  630. package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +0 -26
  631. package/node_modules/zod/src/v4/classic/tests/apply.test.ts +0 -59
  632. package/node_modules/zod/src/v4/classic/tests/array.test.ts +0 -264
  633. package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +0 -216
  634. package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +0 -381
  635. package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +0 -68
  636. package/node_modules/zod/src/v4/classic/tests/base.test.ts +0 -7
  637. package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +0 -54
  638. package/node_modules/zod/src/v4/classic/tests/brand.test.ts +0 -106
  639. package/node_modules/zod/src/v4/classic/tests/catch.test.ts +0 -326
  640. package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +0 -20
  641. package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +0 -573
  642. package/node_modules/zod/src/v4/classic/tests/codec.test.ts +0 -703
  643. package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +0 -160
  644. package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +0 -374
  645. package/node_modules/zod/src/v4/classic/tests/custom.test.ts +0 -40
  646. package/node_modules/zod/src/v4/classic/tests/date.test.ts +0 -62
  647. package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +0 -302
  648. package/node_modules/zod/src/v4/classic/tests/default.test.ts +0 -409
  649. package/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +0 -27
  650. package/node_modules/zod/src/v4/classic/tests/description.test.ts +0 -32
  651. package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +0 -197
  652. package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +0 -694
  653. package/node_modules/zod/src/v4/classic/tests/enum.test.ts +0 -285
  654. package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +0 -807
  655. package/node_modules/zod/src/v4/classic/tests/error.test.ts +0 -711
  656. package/node_modules/zod/src/v4/classic/tests/file.test.ts +0 -96
  657. package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +0 -179
  658. package/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +0 -26
  659. package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +0 -895
  660. package/node_modules/zod/src/v4/classic/tests/function.test.ts +0 -360
  661. package/node_modules/zod/src/v4/classic/tests/generics.test.ts +0 -72
  662. package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +0 -39
  663. package/node_modules/zod/src/v4/classic/tests/hash.test.ts +0 -68
  664. package/node_modules/zod/src/v4/classic/tests/index.test.ts +0 -939
  665. package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +0 -60
  666. package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +0 -198
  667. package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +0 -46
  668. package/node_modules/zod/src/v4/classic/tests/json.test.ts +0 -109
  669. package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +0 -227
  670. package/node_modules/zod/src/v4/classic/tests/literal.test.ts +0 -117
  671. package/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +0 -29
  672. package/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +0 -24
  673. package/node_modules/zod/src/v4/classic/tests/map.test.ts +0 -330
  674. package/node_modules/zod/src/v4/classic/tests/nan.test.ts +0 -21
  675. package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +0 -168
  676. package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +0 -101
  677. package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +0 -22
  678. package/node_modules/zod/src/v4/classic/tests/number.test.ts +0 -325
  679. package/node_modules/zod/src/v4/classic/tests/object.test.ts +0 -717
  680. package/node_modules/zod/src/v4/classic/tests/optional.test.ts +0 -333
  681. package/node_modules/zod/src/v4/classic/tests/partial.test.ts +0 -450
  682. package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +0 -211
  683. package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +0 -101
  684. package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +0 -74
  685. package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +0 -26
  686. package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +0 -351
  687. package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +0 -175
  688. package/node_modules/zod/src/v4/classic/tests/promise.test.ts +0 -81
  689. package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +0 -23
  690. package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +0 -252
  691. package/node_modules/zod/src/v4/classic/tests/record.test.ts +0 -717
  692. package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +0 -631
  693. package/node_modules/zod/src/v4/classic/tests/refine.test.ts +0 -633
  694. package/node_modules/zod/src/v4/classic/tests/registries.test.ts +0 -243
  695. package/node_modules/zod/src/v4/classic/tests/set.test.ts +0 -181
  696. package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +0 -134
  697. package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +0 -125
  698. package/node_modules/zod/src/v4/classic/tests/string.test.ts +0 -1224
  699. package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +0 -106
  700. package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +0 -771
  701. package/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +0 -438
  702. package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +0 -3125
  703. package/node_modules/zod/src/v4/classic/tests/transform.test.ts +0 -378
  704. package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +0 -496
  705. package/node_modules/zod/src/v4/classic/tests/union.test.ts +0 -273
  706. package/node_modules/zod/src/v4/classic/tests/url.test.ts +0 -13
  707. package/node_modules/zod/src/v4/classic/tests/validations.test.ts +0 -283
  708. package/node_modules/zod/src/v4/classic/tests/void.test.ts +0 -12
  709. package/node_modules/zod/src/v4/core/api.ts +0 -1823
  710. package/node_modules/zod/src/v4/core/checks.ts +0 -1293
  711. package/node_modules/zod/src/v4/core/config.ts +0 -15
  712. package/node_modules/zod/src/v4/core/core.ts +0 -153
  713. package/node_modules/zod/src/v4/core/doc.ts +0 -44
  714. package/node_modules/zod/src/v4/core/errors.ts +0 -455
  715. package/node_modules/zod/src/v4/core/index.ts +0 -16
  716. package/node_modules/zod/src/v4/core/json-schema-generator.ts +0 -126
  717. package/node_modules/zod/src/v4/core/json-schema-processors.ts +0 -666
  718. package/node_modules/zod/src/v4/core/json-schema.ts +0 -147
  719. package/node_modules/zod/src/v4/core/parse.ts +0 -195
  720. package/node_modules/zod/src/v4/core/regexes.ts +0 -190
  721. package/node_modules/zod/src/v4/core/registries.ts +0 -105
  722. package/node_modules/zod/src/v4/core/schemas.ts +0 -4730
  723. package/node_modules/zod/src/v4/core/standard-schema.ts +0 -159
  724. package/node_modules/zod/src/v4/core/tests/extend.test.ts +0 -59
  725. package/node_modules/zod/src/v4/core/tests/index.test.ts +0 -46
  726. package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +0 -124
  727. package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +0 -215
  728. package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +0 -22
  729. package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +0 -181
  730. package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +0 -72
  731. package/node_modules/zod/src/v4/core/tests/locales/he.test.ts +0 -379
  732. package/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +0 -163
  733. package/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +0 -46
  734. package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +0 -128
  735. package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +0 -69
  736. package/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +0 -105
  737. package/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +0 -125
  738. package/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +0 -45
  739. package/node_modules/zod/src/v4/core/to-json-schema.ts +0 -622
  740. package/node_modules/zod/src/v4/core/util.ts +0 -983
  741. package/node_modules/zod/src/v4/core/versions.ts +0 -5
  742. package/node_modules/zod/src/v4/core/zsf.ts +0 -323
  743. package/node_modules/zod/src/v4/index.ts +0 -4
  744. package/node_modules/zod/src/v4/locales/ar.ts +0 -115
  745. package/node_modules/zod/src/v4/locales/az.ts +0 -111
  746. package/node_modules/zod/src/v4/locales/be.ts +0 -176
  747. package/node_modules/zod/src/v4/locales/bg.ts +0 -128
  748. package/node_modules/zod/src/v4/locales/ca.ts +0 -116
  749. package/node_modules/zod/src/v4/locales/cs.ts +0 -118
  750. package/node_modules/zod/src/v4/locales/da.ts +0 -123
  751. package/node_modules/zod/src/v4/locales/de.ts +0 -116
  752. package/node_modules/zod/src/v4/locales/el.ts +0 -121
  753. package/node_modules/zod/src/v4/locales/en.ts +0 -123
  754. package/node_modules/zod/src/v4/locales/eo.ts +0 -118
  755. package/node_modules/zod/src/v4/locales/es.ts +0 -141
  756. package/node_modules/zod/src/v4/locales/fa.ts +0 -126
  757. package/node_modules/zod/src/v4/locales/fi.ts +0 -121
  758. package/node_modules/zod/src/v4/locales/fr-CA.ts +0 -116
  759. package/node_modules/zod/src/v4/locales/fr.ts +0 -132
  760. package/node_modules/zod/src/v4/locales/he.ts +0 -246
  761. package/node_modules/zod/src/v4/locales/hr.ts +0 -131
  762. package/node_modules/zod/src/v4/locales/hu.ts +0 -117
  763. package/node_modules/zod/src/v4/locales/hy.ts +0 -164
  764. package/node_modules/zod/src/v4/locales/id.ts +0 -115
  765. package/node_modules/zod/src/v4/locales/index.ts +0 -52
  766. package/node_modules/zod/src/v4/locales/is.ts +0 -119
  767. package/node_modules/zod/src/v4/locales/it.ts +0 -116
  768. package/node_modules/zod/src/v4/locales/ja.ts +0 -114
  769. package/node_modules/zod/src/v4/locales/ka.ts +0 -123
  770. package/node_modules/zod/src/v4/locales/kh.ts +0 -7
  771. package/node_modules/zod/src/v4/locales/km.ts +0 -119
  772. package/node_modules/zod/src/v4/locales/ko.ts +0 -121
  773. package/node_modules/zod/src/v4/locales/lt.ts +0 -239
  774. package/node_modules/zod/src/v4/locales/mk.ts +0 -118
  775. package/node_modules/zod/src/v4/locales/ms.ts +0 -115
  776. package/node_modules/zod/src/v4/locales/nl.ts +0 -121
  777. package/node_modules/zod/src/v4/locales/no.ts +0 -116
  778. package/node_modules/zod/src/v4/locales/ota.ts +0 -117
  779. package/node_modules/zod/src/v4/locales/pl.ts +0 -118
  780. package/node_modules/zod/src/v4/locales/ps.ts +0 -126
  781. package/node_modules/zod/src/v4/locales/pt.ts +0 -116
  782. package/node_modules/zod/src/v4/locales/ro.ts +0 -129
  783. package/node_modules/zod/src/v4/locales/ru.ts +0 -176
  784. package/node_modules/zod/src/v4/locales/sl.ts +0 -118
  785. package/node_modules/zod/src/v4/locales/sv.ts +0 -119
  786. package/node_modules/zod/src/v4/locales/ta.ts +0 -118
  787. package/node_modules/zod/src/v4/locales/th.ts +0 -119
  788. package/node_modules/zod/src/v4/locales/tr.ts +0 -111
  789. package/node_modules/zod/src/v4/locales/ua.ts +0 -7
  790. package/node_modules/zod/src/v4/locales/uk.ts +0 -117
  791. package/node_modules/zod/src/v4/locales/ur.ts +0 -119
  792. package/node_modules/zod/src/v4/locales/uz.ts +0 -117
  793. package/node_modules/zod/src/v4/locales/vi.ts +0 -117
  794. package/node_modules/zod/src/v4/locales/yo.ts +0 -124
  795. package/node_modules/zod/src/v4/locales/zh-CN.ts +0 -116
  796. package/node_modules/zod/src/v4/locales/zh-TW.ts +0 -115
  797. package/node_modules/zod/src/v4/mini/checks.ts +0 -32
  798. package/node_modules/zod/src/v4/mini/coerce.ts +0 -27
  799. package/node_modules/zod/src/v4/mini/external.ts +0 -41
  800. package/node_modules/zod/src/v4/mini/index.ts +0 -3
  801. package/node_modules/zod/src/v4/mini/iso.ts +0 -66
  802. package/node_modules/zod/src/v4/mini/parse.ts +0 -14
  803. package/node_modules/zod/src/v4/mini/schemas.ts +0 -1947
  804. package/node_modules/zod/src/v4/mini/tests/apply.test.ts +0 -24
  805. package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +0 -129
  806. package/node_modules/zod/src/v4/mini/tests/brand.test.ts +0 -94
  807. package/node_modules/zod/src/v4/mini/tests/checks.test.ts +0 -144
  808. package/node_modules/zod/src/v4/mini/tests/codec.test.ts +0 -548
  809. package/node_modules/zod/src/v4/mini/tests/computed.test.ts +0 -36
  810. package/node_modules/zod/src/v4/mini/tests/error.test.ts +0 -22
  811. package/node_modules/zod/src/v4/mini/tests/functions.test.ts +0 -5
  812. package/node_modules/zod/src/v4/mini/tests/index.test.ts +0 -993
  813. package/node_modules/zod/src/v4/mini/tests/number.test.ts +0 -95
  814. package/node_modules/zod/src/v4/mini/tests/object.test.ts +0 -227
  815. package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +0 -43
  816. package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +0 -325
  817. package/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +0 -50
  818. package/node_modules/zod/src/v4/mini/tests/string.test.ts +0 -352
  819. package/node_modules/zod/src/v4-mini/index.ts +0 -3
  820. package/node_modules/zod/v3/ZodError.cjs +0 -138
  821. package/node_modules/zod/v3/ZodError.d.cts +0 -164
  822. package/node_modules/zod/v3/ZodError.d.ts +0 -164
  823. package/node_modules/zod/v3/ZodError.js +0 -133
  824. package/node_modules/zod/v3/errors.cjs +0 -17
  825. package/node_modules/zod/v3/errors.d.cts +0 -5
  826. package/node_modules/zod/v3/errors.d.ts +0 -5
  827. package/node_modules/zod/v3/errors.js +0 -9
  828. package/node_modules/zod/v3/external.cjs +0 -22
  829. package/node_modules/zod/v3/external.d.cts +0 -6
  830. package/node_modules/zod/v3/external.d.ts +0 -6
  831. package/node_modules/zod/v3/external.js +0 -6
  832. package/node_modules/zod/v3/helpers/enumUtil.cjs +0 -2
  833. package/node_modules/zod/v3/helpers/enumUtil.d.cts +0 -8
  834. package/node_modules/zod/v3/helpers/enumUtil.d.ts +0 -8
  835. package/node_modules/zod/v3/helpers/enumUtil.js +0 -1
  836. package/node_modules/zod/v3/helpers/errorUtil.cjs +0 -9
  837. package/node_modules/zod/v3/helpers/errorUtil.d.cts +0 -9
  838. package/node_modules/zod/v3/helpers/errorUtil.d.ts +0 -9
  839. package/node_modules/zod/v3/helpers/errorUtil.js +0 -6
  840. package/node_modules/zod/v3/helpers/parseUtil.cjs +0 -124
  841. package/node_modules/zod/v3/helpers/parseUtil.d.cts +0 -78
  842. package/node_modules/zod/v3/helpers/parseUtil.d.ts +0 -78
  843. package/node_modules/zod/v3/helpers/parseUtil.js +0 -109
  844. package/node_modules/zod/v3/helpers/partialUtil.cjs +0 -2
  845. package/node_modules/zod/v3/helpers/partialUtil.d.cts +0 -8
  846. package/node_modules/zod/v3/helpers/partialUtil.d.ts +0 -8
  847. package/node_modules/zod/v3/helpers/partialUtil.js +0 -1
  848. package/node_modules/zod/v3/helpers/typeAliases.cjs +0 -2
  849. package/node_modules/zod/v3/helpers/typeAliases.d.cts +0 -2
  850. package/node_modules/zod/v3/helpers/typeAliases.d.ts +0 -2
  851. package/node_modules/zod/v3/helpers/typeAliases.js +0 -1
  852. package/node_modules/zod/v3/helpers/util.cjs +0 -137
  853. package/node_modules/zod/v3/helpers/util.d.cts +0 -85
  854. package/node_modules/zod/v3/helpers/util.d.ts +0 -85
  855. package/node_modules/zod/v3/helpers/util.js +0 -133
  856. package/node_modules/zod/v3/index.cjs +0 -33
  857. package/node_modules/zod/v3/index.d.cts +0 -4
  858. package/node_modules/zod/v3/index.d.ts +0 -4
  859. package/node_modules/zod/v3/index.js +0 -4
  860. package/node_modules/zod/v3/locales/en.cjs +0 -112
  861. package/node_modules/zod/v3/locales/en.d.cts +0 -3
  862. package/node_modules/zod/v3/locales/en.d.ts +0 -3
  863. package/node_modules/zod/v3/locales/en.js +0 -109
  864. package/node_modules/zod/v3/package.json +0 -7
  865. package/node_modules/zod/v3/standard-schema.cjs +0 -2
  866. package/node_modules/zod/v3/standard-schema.d.cts +0 -102
  867. package/node_modules/zod/v3/standard-schema.d.ts +0 -102
  868. package/node_modules/zod/v3/standard-schema.js +0 -1
  869. package/node_modules/zod/v3/types.cjs +0 -3777
  870. package/node_modules/zod/v3/types.d.cts +0 -1034
  871. package/node_modules/zod/v3/types.d.ts +0 -1034
  872. package/node_modules/zod/v3/types.js +0 -3695
  873. package/node_modules/zod/v4/classic/checks.cjs +0 -33
  874. package/node_modules/zod/v4/classic/checks.d.cts +0 -1
  875. package/node_modules/zod/v4/classic/checks.d.ts +0 -1
  876. package/node_modules/zod/v4/classic/checks.js +0 -1
  877. package/node_modules/zod/v4/classic/coerce.cjs +0 -47
  878. package/node_modules/zod/v4/classic/coerce.d.cts +0 -17
  879. package/node_modules/zod/v4/classic/coerce.d.ts +0 -17
  880. package/node_modules/zod/v4/classic/coerce.js +0 -17
  881. package/node_modules/zod/v4/classic/compat.cjs +0 -61
  882. package/node_modules/zod/v4/classic/compat.d.cts +0 -50
  883. package/node_modules/zod/v4/classic/compat.d.ts +0 -50
  884. package/node_modules/zod/v4/classic/compat.js +0 -31
  885. package/node_modules/zod/v4/classic/errors.cjs +0 -74
  886. package/node_modules/zod/v4/classic/errors.d.cts +0 -30
  887. package/node_modules/zod/v4/classic/errors.d.ts +0 -30
  888. package/node_modules/zod/v4/classic/errors.js +0 -48
  889. package/node_modules/zod/v4/classic/external.cjs +0 -73
  890. package/node_modules/zod/v4/classic/external.d.cts +0 -16
  891. package/node_modules/zod/v4/classic/external.d.ts +0 -16
  892. package/node_modules/zod/v4/classic/external.js +0 -20
  893. package/node_modules/zod/v4/classic/from-json-schema.cjs +0 -625
  894. package/node_modules/zod/v4/classic/from-json-schema.d.cts +0 -12
  895. package/node_modules/zod/v4/classic/from-json-schema.d.ts +0 -12
  896. package/node_modules/zod/v4/classic/from-json-schema.js +0 -599
  897. package/node_modules/zod/v4/classic/index.cjs +0 -33
  898. package/node_modules/zod/v4/classic/index.d.cts +0 -4
  899. package/node_modules/zod/v4/classic/index.d.ts +0 -4
  900. package/node_modules/zod/v4/classic/index.js +0 -4
  901. package/node_modules/zod/v4/classic/iso.cjs +0 -60
  902. package/node_modules/zod/v4/classic/iso.d.cts +0 -22
  903. package/node_modules/zod/v4/classic/iso.d.ts +0 -22
  904. package/node_modules/zod/v4/classic/iso.js +0 -30
  905. package/node_modules/zod/v4/classic/package.json +0 -7
  906. package/node_modules/zod/v4/classic/parse.cjs +0 -41
  907. package/node_modules/zod/v4/classic/parse.d.cts +0 -31
  908. package/node_modules/zod/v4/classic/parse.d.ts +0 -31
  909. package/node_modules/zod/v4/classic/parse.js +0 -15
  910. package/node_modules/zod/v4/classic/schemas.cjs +0 -1511
  911. package/node_modules/zod/v4/classic/schemas.d.cts +0 -767
  912. package/node_modules/zod/v4/classic/schemas.d.ts +0 -767
  913. package/node_modules/zod/v4/classic/schemas.js +0 -1395
  914. package/node_modules/zod/v4/core/api.cjs +0 -1227
  915. package/node_modules/zod/v4/core/api.d.cts +0 -325
  916. package/node_modules/zod/v4/core/api.d.ts +0 -325
  917. package/node_modules/zod/v4/core/api.js +0 -1087
  918. package/node_modules/zod/v4/core/checks.cjs +0 -601
  919. package/node_modules/zod/v4/core/checks.d.cts +0 -278
  920. package/node_modules/zod/v4/core/checks.d.ts +0 -278
  921. package/node_modules/zod/v4/core/checks.js +0 -575
  922. package/node_modules/zod/v4/core/core.cjs +0 -85
  923. package/node_modules/zod/v4/core/core.d.cts +0 -70
  924. package/node_modules/zod/v4/core/core.d.ts +0 -70
  925. package/node_modules/zod/v4/core/core.js +0 -78
  926. package/node_modules/zod/v4/core/doc.cjs +0 -39
  927. package/node_modules/zod/v4/core/doc.d.cts +0 -14
  928. package/node_modules/zod/v4/core/doc.d.ts +0 -14
  929. package/node_modules/zod/v4/core/doc.js +0 -35
  930. package/node_modules/zod/v4/core/errors.cjs +0 -216
  931. package/node_modules/zod/v4/core/errors.d.cts +0 -221
  932. package/node_modules/zod/v4/core/errors.d.ts +0 -221
  933. package/node_modules/zod/v4/core/errors.js +0 -185
  934. package/node_modules/zod/v4/core/index.cjs +0 -47
  935. package/node_modules/zod/v4/core/index.d.cts +0 -16
  936. package/node_modules/zod/v4/core/index.d.ts +0 -16
  937. package/node_modules/zod/v4/core/index.js +0 -16
  938. package/node_modules/zod/v4/core/json-schema-generator.cjs +0 -99
  939. package/node_modules/zod/v4/core/json-schema-generator.d.cts +0 -65
  940. package/node_modules/zod/v4/core/json-schema-generator.d.ts +0 -65
  941. package/node_modules/zod/v4/core/json-schema-generator.js +0 -95
  942. package/node_modules/zod/v4/core/json-schema-processors.cjs +0 -644
  943. package/node_modules/zod/v4/core/json-schema-processors.d.cts +0 -49
  944. package/node_modules/zod/v4/core/json-schema-processors.d.ts +0 -49
  945. package/node_modules/zod/v4/core/json-schema-processors.js +0 -601
  946. package/node_modules/zod/v4/core/json-schema.cjs +0 -2
  947. package/node_modules/zod/v4/core/json-schema.d.cts +0 -88
  948. package/node_modules/zod/v4/core/json-schema.d.ts +0 -88
  949. package/node_modules/zod/v4/core/json-schema.js +0 -1
  950. package/node_modules/zod/v4/core/package.json +0 -7
  951. package/node_modules/zod/v4/core/parse.cjs +0 -131
  952. package/node_modules/zod/v4/core/parse.d.cts +0 -49
  953. package/node_modules/zod/v4/core/parse.d.ts +0 -49
  954. package/node_modules/zod/v4/core/parse.js +0 -93
  955. package/node_modules/zod/v4/core/regexes.cjs +0 -172
  956. package/node_modules/zod/v4/core/regexes.d.cts +0 -85
  957. package/node_modules/zod/v4/core/regexes.d.ts +0 -85
  958. package/node_modules/zod/v4/core/regexes.js +0 -139
  959. package/node_modules/zod/v4/core/registries.cjs +0 -56
  960. package/node_modules/zod/v4/core/registries.d.cts +0 -35
  961. package/node_modules/zod/v4/core/registries.d.ts +0 -35
  962. package/node_modules/zod/v4/core/registries.js +0 -51
  963. package/node_modules/zod/v4/core/schemas.cjs +0 -2270
  964. package/node_modules/zod/v4/core/schemas.d.cts +0 -1184
  965. package/node_modules/zod/v4/core/schemas.d.ts +0 -1184
  966. package/node_modules/zod/v4/core/schemas.js +0 -2239
  967. package/node_modules/zod/v4/core/standard-schema.cjs +0 -2
  968. package/node_modules/zod/v4/core/standard-schema.d.cts +0 -126
  969. package/node_modules/zod/v4/core/standard-schema.d.ts +0 -126
  970. package/node_modules/zod/v4/core/standard-schema.js +0 -1
  971. package/node_modules/zod/v4/core/to-json-schema.cjs +0 -457
  972. package/node_modules/zod/v4/core/to-json-schema.d.cts +0 -114
  973. package/node_modules/zod/v4/core/to-json-schema.d.ts +0 -114
  974. package/node_modules/zod/v4/core/to-json-schema.js +0 -448
  975. package/node_modules/zod/v4/core/util.cjs +0 -734
  976. package/node_modules/zod/v4/core/util.d.cts +0 -200
  977. package/node_modules/zod/v4/core/util.d.ts +0 -200
  978. package/node_modules/zod/v4/core/util.js +0 -674
  979. package/node_modules/zod/v4/core/versions.cjs +0 -8
  980. package/node_modules/zod/v4/core/versions.d.cts +0 -5
  981. package/node_modules/zod/v4/core/versions.d.ts +0 -5
  982. package/node_modules/zod/v4/core/versions.js +0 -5
  983. package/node_modules/zod/v4/index.cjs +0 -22
  984. package/node_modules/zod/v4/index.d.cts +0 -3
  985. package/node_modules/zod/v4/index.d.ts +0 -3
  986. package/node_modules/zod/v4/index.js +0 -3
  987. package/node_modules/zod/v4/locales/ar.cjs +0 -133
  988. package/node_modules/zod/v4/locales/ar.d.cts +0 -5
  989. package/node_modules/zod/v4/locales/ar.d.ts +0 -4
  990. package/node_modules/zod/v4/locales/ar.js +0 -106
  991. package/node_modules/zod/v4/locales/az.cjs +0 -132
  992. package/node_modules/zod/v4/locales/az.d.cts +0 -5
  993. package/node_modules/zod/v4/locales/az.d.ts +0 -4
  994. package/node_modules/zod/v4/locales/az.js +0 -105
  995. package/node_modules/zod/v4/locales/be.cjs +0 -183
  996. package/node_modules/zod/v4/locales/be.d.cts +0 -5
  997. package/node_modules/zod/v4/locales/be.d.ts +0 -4
  998. package/node_modules/zod/v4/locales/be.js +0 -156
  999. package/node_modules/zod/v4/locales/bg.cjs +0 -147
  1000. package/node_modules/zod/v4/locales/bg.d.cts +0 -5
  1001. package/node_modules/zod/v4/locales/bg.d.ts +0 -4
  1002. package/node_modules/zod/v4/locales/bg.js +0 -120
  1003. package/node_modules/zod/v4/locales/ca.cjs +0 -134
  1004. package/node_modules/zod/v4/locales/ca.d.cts +0 -5
  1005. package/node_modules/zod/v4/locales/ca.d.ts +0 -4
  1006. package/node_modules/zod/v4/locales/ca.js +0 -107
  1007. package/node_modules/zod/v4/locales/cs.cjs +0 -138
  1008. package/node_modules/zod/v4/locales/cs.d.cts +0 -5
  1009. package/node_modules/zod/v4/locales/cs.d.ts +0 -4
  1010. package/node_modules/zod/v4/locales/cs.js +0 -111
  1011. package/node_modules/zod/v4/locales/da.cjs +0 -142
  1012. package/node_modules/zod/v4/locales/da.d.cts +0 -5
  1013. package/node_modules/zod/v4/locales/da.d.ts +0 -4
  1014. package/node_modules/zod/v4/locales/da.js +0 -115
  1015. package/node_modules/zod/v4/locales/de.cjs +0 -135
  1016. package/node_modules/zod/v4/locales/de.d.cts +0 -5
  1017. package/node_modules/zod/v4/locales/de.d.ts +0 -4
  1018. package/node_modules/zod/v4/locales/de.js +0 -108
  1019. package/node_modules/zod/v4/locales/el.cjs +0 -136
  1020. package/node_modules/zod/v4/locales/el.d.cts +0 -5
  1021. package/node_modules/zod/v4/locales/el.d.ts +0 -4
  1022. package/node_modules/zod/v4/locales/el.js +0 -109
  1023. package/node_modules/zod/v4/locales/en.cjs +0 -140
  1024. package/node_modules/zod/v4/locales/en.d.cts +0 -5
  1025. package/node_modules/zod/v4/locales/en.d.ts +0 -4
  1026. package/node_modules/zod/v4/locales/en.js +0 -113
  1027. package/node_modules/zod/v4/locales/eo.cjs +0 -136
  1028. package/node_modules/zod/v4/locales/eo.d.cts +0 -5
  1029. package/node_modules/zod/v4/locales/eo.d.ts +0 -4
  1030. package/node_modules/zod/v4/locales/eo.js +0 -109
  1031. package/node_modules/zod/v4/locales/es.cjs +0 -159
  1032. package/node_modules/zod/v4/locales/es.d.cts +0 -5
  1033. package/node_modules/zod/v4/locales/es.d.ts +0 -4
  1034. package/node_modules/zod/v4/locales/es.js +0 -132
  1035. package/node_modules/zod/v4/locales/fa.cjs +0 -141
  1036. package/node_modules/zod/v4/locales/fa.d.cts +0 -5
  1037. package/node_modules/zod/v4/locales/fa.d.ts +0 -4
  1038. package/node_modules/zod/v4/locales/fa.js +0 -114
  1039. package/node_modules/zod/v4/locales/fi.cjs +0 -139
  1040. package/node_modules/zod/v4/locales/fi.d.cts +0 -5
  1041. package/node_modules/zod/v4/locales/fi.d.ts +0 -4
  1042. package/node_modules/zod/v4/locales/fi.js +0 -112
  1043. package/node_modules/zod/v4/locales/fr-CA.cjs +0 -134
  1044. package/node_modules/zod/v4/locales/fr-CA.d.cts +0 -5
  1045. package/node_modules/zod/v4/locales/fr-CA.d.ts +0 -4
  1046. package/node_modules/zod/v4/locales/fr-CA.js +0 -107
  1047. package/node_modules/zod/v4/locales/fr.cjs +0 -152
  1048. package/node_modules/zod/v4/locales/fr.d.cts +0 -5
  1049. package/node_modules/zod/v4/locales/fr.d.ts +0 -4
  1050. package/node_modules/zod/v4/locales/fr.js +0 -125
  1051. package/node_modules/zod/v4/locales/he.cjs +0 -241
  1052. package/node_modules/zod/v4/locales/he.d.cts +0 -5
  1053. package/node_modules/zod/v4/locales/he.d.ts +0 -4
  1054. package/node_modules/zod/v4/locales/he.js +0 -214
  1055. package/node_modules/zod/v4/locales/hr.cjs +0 -149
  1056. package/node_modules/zod/v4/locales/hr.d.cts +0 -5
  1057. package/node_modules/zod/v4/locales/hr.d.ts +0 -4
  1058. package/node_modules/zod/v4/locales/hr.js +0 -122
  1059. package/node_modules/zod/v4/locales/hu.cjs +0 -135
  1060. package/node_modules/zod/v4/locales/hu.d.cts +0 -5
  1061. package/node_modules/zod/v4/locales/hu.d.ts +0 -4
  1062. package/node_modules/zod/v4/locales/hu.js +0 -108
  1063. package/node_modules/zod/v4/locales/hy.cjs +0 -174
  1064. package/node_modules/zod/v4/locales/hy.d.cts +0 -5
  1065. package/node_modules/zod/v4/locales/hy.d.ts +0 -4
  1066. package/node_modules/zod/v4/locales/hy.js +0 -147
  1067. package/node_modules/zod/v4/locales/id.cjs +0 -133
  1068. package/node_modules/zod/v4/locales/id.d.cts +0 -5
  1069. package/node_modules/zod/v4/locales/id.d.ts +0 -4
  1070. package/node_modules/zod/v4/locales/id.js +0 -106
  1071. package/node_modules/zod/v4/locales/index.cjs +0 -111
  1072. package/node_modules/zod/v4/locales/index.d.cts +0 -52
  1073. package/node_modules/zod/v4/locales/index.d.ts +0 -52
  1074. package/node_modules/zod/v4/locales/index.js +0 -52
  1075. package/node_modules/zod/v4/locales/is.cjs +0 -136
  1076. package/node_modules/zod/v4/locales/is.d.cts +0 -5
  1077. package/node_modules/zod/v4/locales/is.d.ts +0 -4
  1078. package/node_modules/zod/v4/locales/is.js +0 -109
  1079. package/node_modules/zod/v4/locales/it.cjs +0 -135
  1080. package/node_modules/zod/v4/locales/it.d.cts +0 -5
  1081. package/node_modules/zod/v4/locales/it.d.ts +0 -4
  1082. package/node_modules/zod/v4/locales/it.js +0 -108
  1083. package/node_modules/zod/v4/locales/ja.cjs +0 -134
  1084. package/node_modules/zod/v4/locales/ja.d.cts +0 -5
  1085. package/node_modules/zod/v4/locales/ja.d.ts +0 -4
  1086. package/node_modules/zod/v4/locales/ja.js +0 -107
  1087. package/node_modules/zod/v4/locales/ka.cjs +0 -139
  1088. package/node_modules/zod/v4/locales/ka.d.cts +0 -5
  1089. package/node_modules/zod/v4/locales/ka.d.ts +0 -4
  1090. package/node_modules/zod/v4/locales/ka.js +0 -112
  1091. package/node_modules/zod/v4/locales/kh.cjs +0 -12
  1092. package/node_modules/zod/v4/locales/kh.d.cts +0 -5
  1093. package/node_modules/zod/v4/locales/kh.d.ts +0 -5
  1094. package/node_modules/zod/v4/locales/kh.js +0 -5
  1095. package/node_modules/zod/v4/locales/km.cjs +0 -137
  1096. package/node_modules/zod/v4/locales/km.d.cts +0 -5
  1097. package/node_modules/zod/v4/locales/km.d.ts +0 -4
  1098. package/node_modules/zod/v4/locales/km.js +0 -110
  1099. package/node_modules/zod/v4/locales/ko.cjs +0 -138
  1100. package/node_modules/zod/v4/locales/ko.d.cts +0 -5
  1101. package/node_modules/zod/v4/locales/ko.d.ts +0 -4
  1102. package/node_modules/zod/v4/locales/ko.js +0 -111
  1103. package/node_modules/zod/v4/locales/lt.cjs +0 -230
  1104. package/node_modules/zod/v4/locales/lt.d.cts +0 -5
  1105. package/node_modules/zod/v4/locales/lt.d.ts +0 -4
  1106. package/node_modules/zod/v4/locales/lt.js +0 -203
  1107. package/node_modules/zod/v4/locales/mk.cjs +0 -136
  1108. package/node_modules/zod/v4/locales/mk.d.cts +0 -5
  1109. package/node_modules/zod/v4/locales/mk.d.ts +0 -4
  1110. package/node_modules/zod/v4/locales/mk.js +0 -109
  1111. package/node_modules/zod/v4/locales/ms.cjs +0 -134
  1112. package/node_modules/zod/v4/locales/ms.d.cts +0 -5
  1113. package/node_modules/zod/v4/locales/ms.d.ts +0 -4
  1114. package/node_modules/zod/v4/locales/ms.js +0 -107
  1115. package/node_modules/zod/v4/locales/nl.cjs +0 -137
  1116. package/node_modules/zod/v4/locales/nl.d.cts +0 -5
  1117. package/node_modules/zod/v4/locales/nl.d.ts +0 -4
  1118. package/node_modules/zod/v4/locales/nl.js +0 -110
  1119. package/node_modules/zod/v4/locales/no.cjs +0 -135
  1120. package/node_modules/zod/v4/locales/no.d.cts +0 -5
  1121. package/node_modules/zod/v4/locales/no.d.ts +0 -4
  1122. package/node_modules/zod/v4/locales/no.js +0 -108
  1123. package/node_modules/zod/v4/locales/ota.cjs +0 -136
  1124. package/node_modules/zod/v4/locales/ota.d.cts +0 -5
  1125. package/node_modules/zod/v4/locales/ota.d.ts +0 -4
  1126. package/node_modules/zod/v4/locales/ota.js +0 -109
  1127. package/node_modules/zod/v4/locales/package.json +0 -7
  1128. package/node_modules/zod/v4/locales/pl.cjs +0 -136
  1129. package/node_modules/zod/v4/locales/pl.d.cts +0 -5
  1130. package/node_modules/zod/v4/locales/pl.d.ts +0 -4
  1131. package/node_modules/zod/v4/locales/pl.js +0 -109
  1132. package/node_modules/zod/v4/locales/ps.cjs +0 -141
  1133. package/node_modules/zod/v4/locales/ps.d.cts +0 -5
  1134. package/node_modules/zod/v4/locales/ps.d.ts +0 -4
  1135. package/node_modules/zod/v4/locales/ps.js +0 -114
  1136. package/node_modules/zod/v4/locales/pt.cjs +0 -135
  1137. package/node_modules/zod/v4/locales/pt.d.cts +0 -5
  1138. package/node_modules/zod/v4/locales/pt.d.ts +0 -4
  1139. package/node_modules/zod/v4/locales/pt.js +0 -108
  1140. package/node_modules/zod/v4/locales/ro.cjs +0 -146
  1141. package/node_modules/zod/v4/locales/ro.d.cts +0 -5
  1142. package/node_modules/zod/v4/locales/ro.d.ts +0 -4
  1143. package/node_modules/zod/v4/locales/ro.js +0 -119
  1144. package/node_modules/zod/v4/locales/ru.cjs +0 -183
  1145. package/node_modules/zod/v4/locales/ru.d.cts +0 -5
  1146. package/node_modules/zod/v4/locales/ru.d.ts +0 -4
  1147. package/node_modules/zod/v4/locales/ru.js +0 -156
  1148. package/node_modules/zod/v4/locales/sl.cjs +0 -136
  1149. package/node_modules/zod/v4/locales/sl.d.cts +0 -5
  1150. package/node_modules/zod/v4/locales/sl.d.ts +0 -4
  1151. package/node_modules/zod/v4/locales/sl.js +0 -109
  1152. package/node_modules/zod/v4/locales/sv.cjs +0 -137
  1153. package/node_modules/zod/v4/locales/sv.d.cts +0 -5
  1154. package/node_modules/zod/v4/locales/sv.d.ts +0 -4
  1155. package/node_modules/zod/v4/locales/sv.js +0 -110
  1156. package/node_modules/zod/v4/locales/ta.cjs +0 -137
  1157. package/node_modules/zod/v4/locales/ta.d.cts +0 -5
  1158. package/node_modules/zod/v4/locales/ta.d.ts +0 -4
  1159. package/node_modules/zod/v4/locales/ta.js +0 -110
  1160. package/node_modules/zod/v4/locales/th.cjs +0 -137
  1161. package/node_modules/zod/v4/locales/th.d.cts +0 -5
  1162. package/node_modules/zod/v4/locales/th.d.ts +0 -4
  1163. package/node_modules/zod/v4/locales/th.js +0 -110
  1164. package/node_modules/zod/v4/locales/tr.cjs +0 -132
  1165. package/node_modules/zod/v4/locales/tr.d.cts +0 -5
  1166. package/node_modules/zod/v4/locales/tr.d.ts +0 -4
  1167. package/node_modules/zod/v4/locales/tr.js +0 -105
  1168. package/node_modules/zod/v4/locales/ua.cjs +0 -12
  1169. package/node_modules/zod/v4/locales/ua.d.cts +0 -5
  1170. package/node_modules/zod/v4/locales/ua.d.ts +0 -5
  1171. package/node_modules/zod/v4/locales/ua.js +0 -5
  1172. package/node_modules/zod/v4/locales/uk.cjs +0 -135
  1173. package/node_modules/zod/v4/locales/uk.d.cts +0 -5
  1174. package/node_modules/zod/v4/locales/uk.d.ts +0 -4
  1175. package/node_modules/zod/v4/locales/uk.js +0 -108
  1176. package/node_modules/zod/v4/locales/ur.cjs +0 -137
  1177. package/node_modules/zod/v4/locales/ur.d.cts +0 -5
  1178. package/node_modules/zod/v4/locales/ur.d.ts +0 -4
  1179. package/node_modules/zod/v4/locales/ur.js +0 -110
  1180. package/node_modules/zod/v4/locales/uz.cjs +0 -137
  1181. package/node_modules/zod/v4/locales/uz.d.cts +0 -5
  1182. package/node_modules/zod/v4/locales/uz.d.ts +0 -4
  1183. package/node_modules/zod/v4/locales/uz.js +0 -110
  1184. package/node_modules/zod/v4/locales/vi.cjs +0 -135
  1185. package/node_modules/zod/v4/locales/vi.d.cts +0 -5
  1186. package/node_modules/zod/v4/locales/vi.d.ts +0 -4
  1187. package/node_modules/zod/v4/locales/vi.js +0 -108
  1188. package/node_modules/zod/v4/locales/yo.cjs +0 -134
  1189. package/node_modules/zod/v4/locales/yo.d.cts +0 -5
  1190. package/node_modules/zod/v4/locales/yo.d.ts +0 -4
  1191. package/node_modules/zod/v4/locales/yo.js +0 -107
  1192. package/node_modules/zod/v4/locales/zh-CN.cjs +0 -136
  1193. package/node_modules/zod/v4/locales/zh-CN.d.cts +0 -5
  1194. package/node_modules/zod/v4/locales/zh-CN.d.ts +0 -4
  1195. package/node_modules/zod/v4/locales/zh-CN.js +0 -109
  1196. package/node_modules/zod/v4/locales/zh-TW.cjs +0 -134
  1197. package/node_modules/zod/v4/locales/zh-TW.d.cts +0 -5
  1198. package/node_modules/zod/v4/locales/zh-TW.d.ts +0 -4
  1199. package/node_modules/zod/v4/locales/zh-TW.js +0 -107
  1200. package/node_modules/zod/v4/mini/checks.cjs +0 -34
  1201. package/node_modules/zod/v4/mini/checks.d.cts +0 -1
  1202. package/node_modules/zod/v4/mini/checks.d.ts +0 -1
  1203. package/node_modules/zod/v4/mini/checks.js +0 -1
  1204. package/node_modules/zod/v4/mini/coerce.cjs +0 -52
  1205. package/node_modules/zod/v4/mini/coerce.d.cts +0 -7
  1206. package/node_modules/zod/v4/mini/coerce.d.ts +0 -7
  1207. package/node_modules/zod/v4/mini/coerce.js +0 -22
  1208. package/node_modules/zod/v4/mini/external.cjs +0 -63
  1209. package/node_modules/zod/v4/mini/external.d.cts +0 -13
  1210. package/node_modules/zod/v4/mini/external.d.ts +0 -13
  1211. package/node_modules/zod/v4/mini/external.js +0 -14
  1212. package/node_modules/zod/v4/mini/index.cjs +0 -32
  1213. package/node_modules/zod/v4/mini/index.d.cts +0 -3
  1214. package/node_modules/zod/v4/mini/index.d.ts +0 -3
  1215. package/node_modules/zod/v4/mini/index.js +0 -3
  1216. package/node_modules/zod/v4/mini/iso.cjs +0 -64
  1217. package/node_modules/zod/v4/mini/iso.d.cts +0 -22
  1218. package/node_modules/zod/v4/mini/iso.d.ts +0 -22
  1219. package/node_modules/zod/v4/mini/iso.js +0 -34
  1220. package/node_modules/zod/v4/mini/package.json +0 -7
  1221. package/node_modules/zod/v4/mini/parse.cjs +0 -16
  1222. package/node_modules/zod/v4/mini/parse.d.cts +0 -1
  1223. package/node_modules/zod/v4/mini/parse.d.ts +0 -1
  1224. package/node_modules/zod/v4/mini/parse.js +0 -1
  1225. package/node_modules/zod/v4/mini/schemas.cjs +0 -1083
  1226. package/node_modules/zod/v4/mini/schemas.d.cts +0 -445
  1227. package/node_modules/zod/v4/mini/schemas.d.ts +0 -445
  1228. package/node_modules/zod/v4/mini/schemas.js +0 -961
  1229. package/node_modules/zod/v4/package.json +0 -7
  1230. package/node_modules/zod/v4-mini/index.cjs +0 -32
  1231. package/node_modules/zod/v4-mini/index.d.cts +0 -3
  1232. package/node_modules/zod/v4-mini/index.d.ts +0 -3
  1233. package/node_modules/zod/v4-mini/index.js +0 -3
  1234. package/node_modules/zod/v4-mini/package.json +0 -7
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/server.ts","../src/config.ts","../src/context.ts","../src/views/capabilities.ts","../src/views/constants.ts","../src/middleware/cors.ts","../src/middleware/mcp-middleware.ts","../src/inspector-shell.ts","../src/logging.ts","../src/mount-mcp.ts","../src/tools.ts","../src/views/register.ts","../src/views/csp-env.ts","../src/views/routes.ts","../src/views/wire.ts","../src/index.ts"],"sourcesContent":["import {\n localhostAllowedHostnames,\n localhostAllowedOrigins,\n McpServer as SdkMcpServer,\n ResourceTemplate,\n isInputRequiredResult,\n type McpHttpHandler,\n type McpRequestContext,\n type PromptCallback as SdkPromptCallback,\n type ServerEventBus,\n type ServerContext,\n type StandardSchemaWithJSON,\n} from \"@modelcontextprotocol/server\";\nimport type { Server as NodeHttpServer } from \"node:http\";\nimport type { AuthInfo } from \"@modelcontextprotocol/server\";\n\nimport { assertServerConfig, type ServerConfig } from \"./config.js\";\nimport {\n toAuthenticatedRequestContext,\n toRequestContext,\n type RequestContext,\n} from \"./context.js\";\nimport {\n composeFetch,\n getRequestBag,\n hostValidationMiddleware,\n isHtmlNavigationRequest,\n jsonBodyMiddleware,\n matchesPath,\n originValidationMiddleware,\n routeFetch,\n toFrameworkHandler,\n type FetchHandler,\n type FrameworkHandler,\n} from \"./fetch-app.js\";\nimport { corsFetchMiddleware, isGlobalCorsEnabled } from \"./middleware/cors.js\";\nimport {\n normalizeMcpMiddlewarePattern,\n parseMcpPattern,\n runMcpOperation,\n type McpCompleteEventListenerFn,\n type McpEventListenerEntry,\n type McpEventListenerFn,\n type McpMiddlewareEntry,\n type McpMiddlewareFn,\n type McpMiddlewareFnFor,\n type MiddlewareContext,\n} from \"./middleware/mcp-middleware.js\";\nimport {\n createInspectorHandler,\n matchesInspectorShellPath,\n} from \"./inspector-shell.js\";\nimport { requestLogger } from \"./logging.js\";\nimport { createMcpMount } from \"./mount-mcp.js\";\nimport { normalizeCompletions } from \"./resource-completion.js\";\nimport type { NodeRequestHandler } from \"./node-bridge.js\";\nimport { registerOpenAPITools } from \"./openapi/index.js\";\nimport type { FromOpenAPIOptions } from \"./openapi/types.js\";\nimport {\n getOAuthProtectedResourceMetadataUrl,\n requireBearerAuth,\n} from \"./oauth/index.js\";\nimport { authInfoFromRequest, oauthMetadata } from \"./oauth/adapters.js\";\nimport {\n getOAuthProviderOptions,\n resolveConfiguredOAuthResource,\n resolveLocalOAuthResource,\n wrapOAuthTokenVerifier,\n} from \"./oauth/internal.js\";\nimport type {\n InferPromptInput,\n PromptCallback,\n PromptDefinition,\n} from \"./prompts.js\";\nimport type {\n InferTemplateParams,\n ResourceCallback,\n ResourceDefinition,\n ResourceTemplateCallback,\n ResourceTemplateDefinition,\n TemplateVariableValue,\n} from \"./resources.js\";\nimport type {\n InferToolInput,\n InferToolName,\n InferToolOutput,\n ToolCallback,\n ToolDefinition,\n ToolRef,\n ToolViewConfig,\n} from \"./tools.js\";\nimport { resolveToolInputSchema } from \"./tools.js\";\nimport type { ViewResourceFacts } from \"./views/types.js\";\nimport {\n createViewPublicHandler,\n createViewAssetsHandler,\n registerViews,\n resolveAssetsBase,\n synthesizeViewDocument,\n viewResourceConfig,\n viewResourceUri,\n buildResourceUiMeta,\n buildToolResultUiMeta,\n buildToolUiMeta,\n type BuildResourceUiMetaOptions,\n type ViewManifestEntry,\n type ViewsManifest,\n} from \"./views/index.js\";\n\n/*\n * Registry entries hold callbacks type-erased to their widest signature; the\n * registration methods cast the schema-narrowed callback down at `.set()`.\n * Safe because the SDK validates params against the definition's schema\n * before any callback runs.\n */\ntype HasOAuth<TUser> = [TUser] extends [never] ? false : true;\n\n/** Type-erased registry entry replayed when a per-request SDK server is built. */\ninterface ToolEntry<TUser> {\n /** Declarative tool metadata and schemas supplied at registration time. */\n definition: ToolDefinition;\n /** Tool callback widened for heterogeneous storage in the registry. */\n callback: ToolCallback<\n Record<string, unknown>,\n never,\n TUser,\n HasOAuth<TUser>\n >;\n}\n\n/** Static resource definition and callback retained for per-request replay. */\ninterface ResourceEntry<TUser> {\n /** Declarative resource metadata supplied at registration time. */\n definition: ResourceDefinition;\n /** Callback invoked when the registered resource URI is read. */\n callback: ResourceCallback<TUser, HasOAuth<TUser>>;\n}\n\n/** Parameterized resource definition and type-erased callback registry entry. */\ninterface ResourceTemplateEntry<TUser> {\n /** Declarative template metadata, including its URI template. */\n definition: ResourceTemplateDefinition;\n /** Template callback widened to store every inferred variable shape. */\n callback: ResourceTemplateCallback<\n Record<string, TemplateVariableValue>,\n TUser,\n HasOAuth<TUser>\n >;\n /** SDK callback map normalized once at author-time registration. */\n complete?: ReturnType<typeof normalizeCompletions>;\n}\n\n/** Prompt definition and type-erased callback retained for request-time replay. */\ninterface PromptEntry<TUser> {\n /** Declarative prompt metadata and optional argument schema. */\n definition: PromptDefinition;\n /** Prompt callback widened to store every inferred argument shape. */\n callback: PromptCallback<Record<string, unknown>, TUser, HasOAuth<TUser>>;\n}\n\n/** Node HTTP listener returned by `listen()`. */\ninterface NodeHttpListener {\n close(callback?: (error?: Error) => void): void;\n once(event: \"error\", listener: (error: unknown) => void): void;\n listen(port: number, hostname: string, callback?: () => void): NodeHttpServer;\n address(): { port: number } | string | null;\n}\n\n/**\n * MCP server with declarative tool/resource/prompt registration, served\n * statelessly over a composed fetch handler.\n *\n * Registrations are stored in a registry; a fresh SDK `McpServer` is built\n * from it for every HTTP request (the stateless 2026-07-28 model), so\n * definition-time work must stay cheap — put pools and caches at module\n * scope, not inside callbacks' setup.\n *\n * @example\n * ```ts\n * const server = new MCPServer({ name: \"my-server\", version: \"1.0.0\" });\n * server.tool(\n * { name: \"add\", inputSchema: z.object({ a: z.number(), b: z.number() }) },\n * async ({ a, b }) => ({\n * content: [{ type: \"text\", text: String(a + b) }],\n * })\n * );\n * await server.listen(3000);\n * ```\n */\nexport class MCPServer<TUser = never> {\n readonly #config: ServerConfig<TUser>;\n readonly #tools = new Map<string, ToolEntry<TUser>>();\n readonly #resources = new Map<string, ResourceEntry<TUser>>();\n readonly #resourceTemplates = new Map<string, ResourceTemplateEntry<TUser>>();\n readonly #prompts = new Map<string, PromptEntry<TUser>>();\n readonly #views = new Map<string, ViewManifestEntry>();\n /**\n * One-to-one tool→view bindings. Each view name maps to the single tool\n * that bound it; that tool's `view:` config is the sole source of\n * resource facts for the primed view resource.\n */\n readonly #viewBindings = new Map<\n string,\n {\n toolName: string;\n config: ToolViewConfig;\n }\n >();\n #viewsPrimed = false;\n /** When true, resource CSP emission includes the HMR websocket origin. */\n #viewsDevMode = false;\n /** Project root for filesystem-backed view routes (dev `public/`). */\n #viewsProjectRoot = process.cwd();\n\n #fetchHandler: FetchHandler | undefined;\n #handler: McpHttpHandler | undefined;\n #httpServer: NodeHttpListener | undefined;\n #oauthResource: URL | undefined;\n #oauthResourceResolved = false;\n #oauthResourceConfigurationAbsent = false;\n /** Whether the mounted app validates Host headers (fixed at first mount). */\n #hostValidated = false;\n readonly #mcpMiddlewares: McpMiddlewareEntry[] = [];\n readonly #mcpEventListeners: McpEventListenerEntry[] = [];\n\n /**\n * Create an MCP server from a parsed, bundled OpenAPI document.\n *\n * Each included OpenAPI operation becomes a tool that validates its input,\n * calls the matching upstream HTTP endpoint, and returns the response using\n * the SDK's raw tool-result shape. External `$ref` values are not fetched;\n * bundle the document before passing it in.\n *\n * @param options - OpenAPI document, operation filters, upstream URL, and\n * request authentication options.\n * @returns An unauthenticated MCP server populated with generated tools.\n *\n * @example\n * ```ts\n * const spec = await fetch(\"https://api.example.com/openapi.json\")\n * .then((response) => response.json());\n * const server = MCPServer.fromOpenAPI({ spec });\n * await server.listen(3000);\n * ```\n */\n static fromOpenAPI(options: FromOpenAPIOptions): MCPServer {\n const server = new MCPServer({\n name: options.name ?? options.spec.info.title,\n version: options.version ?? options.spec.info.version ?? \"1.0.0\",\n });\n registerOpenAPITools(server, options);\n return server;\n }\n\n /**\n * Create a server. `config.name` and `config.version` identify the server\n * to clients during initialization. `config.basePath` (default `\"/mcp\"`)\n * is both the MCP route and the path of the OAuth protected-resource\n * identity, so any explicit OAuth resource URL must use that exact path.\n * Nothing binds or listens until {@link MCPServer.listen} or\n * {@link MCPServer.getHandler} is called.\n */\n constructor(config: ServerConfig<TUser>) {\n assertServerConfig(config);\n this.#config = config;\n if (config.oauth !== undefined) {\n const mcpUrl =\n typeof process === \"undefined\" ? undefined : process.env[\"MCP_URL\"];\n const resource = resolveConfiguredOAuthResource({\n provider: config.oauth,\n basePath: this.#basePath(),\n ...(mcpUrl !== undefined && { mcpUrl }),\n });\n this.#oauthResource = resource;\n this.#oauthResourceResolved = resource !== undefined;\n this.#oauthResourceConfigurationAbsent = resource === undefined;\n }\n }\n\n /**\n * The URL path prefix the MCP endpoint is mounted at.\n *\n * Reflects `config.basePath` (default `\"/mcp\"`). Exposed so tooling that\n * imports the entry module — `mcp-use dev`'s startup log, for example —\n * can build the endpoint and inspector URLs without assuming the default.\n */\n get basePath(): string {\n return this.#basePath();\n }\n\n /**\n * Register a tool. Input is validated against `inputSchema` before the callback\n * runs; results carrying `structuredContent` are type-checked against\n * `outputSchema` at the callback's return position.\n *\n * @returns A {@link ToolRef} carrying the tool name and phantom types for\n * inference-based view typing.\n */\n tool<const T extends ToolDefinition>(\n definition: T,\n callback: ToolCallback<\n InferToolInput<T>,\n InferToolOutput<T>,\n TUser,\n HasOAuth<TUser>\n >\n ): ToolRef<InferToolName<T>, InferToolInput<T>, InferToolOutput<T>> {\n this.#assertNotStarted(\"tool\", definition.name);\n this.#validateToolViewBinding(definition);\n this.#tools.set(definition.name, {\n definition,\n callback: callback as ToolCallback<\n Record<string, unknown>,\n never,\n TUser,\n HasOAuth<TUser>\n >,\n });\n return Object.freeze({\n name: definition.name,\n }) as ToolRef<InferToolName<T>, InferToolInput<T>, InferToolOutput<T>>;\n }\n\n /**\n * Prime the views registry from a build/dev manifest.\n *\n * @param views - Manifest map keyed by view directory name.\n * @param options - Priming options. When `dev` is true, resource CSP\n * emission appends the serving origin's websocket variant to\n * `connectDomains` so Vite HMR passes host-enforced CSP. Pass\n * `projectRoot` in dev so the `public/` route resolves against the user's\n * project directory rather than the CLI process cwd.\n * @throws If views are already primed, or after the server has started.\n *\n * @internal\n */\n [registerViews](\n views: ViewsManifest,\n options?: { dev?: boolean; projectRoot?: string }\n ): void {\n if (this.#viewsPrimed) {\n throw new Error(\n \"Cannot prime views: the views registry is already primed on this server instance.\"\n );\n }\n this.#assertNotStarted(\"views\", \"manifest\");\n this.#viewsDevMode = options?.dev === true;\n if (options?.projectRoot !== undefined) {\n this.#viewsProjectRoot = options.projectRoot;\n }\n for (const [name, entry] of Object.entries(views)) {\n this.#views.set(name, entry);\n }\n this.#viewsPrimed = true;\n }\n\n /**\n * Prime the views registry — string-keyed alias for {@link registerViews}\n * used by the CLI when the symbol export cannot be shared across duplicate\n * module copies (dev module runner with an externalized package).\n *\n * @param views - Manifest map keyed by view directory name.\n * @param options - Priming options forwarded to {@link registerViews}.\n * @throws If views are already primed, or after the server has started.\n *\n * @internal\n */\n __primeViews(\n views: ViewsManifest,\n options?: { dev?: boolean; projectRoot?: string }\n ): void {\n this[registerViews](views, options);\n }\n\n /** Register a static resource readable at `definition.uri`. */\n resource(\n definition: ResourceDefinition,\n callback: ResourceCallback<TUser, HasOAuth<TUser>>\n ): this {\n this.#assertNotStarted(\"resource\", definition.name);\n this.#resources.set(definition.name, { definition, callback });\n return this;\n }\n\n /**\n * Register a parameterized resource. Reads matching `uriTemplate` invoke\n * the callback with the extracted variables.\n *\n * The `const` type parameter keeps `uriTemplate` a string literal during\n * inference (plain generic inference widens object-literal properties to\n * `string`), which is what lets `InferTemplateParams` type the callback's\n * `params` from the template's variables.\n */\n resourceTemplate<const TUriTemplate extends string>(\n definition: ResourceTemplateDefinition<TUriTemplate>,\n callback: ResourceTemplateCallback<\n InferTemplateParams<{ uriTemplate: TUriTemplate }>,\n TUser,\n HasOAuth<TUser>\n >\n ): this {\n this.#assertNotStarted(\"resourceTemplate\", definition.name);\n const complete =\n definition.complete === undefined\n ? undefined\n : normalizeCompletions(definition.complete);\n this.#resourceTemplates.set(definition.name, {\n definition,\n ...(complete !== undefined && { complete }),\n callback: callback as ResourceTemplateCallback<\n Record<string, TemplateVariableValue>,\n TUser,\n HasOAuth<TUser>\n >,\n });\n return this;\n }\n\n /**\n * Register a prompt template. Schema fields wrapped with `completable()`\n * gain autocomplete via `completion/complete`.\n */\n prompt<T extends PromptDefinition>(\n definition: T,\n callback: PromptCallback<InferPromptInput<T>, TUser, HasOAuth<TUser>>\n ): this {\n this.#assertNotStarted(\"prompt\", definition.name);\n this.#prompts.set(definition.name, {\n definition,\n callback: callback as PromptCallback<\n Record<string, unknown>,\n TUser,\n HasOAuth<TUser>\n >,\n });\n return this;\n }\n\n /**\n * Web-standard request handler for the whole app (MCP endpoint included) —\n * usable directly on serverless/edge runtimes or in tests.\n *\n * The handler never binds a socket, so no Host/Origin validation applies\n * by default: DNS rebinding targets locally bound servers, and platform\n * edges (Vercel, Cloudflare, …) only route hostnames assigned to the\n * deployment. Set `allowedHosts`/`allowedOrigins` to opt into validation\n * (additive — localhost-class values stay allowed).\n *\n * Pass the same `bus` to multiple server instances when their handlers\n * replace one another while existing `subscriptions/listen` streams remain\n * open. The bus is fixed when this instance first mounts.\n *\n * @param options - Optional handler wiring.\n *\n * @example\n * ```ts\n * const handler = server.getHandler();\n * export default { fetch: handler };\n * ```\n */\n getHandler(options: { bus?: ServerEventBus } = {}): FrameworkHandler {\n const { fetch } = this.#ensureMounted(\"handler\", undefined, options.bus);\n return toFrameworkHandler(fetch);\n }\n\n /**\n * Node `(req, res) => void` handler for composing with an existing\n * `http.Server`. Uses the same internal `toNodeHandler` bridge as\n * {@link MCPServer.listen}; MCPServer users do not need to import\n * `mcp-use/node`.\n *\n * @example\n * ```ts\n * import { createServer } from \"node:http\";\n * const httpServer = createServer(await server.getNodeHandler());\n * httpServer.listen(3000);\n * ```\n */\n async getNodeHandler(): Promise<NodeRequestHandler> {\n const { fetch } = this.#ensureMounted(\"handler\");\n const { toNodeHandler } = await import(\"./node-bridge.js\");\n return toNodeHandler({ fetch });\n }\n\n /**\n * Register MCP operation middleware that intercepts JSON-RPC dispatch.\n *\n * Patterns use an `mcp:` prefix (for example `mcp:tools/call`, `mcp:*`).\n * Middleware runs in registration order; call `next()` to continue the chain.\n *\n * @example\n * ```ts\n * server.use(\"mcp:tools/call\", async (ctx, next) => {\n * console.log(`Calling tool: ${ctx.params.name}`);\n * return next();\n * });\n * ```\n */\n use<P extends string>(\n pattern: `mcp:${P}` | P,\n handler: McpMiddlewareFnFor<P>\n ): this {\n this.#assertNotStarted(\"middleware\", pattern);\n this.#mcpMiddlewares.push({\n pattern: normalizeMcpMiddlewarePattern(pattern),\n handler: handler as McpMiddlewareFn,\n });\n return this;\n }\n\n /**\n * Register a read-only MCP observer. Unlike {@link MCPServer.use}, listeners\n * cannot block, override, or mutate params. Throwing is logged and does not\n * fail the request.\n *\n * Append `:complete` to run after the handler (for example\n * `mcp:tools/call:complete`).\n *\n * @example\n * ```ts\n * server.on(\"mcp:tools/call\", (ctx) => {\n * metrics.increment(\"tools.call\", { tool: ctx.params.name });\n * });\n * ```\n */\n on<P extends string>(\n pattern: `mcp:${P}` | P,\n handler: P extends `${string}:complete`\n ? McpCompleteEventListenerFn\n : McpEventListenerFn\n ): this {\n this.#assertNotStarted(\"event listener\", pattern);\n const { pattern: stripped, phase } = parseMcpPattern(pattern);\n this.#mcpEventListeners.push({\n pattern: stripped,\n phase,\n handler: handler as McpEventListenerFn | McpCompleteEventListenerFn,\n });\n return this;\n }\n\n /**\n * Publish a tools-list change to v2 clients with active subscriptions.\n *\n * @example\n * ```ts\n * await server.notifyToolsChanged();\n * ```\n */\n async notifyToolsChanged(): Promise<void> {\n await this.#ensureMounted(\"handler\").handler.notify.toolsChanged();\n }\n\n /**\n * Publish a prompts-list change to v2 clients with active subscriptions.\n *\n * @example\n * ```ts\n * await server.notifyPromptsChanged();\n * ```\n */\n async notifyPromptsChanged(): Promise<void> {\n await this.#ensureMounted(\"handler\").handler.notify.promptsChanged();\n }\n\n /**\n * Publish a resources-list change to v2 clients with active subscriptions.\n *\n * @example\n * ```ts\n * await server.notifyResourcesChanged();\n * ```\n */\n async notifyResourcesChanged(): Promise<void> {\n await this.#ensureMounted(\"handler\").handler.notify.resourcesChanged();\n }\n\n /**\n * Publish a resource update to subscribed v2 clients.\n *\n * @param uri - Resource URI whose representation changed.\n *\n * @example\n * ```ts\n * await server.notifyResourceUpdated(\"config://settings\");\n * ```\n */\n async notifyResourceUpdated(uri: string): Promise<void> {\n await this.#ensureMounted(\"handler\").handler.notify.resourceUpdated(uri);\n }\n\n /**\n * Serve over HTTP on Node. Pass port `0` for an ephemeral port.\n *\n * Binds `config.host` (default `127.0.0.1`). Localhost-class binds get\n * DNS-rebinding protection automatically: `Host` on every request,\n * `Origin` only on non-GET/HEAD (sandboxed view iframes send\n * `Origin: null` on asset GETs). To serve publicly set `host: \"0.0.0.0\"`;\n * behind a platform edge that is all that's needed, and `allowedHosts`\n * restricts direct exposure (additive — localhost-class values stay allowed).\n *\n * With OAuth and no explicit resource or `MCP_URL`, a localhost listener\n * derives its protected-resource URL from the actual bound port. Mounting\n * therefore waits for the listener callback (especially for port `0`), and\n * requests accepted before then are queued. Public/wildcard listeners must\n * configure the resource before calling this method.\n *\n * @throws If called on a localhost-class bind after {@link MCPServer.getHandler}\n * already mounted the app without Host validation.\n */\n async listen(port = 3000): Promise<{ port: number; url: string }> {\n this.#assertListenOAuthConfiguration();\n const { createServer } = await import(\"node:http\");\n const { toNodeHandler } = await import(\"./node-bridge.js\");\n const host = this.#config.host ?? \"127.0.0.1\";\n\n return new Promise((resolve, reject) => {\n let resolveFetch: ((fetch: FetchHandler) => void) | undefined;\n let rejectFetch: ((error: unknown) => void) | undefined;\n const fetchReady = new Promise<FetchHandler>(\n (resolveFetchPromise, rejectFetchPromise) => {\n resolveFetch = resolveFetchPromise;\n rejectFetch = rejectFetchPromise;\n }\n );\n void fetchReady.catch(() => undefined);\n\n let settled = false;\n const rejectAndClose = (error: unknown) => {\n if (!settled) {\n settled = true;\n reject(error);\n }\n rejectFetch?.(error);\n void new Promise<void>((closeResolve) =>\n server.close(() => closeResolve())\n )\n .catch(() => undefined)\n .finally(() => {\n if (this.#httpServer === server) {\n this.#httpServer = undefined;\n }\n });\n };\n\n const nodeHandler = toNodeHandler({\n fetch: async (request) => (await fetchReady)(request),\n });\n const server = createServer((req, res) => {\n void nodeHandler(req, res);\n }) as NodeHttpListener;\n\n server.once(\"error\", rejectAndClose);\n server.listen(port, host, () => {\n try {\n const address = server.address();\n const boundPort =\n typeof address === \"object\" && address !== null\n ? address.port\n : port;\n const { fetch } = this.#ensureMounted(\"listen\", boundPort);\n resolveFetch?.(fetch);\n if (!settled) {\n settled = true;\n resolve({\n port: boundPort,\n url: `http://localhost:${boundPort}${this.#basePath()}`,\n });\n }\n } catch (error) {\n rejectAndClose(error);\n }\n });\n this.#httpServer = server;\n });\n }\n\n /**\n * Abort in-flight MCP exchanges and stop the HTTP listener.\n *\n * A closed server is done for good — the underlying MCP handler stays\n * closed, so `listen()`/`getHandler()` cannot revive it. Create a new\n * instance to serve again.\n */\n async close(): Promise<void> {\n await this.#handler?.close();\n const httpServer = this.#httpServer;\n if (httpServer !== undefined) {\n await new Promise<void>((resolve, reject) => {\n httpServer.close((err) => (err ? reject(err) : resolve()));\n });\n this.#httpServer = undefined;\n }\n }\n\n #basePath(): string {\n return this.#config.basePath ?? \"/mcp\";\n }\n\n #resolveOAuthResource(\n mode: \"listen\" | \"handler\",\n listenPort?: number\n ): URL | undefined {\n if (this.#config.oauth === undefined) {\n return undefined;\n }\n if (this.#oauthResourceResolved) {\n return this.#oauthResource;\n }\n\n const host = this.#config.host ?? \"127.0.0.1\";\n const localListen =\n mode === \"listen\" &&\n listenPort !== undefined &&\n [\"127.0.0.1\", \"localhost\", \"::1\"].includes(host);\n if (this.#oauthResourceConfigurationAbsent && localListen) {\n this.#oauthResource = resolveLocalOAuthResource(\n `http://localhost:${listenPort}`,\n this.#basePath()\n );\n this.#oauthResourceResolved = true;\n return this.#oauthResource;\n }\n\n throw new Error(\n \"OAuth requires an explicit resource or MCP_URL when using getHandler() or listening on a non-local host\"\n );\n }\n\n #assertListenOAuthConfiguration(): void {\n if (this.#config.oauth === undefined) {\n return;\n }\n const host = this.#config.host ?? \"127.0.0.1\";\n if ([\"127.0.0.1\", \"localhost\", \"::1\"].includes(host)) {\n return;\n }\n if (!this.#oauthResourceResolved) {\n // Public/wildcard listeners have no stable local fallback. Their\n // configured resource was already validated during construction.\n throw new Error(\n \"OAuth listen() on a public or wildcard host requires an explicit provider resource or valid MCP_URL.\"\n );\n }\n }\n\n #assertNotStarted(kind: string, name: string): void {\n if (this.#handler !== undefined) {\n throw new Error(\n `Cannot register ${kind} \"${name}\" after the server has started: ` +\n `registrations are replayed per request from the registry, ` +\n `so register everything before listen()/getHandler().`\n );\n }\n }\n\n /**\n * Effective Host/Origin allowlists for a mount mode; `undefined` means the\n * corresponding validation is off.\n *\n * Configured lists are additive to the localhost-class allowlists, so local\n * runs keep working when a deployment hostname is added. With nothing\n * configured, `listen()` on a localhost-class bind validates against the\n * localhost lists (the DNS-rebinding threat model), while `getHandler()` —\n * which never binds — applies no validation. `allowedOrigins` defaults to\n * mirroring the effective Host allowlist. Origin validation runs only on\n * non-GET/HEAD requests.\n */\n #validationPolicy(mode: \"listen\" | \"handler\"): {\n hosts: string[] | undefined;\n origins: string[] | undefined;\n } {\n const { host = \"127.0.0.1\", allowedHosts, allowedOrigins } = this.#config;\n const localhostBind = [\"127.0.0.1\", \"localhost\", \"::1\"].includes(host);\n const hosts =\n allowedHosts !== undefined\n ? [...new Set([...localhostAllowedHostnames(), ...allowedHosts])]\n : mode === \"listen\" && localhostBind\n ? localhostAllowedHostnames()\n : undefined;\n const origins =\n allowedOrigins !== undefined\n ? [...new Set([...localhostAllowedOrigins(), ...allowedOrigins])]\n : hosts;\n return { hosts, origins };\n }\n\n #ensureMounted(\n mode: \"listen\" | \"handler\",\n listenPort?: number,\n bus?: ServerEventBus\n ): {\n fetch: FetchHandler;\n handler: McpHttpHandler;\n } {\n if (this.#fetchHandler === undefined || this.#handler === undefined) {\n const { hosts, origins } = this.#validationPolicy(mode);\n const basePath = this.#basePath();\n const nestedBasePath = basePath === \"/\" ? \"\" : basePath;\n const middlewares = [\n jsonBodyMiddleware(),\n requestLogger(this.#config.logging),\n ];\n\n const corsConfig = this.#config.cors;\n if (corsConfig !== undefined) {\n middlewares.unshift(corsFetchMiddleware(corsConfig));\n }\n const deferViewCors = isGlobalCorsEnabled(corsConfig);\n\n if (hosts !== undefined) {\n middlewares.unshift(hostValidationMiddleware(hosts));\n middlewares.push(originValidationMiddleware(origins ?? hosts));\n } else {\n if (origins !== undefined) {\n middlewares.push(originValidationMiddleware(origins));\n }\n if (mode === \"listen\") {\n console.warn(\n `[mcp-use] listen() is serving on ${this.#config.host} without ` +\n `Host validation. Behind a platform edge that only routes your ` +\n `own domains this is expected; if this process is reachable ` +\n `directly, set allowedHosts to restrict it.`\n );\n }\n }\n\n this.#validateViewBindingsAtMount();\n\n const resource = this.#resolveOAuthResource(mode, listenPort);\n if (resource !== undefined) {\n const provider = this.#config.oauth!;\n middlewares.push(oauthMetadata(provider, resource));\n }\n\n const { handler, fetch: mcpFetch } = createMcpMount(\n (ctx) => this.#buildSdkServer(ctx),\n {\n path: basePath,\n ...((this.#config.legacy !== undefined || bus !== undefined) && {\n handler: {\n ...(this.#config.legacy !== undefined && {\n legacy: this.#config.legacy,\n }),\n ...(bus !== undefined && { bus }),\n },\n }),\n ...(resource !== undefined && {\n authInfo: (request) => authInfoFromRequest(request),\n }),\n }\n );\n\n let protectWithBearer: (\n request: Request,\n next: () => Promise<Response>\n ) => Promise<Response> = async (_request, next) => next();\n if (resource !== undefined) {\n const provider = this.#config.oauth!;\n const providerOptions = getOAuthProviderOptions(provider);\n const gate = requireBearerAuth({\n verifier: wrapOAuthTokenVerifier(provider, resource),\n resourceMetadataUrl: getOAuthProtectedResourceMetadataUrl(resource),\n ...(providerOptions.requiredScopes !== undefined && {\n requiredScopes: providerOptions.requiredScopes,\n }),\n });\n protectWithBearer = async (request, next) => {\n const result = await gate(request);\n if (result instanceof Response) {\n return result;\n }\n const bag = getRequestBag(request);\n bag.authInfo = result;\n return next();\n };\n }\n\n const mcpRouteHandler: FetchHandler = (request) =>\n protectWithBearer(request, () => mcpFetch(request));\n const endpointHandler: FetchHandler = async (request) => {\n if (!isHtmlNavigationRequest(request)) {\n return mcpRouteHandler(request);\n }\n const respond = async (): Promise<Response> => {\n const { createLandingPageResponse } =\n await import(\"./landing-handler.js\");\n return createLandingPageResponse(\n request,\n basePath,\n this.#config,\n this.#tools.values(),\n this.#prompts.values(),\n this.#resources.values()\n );\n };\n if (resource !== undefined && this.#config.publicLandingPage !== true) {\n return protectWithBearer(request, respond);\n }\n return respond();\n };\n\n const routes: Array<{\n match: (request: Request) => boolean;\n handler: FetchHandler;\n }> = [];\n\n const viewHandler = createViewPublicHandler(basePath, this.#views, {\n dev: this.#viewsDevMode,\n projectRoot: this.#viewsProjectRoot,\n deferCors: deferViewCors,\n });\n if (viewHandler !== undefined) {\n routes.push({\n match: (request) =>\n request.method === \"GET\" || request.method === \"HEAD\"\n ? new URL(request.url).pathname.startsWith(\n `${nestedBasePath}/_mcp-use/public/`\n )\n : false,\n handler: viewHandler,\n });\n }\n\n if (!this.#viewsDevMode) {\n const viewAssetsHandler = createViewAssetsHandler(\n basePath,\n this.#views,\n { projectRoot: this.#viewsProjectRoot, deferCors: deferViewCors }\n );\n if (viewAssetsHandler !== undefined) {\n routes.push({\n match: (request) =>\n request.method === \"GET\" || request.method === \"HEAD\"\n ? new URL(request.url).pathname.startsWith(\n `${nestedBasePath}/_mcp-use/views/`\n )\n : false,\n handler: viewAssetsHandler,\n });\n }\n }\n\n const inspectorHandler = createInspectorHandler(this.#config.inspector, {\n serverName: this.#config.name,\n basePath,\n });\n if (inspectorHandler !== undefined) {\n routes.push({\n match: (request) => {\n if (request.method !== \"GET\" && request.method !== \"HEAD\") {\n return false;\n }\n const pathname = new URL(request.url).pathname;\n return matchesInspectorShellPath(pathname, basePath);\n },\n handler: inspectorHandler,\n });\n }\n\n routes.push({\n match: (request) => matchesPath(request, basePath),\n handler: endpointHandler,\n });\n\n const terminal = routeFetch(routes);\n this.#fetchHandler = composeFetch(terminal, ...middlewares);\n this.#handler = handler;\n this.#hostValidated = hosts !== undefined;\n } else if (bus !== undefined && this.#handler.bus !== bus) {\n throw new Error(\n \"Cannot change the MCP event bus after the server has started.\"\n );\n } else if (\n mode === \"listen\" &&\n !this.#hostValidated &&\n this.#validationPolicy(\"listen\").hosts !== undefined\n ) {\n throw new Error(\n \"Cannot listen() on a localhost bind after getHandler(): the app is \" +\n \"already mounted without Host validation (getHandler() expects a \" +\n \"platform edge in front). Call listen() first, or set allowedHosts.\"\n );\n }\n return { fetch: this.#fetchHandler, handler: this.#handler };\n }\n\n #validateToolViewBinding(definition: ToolDefinition): void {\n const view = definition.view;\n if (view === undefined) {\n return;\n }\n if (definition.outputSchema === undefined) {\n throw new Error(\n `Tool \"${definition.name}\" declares view \"${view.name}\" but has no outputSchema. ` +\n `View-bound tools require an outputSchema — the view reads structuredContent typed from it. ` +\n `Use outputSchema: z.object({}) for a view that takes no structured output.`\n );\n }\n\n const existing = this.#viewBindings.get(view.name);\n if (existing !== undefined) {\n throw new Error(\n `View \"${view.name}\" is already bound to tool \"${existing.toolName}\"; ` +\n `tool \"${definition.name}\" cannot bind the same view. ` +\n `Each view may be bound to one tool.`\n );\n }\n\n this.#viewBindings.set(view.name, {\n toolName: definition.name,\n config: view,\n });\n }\n\n #validateViewBindingsAtMount(): void {\n if (this.#viewBindings.size > 0 && !this.#viewsPrimed) {\n const first = [...this.#tools.values()].find(\n (entry) => entry.definition.view !== undefined\n );\n const viewName = first?.definition.view?.name ?? \"unknown\";\n throw new Error(\n `Tool \"${first?.definition.name ?? \"unknown\"}\" is bound to view \"${viewName}\" ` +\n `but no views were primed. Run \\`mcp-use build\\` and deploy the built entry, ` +\n `or in dev let the CLI prime views automatically.`\n );\n }\n\n for (const entry of this.#tools.values()) {\n const viewName = entry.definition.view?.name;\n if (viewName !== undefined && !this.#views.has(viewName)) {\n throw new Error(\n `Tool \"${entry.definition.name}\" is bound to view \"${viewName}\" ` +\n `which is not in the primed views registry. Run \\`mcp-use build\\` ` +\n `and deploy the built entry, or in dev let the CLI prime views automatically.`\n );\n }\n }\n\n for (const viewName of this.#views.keys()) {\n if (!this.#viewBindings.has(viewName)) {\n console.warn(\n `[mcp-use] View \"${viewName}\" is registered but no tool binds it.`\n );\n }\n }\n }\n\n /** Build a fresh SDK server from the registry (runs once per request). */\n #buildSdkServer(ctx: McpRequestContext): SdkMcpServer {\n const { name, version, title, description, instructions } = this.#config;\n const authInfo = ctx.authInfo;\n const server = new SdkMcpServer(\n {\n name,\n version,\n ...(title !== undefined && { title }),\n ...(description !== undefined && { description }),\n },\n {\n capabilities: {\n tools: { listChanged: true },\n prompts: { listChanged: true },\n resources: { listChanged: true, subscribe: true },\n },\n ...(instructions !== undefined && { instructions }),\n ...(authInfo !== undefined && { authInfo }),\n ...(this.#config.requestState !== undefined && {\n requestState: this.#config.requestState,\n }),\n }\n );\n\n const request = ctx.requestInfo;\n const viewMetaOptions =\n request !== undefined\n ? { request, hmrWs: this.#viewsDevMode }\n : { hmrWs: this.#viewsDevMode };\n const basePath = this.#basePath();\n\n for (const entry of this.#tools.values()) {\n this.#registerTool(server, entry);\n }\n for (const entry of this.#resources.values()) {\n this.#registerResource(server, entry);\n }\n for (const entry of this.#resourceTemplates.values()) {\n this.#registerResourceTemplate(server, entry);\n }\n for (const entry of this.#prompts.values()) {\n this.#registerPrompt(server, entry);\n }\n for (const [viewName, viewEntry] of this.#views.entries()) {\n this.#registerViewResource(\n server,\n viewName,\n viewEntry,\n viewMetaOptions,\n basePath\n );\n }\n this.#wrapListHandlers(server);\n return server;\n }\n\n #createMiddlewareContext(\n method: string,\n params: Record<string, unknown>,\n ctx: ServerContext\n ): MiddlewareContext {\n return {\n method,\n params,\n ...(ctx.http?.authInfo !== undefined && { auth: ctx.http.authInfo }),\n state: new Map(),\n };\n }\n\n #runMcpHook(\n method: string,\n ctx: MiddlewareContext,\n innerFn: () => Promise<unknown>\n ): Promise<unknown> {\n return runMcpOperation(\n this.#mcpMiddlewares,\n this.#mcpEventListeners,\n method,\n ctx,\n innerFn\n );\n }\n\n /**\n * Wrap native SDK list handlers with the MCP middleware chain.\n *\n * ponytail: uses SDK-private `_requestHandlers`; pin compile-time test.\n *\n * @internal\n */\n #wrapListHandlers(server: SdkMcpServer): void {\n type RequestHandler = (\n request: unknown,\n extra: unknown\n ) => Promise<unknown>;\n const handlers = (\n server.server as unknown as {\n _requestHandlers?: Map<string, RequestHandler>;\n }\n )._requestHandlers;\n if (handlers === undefined) {\n return;\n }\n\n const wrapListMethod = (\n method: \"tools/list\" | \"resources/list\" | \"prompts/list\",\n resultKey: \"tools\" | \"resources\" | \"prompts\"\n ) => {\n const original = handlers.get(method);\n if (original === undefined) {\n return;\n }\n if ((original as { __mcpListWrapped?: boolean }).__mcpListWrapped) {\n return;\n }\n\n const wrapped = async (request: unknown, extra: unknown) => {\n const authInfo = (\n extra as { http?: { authInfo?: AuthInfo } } | undefined\n )?.http?.authInfo;\n const mwCtx: MiddlewareContext = {\n method,\n params: {},\n ...(authInfo !== undefined && { auth: authInfo }),\n state: new Map(),\n };\n const innerFn = async () => {\n const result = (await original(request, extra)) as Record<\n string,\n unknown\n >;\n return result[resultKey] ?? result;\n };\n const filtered = await this.#runMcpHook(method, mwCtx, innerFn);\n if (Array.isArray(filtered)) {\n return { [resultKey]: filtered };\n }\n return filtered;\n };\n (wrapped as { __mcpListWrapped?: boolean }).__mcpListWrapped = true;\n handlers.set(method, wrapped);\n };\n\n wrapListMethod(\"tools/list\", \"tools\");\n wrapListMethod(\"resources/list\", \"resources\");\n wrapListMethod(\"prompts/list\", \"prompts\");\n }\n\n #registerTool(\n server: SdkMcpServer,\n { definition, callback }: ToolEntry<TUser>\n ): void {\n const view = definition.view;\n\n const toolMeta = buildToolUiMeta(\n view?.name,\n definition.visibility,\n definition._meta\n );\n const config = {\n ...(definition.title !== undefined && { title: definition.title }),\n ...(definition.description !== undefined && {\n description: definition.description,\n }),\n ...(definition.annotations !== undefined && {\n annotations: definition.annotations,\n }),\n ...(definition.outputSchema !== undefined && {\n outputSchema: definition.outputSchema,\n }),\n ...(toolMeta !== undefined && { _meta: toolMeta }),\n };\n const wireResultMeta =\n view !== undefined ? buildToolResultUiMeta(view.name) : undefined;\n\n const inputSchema = resolveToolInputSchema(definition);\n\n const invokeTool = async (\n args: Record<string, unknown>,\n ctx: ServerContext\n ) => {\n const mwCtx = this.#createMiddlewareContext(\n \"tools/call\",\n { name: definition.name, arguments: args },\n ctx\n );\n const innerFn = async () => {\n const effectiveArgs = (mwCtx.params.arguments ?? {}) as Record<\n string,\n unknown\n >;\n const result = await callback(\n effectiveArgs,\n this.#toRequestContext(ctx)\n );\n if (\n isInputRequiredResult(result) ||\n wireResultMeta === undefined ||\n result.isError === true\n ) {\n return result;\n }\n return {\n ...result,\n _meta: { ...result._meta, ...wireResultMeta },\n };\n };\n return (await this.#runMcpHook(\"tools/call\", mwCtx, innerFn)) as Awaited<\n ReturnType<typeof callback>\n >;\n };\n\n if (inputSchema !== undefined) {\n server.registerTool(\n definition.name,\n { ...config, inputSchema },\n async (args, ctx) => invokeTool(args as Record<string, unknown>, ctx)\n );\n } else {\n server.registerTool(definition.name, config, async (ctx) =>\n invokeTool({}, ctx)\n );\n }\n }\n\n #registerViewResource(\n server: SdkMcpServer,\n viewName: string,\n entry: ViewManifestEntry,\n metaOptions: { request?: Request; hmrWs?: boolean },\n basePath: string\n ): void {\n const uri = viewResourceUri(viewName);\n const authorFacts = this.#viewResourceFacts(\n this.#viewBindings.get(viewName)?.config\n );\n const resourceConfig = viewResourceConfig(\n viewName,\n entry,\n authorFacts,\n metaOptions\n );\n server.registerResource(\n viewName,\n uri,\n resourceConfig,\n async (readUri, ctx) => {\n const req = ctx.http?.req;\n const readOptions: BuildResourceUiMetaOptions =\n req !== undefined\n ? {\n request: req,\n ...(metaOptions.hmrWs === true ? { hmrWs: true } : {}),\n }\n : metaOptions.hmrWs === true\n ? { hmrWs: true }\n : {};\n const assetsBase =\n req !== undefined\n ? resolveAssetsBase(req)\n : metaOptions.request !== undefined\n ? resolveAssetsBase(metaOptions.request)\n : \"\";\n const html = synthesizeViewDocument(\n entry,\n assetsBase,\n basePath,\n viewName\n );\n return {\n contents: [\n {\n uri: readUri.href,\n mimeType: resourceConfig.mimeType,\n text: html,\n _meta: buildResourceUiMeta(authorFacts, readOptions),\n },\n ],\n };\n }\n );\n }\n\n #registerResource(\n server: SdkMcpServer,\n { definition, callback }: ResourceEntry<TUser>\n ): void {\n server.registerResource(\n definition.name,\n definition.uri,\n {\n ...(definition.title !== undefined && { title: definition.title }),\n ...(definition.description !== undefined && {\n description: definition.description,\n }),\n ...(definition.mimeType !== undefined && {\n mimeType: definition.mimeType,\n }),\n ...(definition.annotations !== undefined && {\n annotations: definition.annotations,\n }),\n ...(definition._meta !== undefined && {\n _meta: { ...definition._meta },\n }),\n },\n async (uri, ctx) => {\n const mwCtx = this.#createMiddlewareContext(\n \"resources/read\",\n { uri: uri.href },\n ctx\n );\n const innerFn = async () => callback(uri, this.#toRequestContext(ctx));\n return (await this.#runMcpHook(\n \"resources/read\",\n mwCtx,\n innerFn\n )) as Awaited<ReturnType<typeof callback>>;\n }\n );\n }\n\n #registerResourceTemplate(\n server: SdkMcpServer,\n { definition, callback, complete }: ResourceTemplateEntry<TUser>\n ): void {\n const template = new ResourceTemplate(definition.uriTemplate, {\n list: undefined,\n ...(complete !== undefined && { complete }),\n });\n server.registerResource(\n definition.name,\n template,\n {\n ...(definition.title !== undefined && { title: definition.title }),\n ...(definition.description !== undefined && {\n description: definition.description,\n }),\n ...(definition.mimeType !== undefined && {\n mimeType: definition.mimeType,\n }),\n ...(definition.annotations !== undefined && {\n annotations: definition.annotations,\n }),\n ...(definition._meta !== undefined && {\n _meta: { ...definition._meta },\n }),\n },\n async (uri, variables, ctx) => {\n const mwCtx = this.#createMiddlewareContext(\n \"resources/read\",\n { uri: uri.href },\n ctx\n );\n const innerFn = async () =>\n callback(\n uri,\n variables as Record<string, TemplateVariableValue>,\n this.#toRequestContext(ctx)\n );\n return (await this.#runMcpHook(\n \"resources/read\",\n mwCtx,\n innerFn\n )) as Awaited<ReturnType<typeof callback>>;\n }\n );\n }\n\n #viewResourceFacts(\n viewConfig: ToolViewConfig | undefined\n ): ViewResourceFacts | undefined {\n if (viewConfig === undefined) {\n return undefined;\n }\n return {\n ...(viewConfig.description !== undefined && {\n description: viewConfig.description,\n }),\n ...(viewConfig.csp !== undefined && { csp: viewConfig.csp }),\n ...(viewConfig.permissions !== undefined && {\n permissions: viewConfig.permissions,\n }),\n ...(viewConfig.domain !== undefined && { domain: viewConfig.domain }),\n ...(viewConfig.prefersBorder !== undefined && {\n prefersBorder: viewConfig.prefersBorder,\n }),\n };\n }\n\n #registerPrompt(\n server: SdkMcpServer,\n { definition, callback }: PromptEntry<TUser>\n ): void {\n const config = {\n ...(definition.title !== undefined && { title: definition.title }),\n ...(definition.description !== undefined && {\n description: definition.description,\n }),\n };\n const invokePrompt = async (\n args: Record<string, unknown>,\n ctx: ServerContext\n ) => {\n const mwCtx = this.#createMiddlewareContext(\n \"prompts/get\",\n { name: definition.name, arguments: args as Record<string, string> },\n ctx\n );\n const innerFn = async () => {\n const effectiveArgs = (mwCtx.params.arguments ?? {}) as Record<\n string,\n unknown\n >;\n return callback(effectiveArgs, this.#toRequestContext(ctx));\n };\n return (await this.#runMcpHook(\"prompts/get\", mwCtx, innerFn)) as Awaited<\n ReturnType<typeof callback>\n >;\n };\n\n if (definition.schema !== undefined) {\n server.registerPrompt(\n definition.name,\n { ...config, argsSchema: definition.schema },\n async (args, ctx) => invokePrompt(args as Record<string, unknown>, ctx)\n );\n } else {\n const handler = async (ctx: ServerContext) => invokePrompt({}, ctx);\n server.registerPrompt(\n definition.name,\n config,\n handler as unknown as SdkPromptCallback<StandardSchemaWithJSON>\n );\n }\n }\n\n #toRequestContext(\n ctx: ServerContext\n ): RequestContext<TUser, HasOAuth<TUser>> {\n if (this.#config.oauth === undefined) {\n return toRequestContext(ctx) as RequestContext<TUser, HasOAuth<TUser>>;\n }\n return toAuthenticatedRequestContext<TUser>(ctx) as RequestContext<\n TUser,\n HasOAuth<TUser>\n >;\n }\n}\n","import type { ServerOptions } from \"@modelcontextprotocol/server\";\n\nimport type { LoggingOptions } from \"./logging.js\";\nimport type { OAuthProvider } from \"./oauth/index.js\";\n\n/**\n * Options for the inspector shell route — the shape of\n * {@link ServerConfig.inspector}.\n */\nexport interface InspectorOptions {\n /**\n * Whether the inspector shell route is mounted.\n *\n * @defaultValue `true`\n */\n enabled?: boolean;\n /**\n * Full replacement URL for the inspector bundle script (FastAPI's\n * `swagger_js_url` analog). The shell's `<script type=\"module\">` loads\n * exactly this URL, so it must point at a complete copy of the\n * `@mcp-use/inspector` CDN bundle (`dist/cdn/inspector.js`) — self-host it\n * for air-gapped environments where the public CDN is unreachable.\n *\n * @defaultValue The mcp-use CDN URL for the `@mcp-use/inspector` bundle,\n * pinned to the current version.\n */\n assetsUrl?: string;\n /**\n * Hosted managed-chat backend URL (injected as `window.__MANUFACT_CHAT_URL__`).\n * Defaults to `process.env.MANUFACT_CHAT_URL` when the shell is mounted.\n */\n manufactChatUrl?: string;\n}\n\n/**\n * Common server identity and behavior, passed to `new MCPServer(...)`.\n *\n * Includes the fields consumed by the core HTTP and OAuth resource-server\n * wiring. Other legacy configuration is added with the feature that reads it.\n */\ninterface BaseServerConfig {\n /** Server name reported to clients during negotiation. */\n name: string;\n /** Server version reported to clients. */\n version: string;\n /** Human-readable display name (falls back to `name`). */\n title?: string;\n /**\n * Human-readable description of the server, reported to clients as\n * implementation metadata during negotiation.\n */\n description?: string;\n /** Usage instructions surfaced to the model by clients. */\n instructions?: string;\n /**\n * Route path the MCP endpoint is served on.\n *\n * Must be an absolute URL pathname: starts with `/`, and contains no `?`,\n * `#`, whitespace, empty path segments (`//`), or trailing slash (except\n * for the root path `/`).\n *\n * @defaultValue `\"/mcp\"`\n * @throws TypeError When the value fails the pathname rules above\n * (validated by {@link assertServerConfig}).\n */\n basePath?: string;\n /**\n * Hostname `listen()` binds. Defaults to `127.0.0.1`; localhost-class\n * binds get DNS-rebinding protection (`Host` on every request; `Origin`\n * only on non-GET/HEAD) automatically. Set `\"0.0.0.0\"` to serve publicly — behind a platform\n * edge (Railway, Fly, …) nothing more is needed, since the edge only\n * routes hostnames assigned to the deployment. Ignored by `getHandler()`,\n * which never binds.\n */\n host?: string;\n /**\n * Extra allowed hostnames for Host-header validation (DNS-rebinding\n * protection), e.g. `[\"api.example.com\"]`. Port-agnostic and additive:\n * localhost-class hostnames stay allowed, so local runs keep working\n * unmodified. Setting this also turns Host validation on for\n * `getHandler()`, which otherwise applies none.\n */\n allowedHosts?: string[];\n /**\n * Extra allowed origin hostnames for Origin-header validation\n * (port-agnostic, additive to the localhost-class origins). When unset,\n * mirrors the effective Host allowlist. Origin is validated only on\n * non-GET/HEAD requests (sandboxed view iframes send `Origin: null` on\n * asset GETs; the MCP wire is POST). Requests without an `Origin` header\n * always pass (non-browser MCP clients don't send one).\n */\n allowedOrigins?: string[];\n /**\n * How 2025-era (non-envelope) requests are served.\n *\n * `\"stateless\"` answers each legacy request with a fresh instance over a\n * session-less streamable HTTP transport (2025 session operations — GET and\n * DELETE — get `405`). `\"reject\"` is modern-only strict: legacy-classified\n * requests are refused with the unsupported-protocol-version error naming\n * the supported revisions.\n *\n * @defaultValue `\"stateless\"`\n */\n legacy?: \"stateless\" | \"reject\";\n /**\n * Expose the HTML landing page without bearer authentication when OAuth is\n * configured.\n *\n * The landing page itself is always mounted at `basePath` for browser GET\n * and HEAD requests that explicitly accept `text/html`. Without OAuth it is\n * public. With OAuth, it requires a valid bearer token unless this option is\n * `true`. MCP protocol requests remain protected in either case.\n *\n * @defaultValue `false`\n */\n publicLandingPage?: boolean;\n /**\n * Inspector shell route at `${basePath}/inspector` — a browser UI for\n * exploring and calling the server's tools, resources, and prompts.\n *\n * @remarks\n * Follows the FastAPI `/docs` model: the server itself ships only a tiny\n * dependency-free HTML page whose `<script type=\"module\">` loads the\n * `@mcp-use/inspector` bundle from a CDN (pinned to the current inspector\n * version), so the UI updates independently of SDK releases and adds\n * nothing to the install. The page tells the inspector to connect to this\n * server's MCP endpoint at `basePath`, deriving the URL from the browser's\n * own origin.\n *\n * Enabled by default; set `{ enabled: false }` to disable the route, or\n * pass `{ assetsUrl }` to load the bundle from a self-hosted copy instead\n * of the public CDN (air-gapped environments). For local development,\n * `MCP_USE_INSPECTOR_ASSETS_URL` provides the same override without changing\n * application code; an explicit `assetsUrl` takes precedence.\n *\n * @example\n * ```ts\n * // Default: inspector served at /mcp/inspector from the public CDN.\n * new MCPServer({ name: \"my-server\", version: \"1.0.0\" });\n *\n * // Disabled:\n * new MCPServer({\n * name: \"my-server\",\n * version: \"1.0.0\",\n * inspector: { enabled: false },\n * });\n *\n * // Air-gapped: load a self-hosted copy of the inspector bundle.\n * new MCPServer({\n * name: \"my-server\",\n * version: \"1.0.0\",\n * inspector: { assetsUrl: \"https://intranet.example.com/inspector.js\" },\n * });\n * ```\n */\n inspector?: InspectorOptions;\n /**\n * HTTP/MCP request logging: one summary line per request plus an indented\n * detail line naming the MCP method, its subject (tool name, resource URI,\n * prompt name), and the calling client.\n *\n * Enabled at the `info` level by default, which prints no request or\n * response payloads. Set `{ enabled: false }` to disable,\n * `{ level: \"debug\" }` to echo compact truncated tool/prompt input and\n * tool output on the detail line, or `{ level: \"trace\" }` for debug plus\n * full request/response header and body dumps. The `MCP_USE_LOG_LEVEL`\n * environment variable (`info` | `debug` | `trace`) overrides the\n * configured level.\n */\n logging?: LoggingOptions;\n /**\n * Integrity verification for `requestState` echoed across\n * `input_required` rounds.\n *\n * Use the SDK's `createRequestStateCodec(...).verify` here when state\n * affects authorization, resource access, or business logic. Without a\n * verifier, {@link RequestContext.requestState} returns the raw,\n * attacker-controlled wire string.\n *\n * @defaultValue `undefined`\n */\n requestState?: ServerOptions[\"requestState\"];\n /**\n * Optional CORS headers on every route served by `getHandler()` / `listen()`\n * (MCP endpoint, view assets, inspector, OAuth metadata). Off when omitted.\n *\n * Pair with {@link BaseServerConfig.allowedOrigins | allowedOrigins} for\n * browser clients: CORS tells the browser it may read the response; Origin\n * validation decides whether the server accepts the request.\n *\n * @example\n * ```ts\n * new MCPServer({\n * name: \"api\",\n * version: \"1.0.0\",\n * allowedOrigins: [\"app.example.com\"],\n * cors: {\n * origin: \"https://app.example.com\",\n * credentials: true,\n * },\n * });\n * ```\n */\n cors?: CorsOptions;\n}\n\n/**\n * CORS configuration for routes owned by mcp-use (`getHandler()` / `listen()`).\n *\n * Omit `cors` entirely for the current no-CORS behavior. Pass `cors: {}` to\n * enable with defaults (reflects the request `Origin` when present; wildcard\n * `origin: \"*\"` requires an explicit opt-in).\n */\nexport interface CorsOptions {\n /** @defaultValue `true` when `cors` is set; ignored when `cors` is omitted */\n enabled?: boolean;\n /** Allowed Origin(s). Reflect matching `Origin` header, or `\"*\"` when set. */\n origin?: string | string[] | ((origin: string | null) => string | null);\n /** @defaultValue `[\"GET\", \"HEAD\", \"POST\", \"OPTIONS\"]` */\n methods?: string[];\n /** @defaultValue common MCP + JSON headers */\n allowedHeaders?: string[];\n /** @defaultValue `false` */\n credentials?: boolean;\n}\n\n/**\n * Runtime checks for optional {@link ServerConfig} fields that TypeScript\n * alone cannot enforce when values arrive from untyped call sites.\n *\n * @throws TypeError When `basePath` is present but not an absolute URL\n * pathname without empty segments, trailing slash, query, fragment, or\n * whitespace.\n */\nexport function assertServerConfig(config: { basePath?: unknown }): void {\n if (config.basePath !== undefined) {\n if (typeof config.basePath !== \"string\") {\n throw new TypeError(\n \"basePath must be an absolute URL pathname without empty segments, trailing slash, query, fragment, or whitespace\"\n );\n }\n const { basePath } = config;\n if (\n !basePath.startsWith(\"/\") ||\n basePath.includes(\"?\") ||\n basePath.includes(\"#\") ||\n /\\s/.test(basePath) ||\n basePath.includes(\"//\") ||\n (basePath.length > 1 && basePath.endsWith(\"/\"))\n ) {\n throw new TypeError(\n \"basePath must be an absolute URL pathname without empty segments, trailing slash, query, fragment, or whitespace\"\n );\n }\n }\n}\n\n/**\n * Server identity and behavior, passed to `new MCPServer(...)`.\n *\n * A user type other than `never` requires an OAuth provider, preventing a\n * callback from declaring authenticated context without authentication at\n * runtime. Omitting the type keeps the no-OAuth API ergonomic.\n */\nexport type ServerConfig<TUser = never> = BaseServerConfig &\n ([TUser] extends [never]\n ? {\n /** OAuth is unavailable when no authenticated user type is declared. */\n oauth?: undefined;\n }\n : {\n /**\n * External OAuth resource-server provider. Callback contexts receive\n * this provider's user type as required `ctx.auth.user`.\n */\n oauth: OAuthProvider<TUser>;\n });\n","import {\n CLIENT_CAPABILITIES_META_KEY,\n inputRequired,\n inputResponse,\n type AuthInfo,\n type InputRequest,\n type InputRequiredResult,\n type RequestStateAccessor,\n type ServerContext,\n type StandardSchemaWithJSON,\n} from \"@modelcontextprotocol/server\";\n\nimport type { OAuthExtra } from \"./oauth/provider.js\";\nimport { supportsViews } from \"./views/capabilities.js\";\n\n/**\n * Per-request client capability queries.\n *\n * Reads the modern per-request envelope only — never session state.\n */\nexport interface RequestClientContext {\n /**\n * Whether this request's client advertises MCP Apps / UI support.\n *\n * True when the client declares the `io.modelcontextprotocol/ui` extension\n * with `text/html;profile=mcp-app` in `mimeTypes`. Legacy (non-envelope)\n * requests always return `false`.\n */\n supportsViews(): boolean;\n}\n\n/**\n * Result of a {@link Elicit} call.\n *\n * `required` means the callback must return `result`; the client then gathers\n * input and retries the tool. Accepted form results carry schema-validated,\n * inferred `data`. URL acceptances and declined/cancelled results carry no\n * data.\n */\nexport type ElicitationResult<T = never> =\n | { status: \"required\"; result: InputRequiredResult }\n | { status: \"decline\" | \"cancel\" }\n | ([T] extends [never]\n ? { status: \"accept\" }\n : { status: \"accept\"; data: T });\n\n/**\n * Requests or reads one keyed elicitation in a multi-round-trip tool callback.\n *\n * The explicit key correlates the request with the client's response on\n * re-entry. On the first entry, or after an invalid form response, this returns\n * `{ status: \"required\", result }`; return that result from the tool. On\n * re-entry it returns `accept`, `decline`, or `cancel` and validates accepted\n * Standard Schema form data before exposing it. Validation may be synchronous\n * or asynchronous.\n *\n * @example\n * ```ts\n * const confirmation = await ctx.elicit(\n * \"confirm\",\n * \"Deploy to production?\",\n * schema,\n * );\n * if (confirmation.status === \"required\") {\n * return confirmation.result;\n * }\n * ```\n */\nexport interface Elicit {\n /** Request or read a typed form-mode elicitation. */\n <S extends StandardSchemaWithJSON>(\n key: string,\n message: string,\n schema: S\n ): Promise<ElicitationResult<StandardSchemaWithJSON.InferOutput<S>>>;\n /** Request or read a URL-mode elicitation. */\n (key: string, message: string, url: string): Promise<ElicitationResult>;\n}\n\n/**\n * Per-request context passed to tool/resource/prompt callbacks.\n */\nexport type OAuthAuth<TUser> = {\n user: TUser;\n payload: Record<string, unknown>;\n accessToken: string;\n scopes: string[];\n permissions: string[];\n /**\n * The OAuth client identifier from the token's `client_id` or `azp` claim;\n * undefined when the identity provider's access tokens carry no client claim\n * (e.g. WorkOS AuthKit, Supabase).\n */\n clientId?: string;\n expiresAt: number;\n resource?: URL;\n};\n\ntype RequestContextBase = {\n /** Aborted when the client cancels the request or the connection drops. */\n signal: AbortSignal;\n /** The originating HTTP request, when served over HTTP. */\n request?: Request;\n /** Per-request client capability queries. */\n client: RequestClientContext;\n /** Request or read a keyed form- or URL-mode elicitation. */\n elicit: Elicit;\n /**\n * Bare responses supplied when the client retries an `input_required`\n * round. Values are client input; validate them before use.\n */\n inputResponses?: ServerContext[\"mcpReq\"][\"inputResponses\"];\n /**\n * Read opaque state echoed by the client for this `input_required` round.\n * The generic is only a type assertion. Configure `requestState.verify`\n * when state affects authorization or business logic.\n */\n requestState: RequestStateAccessor;\n /**\n * Report request-scoped progress when the caller supplied a progress token.\n *\n * @returns `true` when a notification was sent, `false` when the caller did\n * not request progress.\n */\n reportProgress(\n progress: number,\n total?: number,\n message?: string\n ): Promise<boolean>;\n /** Send a log message notification to the client during tool execution. */\n sendLog(\n level:\n | \"debug\"\n | \"info\"\n | \"notice\"\n | \"warning\"\n | \"error\"\n | \"critical\"\n | \"alert\"\n | \"emergency\",\n data: unknown,\n logger?: string\n ): Promise<void>;\n};\n\n/**\n * Per-request callback context, authenticated when OAuth is configured.\n */\nexport type RequestContext<\n TUser = never,\n HasOAuth extends boolean = false,\n> = HasOAuth extends true\n ? RequestContextBase & { auth: OAuthAuth<TUser> }\n : RequestContextBase & { auth?: never };\n\ntype MappedOAuthAuthInfo<TUser> = AuthInfo & {\n expiresAt: number;\n extra: OAuthExtra<TUser>;\n};\n\nfunction requireOAuthAuthInfo<TUser>(\n authInfo: AuthInfo | undefined\n): asserts authInfo is MappedOAuthAuthInfo<TUser> {\n if (\n authInfo === undefined ||\n authInfo.extra === undefined ||\n authInfo.expiresAt === undefined\n ) {\n throw new Error(\"OAuth callback did not receive mapped AuthInfo.extra\");\n }\n}\n\nfunction toClientContext(ctx: ServerContext): RequestClientContext {\n const envelopeCaps = ctx.mcpReq.envelope?.[CLIENT_CAPABILITIES_META_KEY];\n return {\n supportsViews(): boolean {\n return supportsViews(envelopeCaps);\n },\n };\n}\n\nfunction createElicit(\n inputResponses: ServerContext[\"mcpReq\"][\"inputResponses\"]\n): Elicit {\n return async function elicit(\n key: string,\n message: string,\n schemaOrUrl?: StandardSchemaWithJSON | string\n ): Promise<ElicitationResult<unknown> | ElicitationResult> {\n let request: InputRequest;\n let formSchema: StandardSchemaWithJSON | undefined;\n\n if (typeof schemaOrUrl === \"string\") {\n request = inputRequired.elicitUrl({\n message,\n url: schemaOrUrl,\n });\n } else if (schemaOrUrl !== undefined) {\n formSchema = schemaOrUrl;\n request = inputRequired.elicit({\n message,\n requestedSchema: schemaOrUrl,\n });\n } else {\n throw new TypeError(\n \"ctx.elicit(key, message, value) requires a form schema or URL string\"\n );\n }\n\n const response = inputResponse(inputResponses, key);\n if (response.kind === \"elicit\") {\n if (response.action !== \"accept\") {\n return { status: response.action };\n }\n if (formSchema === undefined) {\n return { status: \"accept\" };\n }\n if (response.content !== undefined) {\n const outcome = await formSchema[\"~standard\"].validate(\n response.content\n );\n if (outcome.issues === undefined) {\n return { status: \"accept\", data: outcome.value };\n }\n }\n }\n\n return {\n status: \"required\",\n result: inputRequired({ inputRequests: { [key]: request } }),\n };\n } as Elicit;\n}\n\n/**\n * Derive the callback-facing {@link RequestContext} from the SDK's\n * per-request `ServerContext`.\n *\n * @internal\n */\nexport function toRequestContext(\n ctx: ServerContext\n): RequestContext<never, false> {\n const request = ctx.http?.req;\n return {\n signal: ctx.mcpReq.signal,\n ...(request !== undefined && { request }),\n ...(ctx.mcpReq.inputResponses !== undefined && {\n inputResponses: ctx.mcpReq.inputResponses,\n }),\n client: toClientContext(ctx),\n elicit: createElicit(ctx.mcpReq.inputResponses),\n requestState: <T = unknown>() => ctx.mcpReq.requestState<T>(),\n async reportProgress(progress, total, message): Promise<boolean> {\n const progressToken = ctx.mcpReq._meta?.progressToken;\n if (progressToken === undefined) return false;\n await ctx.mcpReq.notify({\n method: \"notifications/progress\",\n params: {\n progressToken,\n progress,\n ...(total !== undefined && { total }),\n ...(message !== undefined && { message }),\n },\n });\n return true;\n },\n async sendLog(level, data, logger): Promise<void> {\n await ctx.mcpReq.notify({\n method: \"notifications/message\",\n params: {\n level,\n data,\n ...(logger !== undefined && { logger }),\n },\n });\n },\n };\n}\n\n/** @internal Projects mapped OAuth auth information into callback context. */\nexport function toAuthenticatedRequestContext<TUser>(\n ctx: ServerContext\n): RequestContext<TUser, true> {\n const authInfo = ctx.http?.authInfo;\n requireOAuthAuthInfo<TUser>(authInfo);\n return {\n ...toRequestContext(ctx),\n auth: {\n user: authInfo.extra.user,\n payload: authInfo.extra.payload,\n accessToken: authInfo.token,\n scopes: [...authInfo.scopes],\n permissions: [...authInfo.extra.permissions],\n ...(authInfo.clientId.length > 0 && { clientId: authInfo.clientId }),\n expiresAt: authInfo.expiresAt,\n ...(authInfo.resource !== undefined && { resource: authInfo.resource }),\n },\n };\n}\n","import {\n CLIENT_CAPABILITIES_META_KEY,\n type ClientCapabilities,\n} from \"@modelcontextprotocol/server\";\n\nimport { UI_EXTENSION_ID, UI_MIME_TYPE } from \"./constants.js\";\n\n/** Per-request client capabilities stashed before the SDK handler runs. */\nconst clientCapabilitiesByRequest = new WeakMap<Request, ClientCapabilities>();\n\n/**\n * Stash parsed client capabilities on the request for the per-request server\n * factory.\n *\n * @internal\n */\nexport function stashClientCapabilities(\n request: Request,\n capabilities: ClientCapabilities\n): void {\n clientCapabilitiesByRequest.set(request, capabilities);\n}\n\n/**\n * Read stashed client capabilities for an HTTP request.\n *\n * @internal\n */\nexport function getStashedClientCapabilities(\n request: Request | undefined\n): ClientCapabilities | undefined {\n if (request === undefined) {\n return undefined;\n }\n return clientCapabilitiesByRequest.get(request);\n}\n\n/**\n * Extract `clientCapabilities` from a parsed JSON-RPC body, when present.\n *\n * @internal\n */\nexport function extractClientCapabilitiesFromBody(\n body: unknown\n): ClientCapabilities | undefined {\n if (typeof body !== \"object\" || body === null) {\n return undefined;\n }\n const params = (body as Record<string, unknown>)[\"params\"];\n if (typeof params !== \"object\" || params === null) {\n return undefined;\n }\n const meta = (params as Record<string, unknown>)[\"_meta\"];\n if (typeof meta !== \"object\" || meta === null) {\n return undefined;\n }\n const capabilities = (meta as Record<string, unknown>)[\n CLIENT_CAPABILITIES_META_KEY\n ];\n if (typeof capabilities !== \"object\" || capabilities === null) {\n return undefined;\n }\n return capabilities as ClientCapabilities;\n}\n\n/**\n * Whether the client advertises MCP Apps / UI support for this request.\n *\n * True when `capabilities.extensions[\"io.modelcontextprotocol/ui\"]` exists\n * and its `mimeTypes` array includes `text/html;profile=mcp-app`.\n *\n * @remarks\n * Used only for {@link RequestContext.client} queries (e.g.\n * `ctx.client.supportsViews()`). Capability negotiation does not affect the\n * wire surface — `tools/list` always includes every registered tool regardless\n * of this result.\n */\nexport function supportsViews(\n capabilities: ClientCapabilities | undefined\n): boolean {\n const extensions = capabilities?.extensions;\n if (extensions === undefined) {\n return false;\n }\n const uiExtension = extensions[UI_EXTENSION_ID];\n if (typeof uiExtension !== \"object\" || uiExtension === null) {\n return false;\n }\n const mimeTypes = (uiExtension as Record<string, unknown>)[\"mimeTypes\"];\n if (!Array.isArray(mimeTypes)) {\n return false;\n }\n return mimeTypes.includes(UI_MIME_TYPE);\n}\n","/** MCP Apps extension identifier (`io.modelcontextprotocol/ui`). */\nexport const UI_EXTENSION_ID = \"io.modelcontextprotocol/ui\" as const;\n\n/** MIME type for MCP App view resources. */\nexport const UI_MIME_TYPE = \"text/html;profile=mcp-app\" as const;\n\n/** URI scheme prefix for view resources (`ui://views/<name>.html`). */\nexport const UI_RESOURCE_URI_PREFIX = \"ui://views/\" as const;\n\n/** Nested `_meta` key for UI metadata on tools and resources. */\nexport const UI_META_KEY = \"ui\" as const;\n\n/** Legacy flat `_meta` key for the view resource URI (kept while hosts read it). */\nexport const UI_RESOURCE_URI_META_KEY = \"ui/resourceUri\" as const;\n\n/**\n * Build the stable `ui://` resource URI for a view name.\n *\n * @param viewName - View directory / manifest key.\n */\nexport function viewResourceUri(viewName: string): string {\n return `${UI_RESOURCE_URI_PREFIX}${viewName}.html`;\n}\n","import type { CorsOptions } from \"../config.js\";\nimport type { FetchMiddleware } from \"../fetch-app.js\";\n\nconst DEFAULT_METHODS = [\"GET\", \"HEAD\", \"POST\", \"OPTIONS\"];\nconst DEFAULT_ALLOWED_HEADERS = [\n \"Content-Type\",\n \"Authorization\",\n \"mcp-protocol-version\",\n \"mcp-method\",\n \"mcp-name\",\n];\n\nfunction resolveAllowedOrigin(\n origin: CorsOptions[\"origin\"],\n requestOrigin: string | null\n): string | null {\n if (origin === undefined) {\n return requestOrigin;\n }\n if (typeof origin === \"function\") {\n return origin(requestOrigin);\n }\n if (origin === \"*\") {\n return \"*\";\n }\n if (Array.isArray(origin)) {\n if (requestOrigin !== null && origin.includes(requestOrigin)) {\n return requestOrigin;\n }\n return null;\n }\n return origin;\n}\n\nfunction corsHeaders(\n options: Required<\n Pick<CorsOptions, \"methods\" | \"allowedHeaders\" | \"credentials\">\n > &\n Pick<CorsOptions, \"origin\">,\n request: Request\n): HeadersInit | undefined {\n if (request.headers.has(\"Access-Control-Allow-Origin\")) {\n return undefined;\n }\n\n const requestOrigin = request.headers.get(\"Origin\");\n const allowedOrigin = resolveAllowedOrigin(options.origin, requestOrigin);\n if (allowedOrigin === null) {\n return undefined;\n }\n\n const headers: Record<string, string> = {\n \"Access-Control-Allow-Origin\": allowedOrigin,\n \"Access-Control-Allow-Methods\": options.methods.join(\", \"),\n \"Access-Control-Allow-Headers\": options.allowedHeaders.join(\", \"),\n };\n if (options.credentials) {\n headers[\"Access-Control-Allow-Credentials\"] = \"true\";\n }\n if (allowedOrigin !== \"*\") {\n headers.Vary = \"Origin\";\n }\n return headers;\n}\n\nfunction mergeCorsHeaders(response: Response, headers: HeadersInit): Response {\n if (response.headers.has(\"Access-Control-Allow-Origin\")) {\n return response;\n }\n const merged = new Headers(response.headers);\n const corsHeaders = new Headers(headers);\n corsHeaders.forEach((value, key) => {\n merged.set(key, value);\n });\n return new Response(response.body, {\n status: response.status,\n statusText: response.statusText,\n headers: merged,\n });\n}\n\n/**\n * Fetch middleware that adds CORS headers to every response.\n *\n * @internal Wired from {@link MCPServer} when `ServerConfig.cors` is set.\n */\nexport function corsFetchMiddleware(options: CorsOptions): FetchMiddleware {\n const enabled = options.enabled !== false;\n if (!enabled) {\n return async (_request, next) => next();\n }\n\n const resolved = {\n ...(options.origin !== undefined && { origin: options.origin }),\n methods: options.methods ?? DEFAULT_METHODS,\n allowedHeaders: options.allowedHeaders ?? DEFAULT_ALLOWED_HEADERS,\n credentials: options.credentials ?? false,\n };\n\n return async (request, next) => {\n const headers = corsHeaders(resolved, request);\n if (headers === undefined) {\n return next();\n }\n\n if (request.method === \"OPTIONS\") {\n return new Response(null, { status: 204, headers });\n }\n\n const response = await next();\n return mergeCorsHeaders(response, headers);\n };\n}\n\n/** Whether global CORS middleware owns response headers for view assets. */\nexport function isGlobalCorsEnabled(cors: CorsOptions | undefined): boolean {\n return cors !== undefined && cors.enabled !== false;\n}\n","import type { AuthInfo } from \"@modelcontextprotocol/server\";\n\n/**\n * Context passed to every MCP middleware handler.\n *\n * `params` is mutable — middleware can modify params before calling `next()`\n * and those changes will be visible to downstream middleware and the handler.\n *\n * `state` is a shared Map for passing arbitrary data across middleware in\n * the same chain.\n */\nexport interface MiddlewareContext {\n /** MCP method name, e.g. \"tools/call\", \"tools/list\", \"resources/read\" */\n method: string;\n /** JSON-RPC request params (mutable — mutations are passed downstream) */\n params: Record<string, unknown>;\n /** OAuth info extracted from JWT, present when OAuth is configured */\n auth?: AuthInfo;\n /** Shared state Map for passing data across middleware in the same request */\n state: Map<string, unknown>;\n}\n\n/** Params shape for `tools/call` method */\ninterface ToolsCallParams {\n name: string;\n arguments?: Record<string, unknown>;\n _meta?: Record<string, unknown>;\n}\n\n/** Params shape for `resources/read` method */\ninterface ResourcesReadParams {\n uri: string;\n _meta?: Record<string, unknown>;\n}\n\n/** Params shape for `prompts/get` method */\ninterface PromptsGetParams {\n name: string;\n arguments?: Record<string, string>;\n _meta?: Record<string, unknown>;\n}\n\n/** Context with narrowed `params` for `tools/call` */\nexport interface ToolsCallMiddlewareContext extends MiddlewareContext {\n method: \"tools/call\";\n params: ToolsCallParams & Record<string, unknown>;\n}\n\n/** Context with narrowed `params` for `resources/read` */\nexport interface ResourcesReadMiddlewareContext extends MiddlewareContext {\n method: \"resources/read\";\n params: ResourcesReadParams & Record<string, unknown>;\n}\n\n/** Context with narrowed `params` for `prompts/get` */\nexport interface PromptsGetMiddlewareContext extends MiddlewareContext {\n method: \"prompts/get\";\n params: PromptsGetParams & Record<string, unknown>;\n}\n\n/**\n * Map from MCP middleware pattern strings to their narrowed context type.\n * Used by `McpMiddlewareFnFor<P>` to infer the correct `ctx` parameter.\n */\nexport interface McpMiddlewarePatternMap {\n \"tools/call\": ToolsCallMiddlewareContext;\n \"resources/read\": ResourcesReadMiddlewareContext;\n \"prompts/get\": PromptsGetMiddlewareContext;\n}\n\n/**\n * A typed MCP middleware function whose `ctx` is narrowed based on the\n * pattern string `P`. Falls back to the base `MiddlewareContext` for\n * wildcard or unrecognized patterns.\n */\nexport type McpMiddlewareFnFor<P extends string> =\n P extends keyof McpMiddlewarePatternMap\n ? (\n ctx: McpMiddlewarePatternMap[P],\n next: () => Promise<unknown>\n ) => Promise<unknown>\n : McpMiddlewareFn;\n\n/**\n * A single MCP middleware function.\n *\n * Call `next()` to pass control to the next middleware (or handler).\n * Return its result, or return a different value to override the response.\n * Throw an error to reject the request.\n */\nexport type McpMiddlewareFn = (\n ctx: MiddlewareContext,\n next: () => Promise<unknown>\n) => Promise<unknown>;\n\n/**\n * Internal storage entry for a registered MCP middleware.\n * The pattern is stored with the `mcp:` prefix already stripped.\n * @internal\n */\nexport interface McpMiddlewareEntry {\n /** Pattern after stripping \"mcp:\" — e.g. \"tools/call\", \"tools/*\", \"*\" */\n pattern: string;\n handler: McpMiddlewareFn;\n}\n\n/** Phase for MCP observer event listeners registered via `server.on()`. */\nexport type McpEventPhase = \"before\" | \"complete\";\n\n/**\n * Internal storage entry for a registered MCP observer event listener.\n * @internal\n */\nexport interface McpEventListenerEntry {\n pattern: string;\n phase: McpEventPhase;\n handler: McpEventListenerFn | McpCompleteEventListenerFn;\n}\n\n/** Read-only observer invoked before the MCP handler runs. */\nexport type McpEventListenerFn = (ctx: Readonly<MiddlewareContext>) => void;\n\n/** Read-only observer invoked after the MCP handler completes. */\nexport type McpCompleteEventListenerFn = (\n ctx: Readonly<MiddlewareContext>,\n result: unknown\n) => void;\n\n/**\n * Test whether a registered middleware pattern matches a given MCP method.\n *\n * Matching rules:\n * - `\"*\"` matches any method\n * - `\"tools/*\"` prefix-matches any method starting with `\"tools/\"`\n * - `\"tools/call\"` exact-matches only `\"tools/call\"`\n */\nexport function matchesPattern(pattern: string, method: string): boolean {\n if (pattern === \"*\") return true;\n if (pattern.endsWith(\"/*\")) {\n const prefix = pattern.slice(0, -1);\n return method.startsWith(prefix);\n }\n return pattern === method;\n}\n\n/**\n * Compose a middleware chain for a given MCP method invocation.\n *\n * Filters `entries` to those matching `method`, then builds a `next()` chain\n * with `innerFn` at the center. Returns the outermost callable.\n *\n * Middleware executes in FIFO registration order (first registered = outermost).\n */\nexport function composeMiddleware(\n entries: McpMiddlewareEntry[],\n method: string,\n innerFn: () => Promise<unknown>\n): (ctx: MiddlewareContext) => Promise<unknown> {\n const matching = entries.filter((e) => matchesPattern(e.pattern, method));\n\n if (matching.length === 0) {\n return (_ctx: MiddlewareContext) => innerFn();\n }\n\n return (ctx: MiddlewareContext) => {\n let index = -1;\n\n const dispatch = (i: number): Promise<unknown> => {\n if (i <= index) {\n return Promise.reject(new Error(\"next() called multiple times\"));\n }\n index = i;\n\n if (i === matching.length) {\n return innerFn();\n }\n\n const entry = matching[i]!;\n return entry.handler(ctx, () => dispatch(i + 1));\n };\n\n return dispatch(0);\n };\n}\n\n/** Build a read-only snapshot of middleware context for observer events. */\nexport function freezeMiddlewareContext(\n ctx: MiddlewareContext\n): Readonly<MiddlewareContext> {\n return Object.freeze({\n method: ctx.method,\n params: Object.freeze({ ...ctx.params }),\n ...(ctx.auth !== undefined && { auth: ctx.auth }),\n state: ctx.state,\n });\n}\n\n/**\n * Run before/complete observer listeners around a middleware chain.\n *\n * Listener throws are logged and do not fail the MCP request.\n */\nexport async function runMcpOperation(\n middlewares: McpMiddlewareEntry[],\n events: McpEventListenerEntry[],\n method: string,\n ctx: MiddlewareContext,\n innerFn: () => Promise<unknown>\n): Promise<unknown> {\n dispatchMcpEvents(events, method, \"before\", ctx);\n\n const chained = composeMiddleware(middlewares, method, innerFn);\n const result = await chained(ctx);\n\n dispatchMcpEvents(events, method, \"complete\", ctx, result);\n return result;\n}\n\nfunction dispatchMcpEvents(\n events: McpEventListenerEntry[],\n method: string,\n phase: McpEventPhase,\n ctx: MiddlewareContext,\n result?: unknown\n): void {\n const frozen = freezeMiddlewareContext(ctx);\n for (const entry of events) {\n if (entry.phase !== phase || !matchesPattern(entry.pattern, method)) {\n continue;\n }\n try {\n if (phase === \"before\") {\n (entry.handler as McpEventListenerFn)(frozen);\n } else {\n (entry.handler as McpCompleteEventListenerFn)(frozen, result);\n }\n } catch (error) {\n console.error(\n `[mcp-use] MCP event listener for \"${entry.pattern}\" (${phase}) threw:`,\n error\n );\n }\n }\n}\n\n/** Strip `mcp:` prefix and optional `:complete` suffix from observer patterns. */\nexport function parseMcpPattern(raw: string): {\n pattern: string;\n phase: McpEventPhase;\n} {\n const pattern = raw.startsWith(\"mcp:\") ? raw.slice(4) : raw;\n if (pattern.endsWith(\":complete\")) {\n return {\n pattern: pattern.slice(0, -\":complete\".length),\n phase: \"complete\",\n };\n }\n return { pattern, phase: \"before\" };\n}\n\n/** Normalize middleware pattern strings (strip `mcp:` prefix). */\nexport function normalizeMcpMiddlewarePattern(raw: string): string {\n return raw.startsWith(\"mcp:\") ? raw.slice(4) : raw;\n}\n","/**\n * Inspector CDN shell — the FastAPI `/docs` analog.\n *\n * The server ships no inspector code: it serves a tiny self-contained HTML\n * page whose `<script type=\"module\">` loads the `@mcp-use/inspector` CDN\n * bundle entry (`dist/cdn/inspector.js`) plus lazy chunks, pinned to a major\n * version so the UI updates independently of SDK releases. Runtime configuration crosses to\n * the bundle through a serialized `window` global; the connect URL is derived\n * in the browser from the page's own origin, so the server never guesses its\n * public hostname.\n */\nimport type { InspectorOptions } from \"./config.js\";\nimport { pathUnderBase, type FetchHandler } from \"./fetch-app.js\";\n\n/**\n * npm dist-tag of the `@mcp-use/inspector` CDN bundle the default URL follows.\n *\n * Every new Inspector beta published with this tag becomes the default\n * inspector for mcp-use servers without requiring an mcp-use release.\n */\nexport const INSPECTOR_TAG = \"beta\";\n\n/**\n * Default URL the inspector shell loads the UI bundle from: the\n * `@mcp-use/inspector` CDN build (`dist/cdn/inspector.js`) built from this\n * branch and served by jsDelivr from npm's {@link INSPECTOR_TAG} tag.\n * Override per server with {@link InspectorOptions.assetsUrl}.\n */\nexport const DEFAULT_INSPECTOR_ASSETS_URL = `https://cdn.jsdelivr.net/npm/@mcp-use/inspector@${INSPECTOR_TAG}/dist/cdn/inspector.js`;\n\n/**\n * Derive the stylesheet URL that accompanies an inspector bundle URL.\n *\n * The CDN build ships as dist/cdn/inspector.js + dist/cdn/inspector.css\n * plus sibling lazy chunks referenced by the entry script. The stylesheet URL\n * is the script URL with its `.js` suffix swapped for `.css`. Query\n * strings and fragments are preserved.\n */\nexport function inspectorStylesUrl(assetsUrl: string): string {\n return assetsUrl.replace(/\\.js(?=$|[?#])/, \".css\");\n}\n\n/** True for the default jsDelivr `@mcp-use/inspector@*` CDN bundle URL. */\nexport function isDefaultJsdelivrInspectorUrl(url: string): boolean {\n return url.startsWith(\"https://cdn.jsdelivr.net/npm/@mcp-use/inspector@\");\n}\n\n/** Append a per-request cache-bust query param for the default jsDelivr CDN URL. */\nexport function withInspectorCacheBust(assetsUrl: string): string {\n if (!isDefaultJsdelivrInspectorUrl(assetsUrl)) return assetsUrl;\n const sep = assetsUrl.includes(\"?\") ? \"&\" : \"?\";\n return `${assetsUrl}${sep}cb=${crypto.randomUUID()}`;\n}\n\n/** True for inspector UI shell routes (SPA), excluding `/inspector/api/*`. */\nexport function matchesInspectorShellPath(\n pathname: string,\n basePath: string\n): boolean {\n const prefix = pathUnderBase(basePath, \"inspector\");\n if (pathname !== prefix && !pathname.startsWith(`${prefix}/`)) {\n return false;\n }\n const suffix = pathname.slice(prefix.length);\n return suffix !== \"/api\" && !suffix.startsWith(\"/api/\");\n}\n\n/** Inputs for {@link renderInspectorShell}. */\nexport interface InspectorShellOptions {\n /** Server display name, used in the page title. */\n serverName: string;\n /** Route path the MCP endpoint is mounted on (e.g. `/mcp`). */\n basePath: string;\n /**\n * Full replacement URL for the inspector bundle script. Defaults to\n * {@link DEFAULT_INSPECTOR_ASSETS_URL}.\n */\n assetsUrl?: string | undefined;\n /** Hosted managed-chat URL (`window.__MANUFACT_CHAT_URL__`). */\n manufactChatUrl?: string | undefined;\n}\n\n/** Escape a string for interpolation into HTML text or attribute values. */\nfunction escapeHtml(value: string): string {\n return value\n .replaceAll(\"&\", \"&amp;\")\n .replaceAll(\"<\", \"&lt;\")\n .replaceAll(\">\", \"&gt;\")\n .replaceAll('\"', \"&quot;\")\n .replaceAll(\"'\", \"&#39;\");\n}\n\n/**\n * Serialize a value for interpolation inside an inline `<script>` body.\n *\n * `<` is escaped to its unicode JSON escape (backslash-u003c) so serialized\n * config can never form a `</script>` (or `<!--`) sequence and break out of\n * the script element.\n */\nfunction serializeForInlineScript(value: string): string {\n return JSON.stringify(value).replaceAll(\"<\", \"\\\\u003c\");\n}\n\n/**\n * Render the inspector shell page.\n *\n * A minimal shell document whose background matches the inspector UI\n * with a `#root` mount node, an inline script publishing\n * `window.__MCP_USE_INSPECTOR__ = { autoConnectUrl, basePath }` — where\n * `autoConnectUrl` is computed client-side as\n * `window.location.origin + basePath` — a stylesheet link for the bundle's\n * companion CSS (see {@link inspectorStylesUrl}), and a module script\n * loading the inspector bundle. All server-provided values are HTML-escaped\n * or JSON-serialized with `<` escaped, so config can't inject markup.\n */\nexport function renderInspectorShell(options: InspectorShellOptions): string {\n const { serverName, basePath, assetsUrl, manufactChatUrl } = options;\n const serializedBasePath = serializeForInlineScript(basePath);\n const serializedManufactChatUrl = manufactChatUrl\n ? serializeForInlineScript(manufactChatUrl)\n : null;\n const rawUrl = assetsUrl ?? DEFAULT_INSPECTOR_ASSETS_URL;\n const bundleUrl = withInspectorCacheBust(rawUrl);\n const scriptSrc = escapeHtml(bundleUrl);\n const stylesHref = escapeHtml(inspectorStylesUrl(bundleUrl));\n return `<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <title>${escapeHtml(serverName)} — MCP Inspector</title>\n <link rel=\"preconnect\" href=\"https://fonts.googleapis.com\" />\n <link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossorigin />\n <link\n href=\"https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;500;700&display=swap\"\n rel=\"stylesheet\"\n />\n <link rel=\"stylesheet\" href=\"${stylesHref}\" />\n <style>\n :root { color-scheme: light dark; }\n html, body { height: 100%; margin: 0; background-color: #f3f3f3; }\n </style>\n </head>\n <body>\n <div id=\"root\"></div>\n <script>\n (function () {\n var basePath = ${serializedBasePath};\n // The connect URL is derived from the page's own origin: the server\n // never guesses the hostname a browser reached it by.\n window.__MCP_USE_INSPECTOR__ = {\n autoConnectUrl: window.location.origin + basePath,\n basePath: basePath,\n };\n // Read by the current inspector bundle to derive its own URLs.\n window.__MCP_BASE_PATH__ = basePath;\n ${serializedManufactChatUrl ? `window.__MANUFACT_CHAT_URL__ = ${serializedManufactChatUrl};` : \"\"}\n // The bundle carries Node-flavored dependencies that touch \\`process\\`\n // at module scope; give them the same browser polyfill the v1\n // inspector shell provides, or the bundle throws on load.\n if (typeof window.process === \"undefined\") {\n window.process = {\n env: {},\n platform: \"browser\",\n browser: true,\n version: \"v18.0.0\",\n versions: { node: \"18.0.0\" },\n cwd: function () { return \"/\"; },\n nextTick: function (fn) {\n var args = Array.prototype.slice.call(arguments, 1);\n queueMicrotask(function () { fn.apply(null, args); });\n },\n };\n }\n })();\n </script>\n <script type=\"module\" src=\"${scriptSrc}\"></script>\n </body>\n</html>\n`;\n}\n\n/**\n * Fetch handler for `${basePath}/inspector` (GET and HEAD).\n *\n * No-op when `inspector.enabled` is `false`; `undefined` and `{}` mean enabled.\n *\n * @internal Wiring for `MCPServer`.\n */\nexport function createInspectorHandler(\n inspector: InspectorOptions | undefined,\n options: { serverName: string; basePath: string }\n): FetchHandler | undefined {\n if (inspector?.enabled === false) {\n return undefined;\n }\n const { assetsUrl: configAssetsUrl, manufactChatUrl: configManufactChatUrl } =\n inspector ?? {};\n const assetsUrl =\n configAssetsUrl ?? process.env[\"MCP_USE_INSPECTOR_ASSETS_URL\"] ?? undefined;\n const manufactChatUrl =\n configManufactChatUrl ?? process.env[\"MANUFACT_CHAT_URL\"] ?? undefined;\n const shellOptions: InspectorShellOptions = {\n serverName: options.serverName,\n basePath: options.basePath,\n assetsUrl,\n manufactChatUrl,\n };\n\n return async (request) => {\n if (request.method !== \"GET\" && request.method !== \"HEAD\") {\n return new Response(\"Method Not Allowed\", { status: 405 });\n }\n const pathname = new URL(request.url).pathname;\n if (!matchesInspectorShellPath(pathname, options.basePath)) {\n return new Response(\"Not Found\", { status: 404 });\n }\n const html = renderInspectorShell(shellOptions);\n return new Response(request.method === \"HEAD\" ? null : html, {\n status: 200,\n headers: { \"content-type\": \"text/html; charset=utf-8\" },\n });\n };\n}\n\n/**\n * @deprecated Use {@link createInspectorHandler}.\n *\n * @internal\n */\nexport function mountInspectorShell(): void {\n throw new Error(\n \"mountInspectorShell(app) was removed — use createInspectorHandler\"\n );\n}\n","/**\n * Compact HTTP/MCP request logging.\n *\n * One summary line per HTTP request, plus an indented detail line for MCP\n * (JSON-RPC) requests naming the protocol method, its subject (tool name,\n * resource URI, prompt name), and the calling client:\n *\n * ```text\n * 12:45:01 POST /mcp 200 in 12ms\n * tools/call greet raw-request/0.0.0\n * ```\n *\n * Detail lines are plain two-space-indented ASCII (no box-drawing glyphs) so\n * log parsers and agents can tell the two apart mechanically: summary lines\n * start with a timestamp, detail lines start with whitespace.\n *\n * Three verbosity levels, resolved per request from the `MCP_USE_LOG_LEVEL`\n * environment variable (overriding any configured level):\n *\n * - `info` (default): the compact summary + detail lines only — no request\n * or response payloads, so secrets in tool arguments/results stay out of\n * production logs.\n * - `debug`: echoes compact truncated input/output on the detail line:\n * `tools/call greet {\"who\":\"world\"} -> \"hi world\" raw-request/0.0.0`.\n * - `trace`: debug plus a full request/response dump (headers and bodies)\n * after the summary.\n */\nimport {\n CLIENT_INFO_META_KEY,\n isJSONRPCRequest,\n type Implementation,\n type JSONRPCRequest,\n type RequestMethod,\n type RequestTypeMap,\n} from \"@modelcontextprotocol/server\";\n\nimport { getRequestBag, type FetchMiddleware } from \"./fetch-app.js\";\n\n/** Verbosity of the request logger. */\nexport type LogLevel = \"info\" | \"debug\" | \"trace\";\n\n/** Options for {@link requestLogger} — the shape of `config.logging`. */\nexport interface LoggingOptions {\n /**\n * Whether request logging is on.\n *\n * @defaultValue `true`\n */\n enabled?: boolean;\n /**\n * Verbosity: `info` (compact lines without payloads, default), `debug`\n * (adds compact truncated input/output on the detail line), or `trace`\n * (debug plus full request/response header and body dumps). The\n * `MCP_USE_LOG_LEVEL` environment variable overrides this when set.\n */\n level?: LogLevel;\n}\n\n/* ------------------------------------------------------------------------ *\n * ANSI styling (no color-library dependency)\n * ------------------------------------------------------------------------ */\n\n/**\n * Whether to emit ANSI escapes: only on a TTY stdout, and never when the\n * `NO_COLOR` convention is set. Edge runtimes without `process.stdout`\n * (Workers, Deno Deploy) get plain text.\n */\nfunction colorsEnabled(): boolean {\n if (typeof process === \"undefined\") return false;\n if (process.env?.[\"NO_COLOR\"] !== undefined) return false;\n return process.stdout?.isTTY === true;\n}\n\ntype Style = (text: string) => string;\n\nfunction ansi(open: number, close: number): Style {\n return (text) =>\n colorsEnabled() ? `\\u001B[${open}m${text}\\u001B[${close}m` : text;\n}\n\nconst bold = ansi(1, 22);\nconst dim = ansi(2, 22);\nconst red = ansi(31, 39);\nconst green = ansi(32, 39);\nconst yellow = ansi(33, 39);\nconst blue = ansi(34, 39);\nconst magenta = ansi(35, 39);\nconst cyan = ansi(36, 39);\nconst gray = ansi(90, 39);\n\n/* ------------------------------------------------------------------------ *\n * Level resolution\n * ------------------------------------------------------------------------ */\n\n/**\n * Effective log level: `MCP_USE_LOG_LEVEL` when it names a known level,\n * otherwise the configured level, otherwise `info`.\n */\nexport function resolveLogLevel(configured?: LogLevel): LogLevel {\n const raw =\n typeof process === \"undefined\"\n ? undefined\n : process.env?.[\"MCP_USE_LOG_LEVEL\"]?.toLowerCase();\n if (raw === \"info\" || raw === \"debug\" || raw === \"trace\") return raw;\n return configured ?? \"info\";\n}\n\n/* ------------------------------------------------------------------------ *\n * MCP detail formatting (typed against the SDK's protocol method surface)\n * ------------------------------------------------------------------------ */\n\n/** What one protocol method contributes to the detail line. */\ninterface McpDetail {\n /** Short subject next to the method name (tool name, resource URI, …). */\n subject?: string | undefined;\n /** Caller-provided input worth echoing inline (tool/prompt arguments). */\n input?: unknown;\n}\n\n/**\n * Detail extractor for one protocol method: given the method's typed params,\n * return the subject and inline input to show, or `{}` when the method name\n * says it all.\n */\ntype DetailFormatter<M extends RequestMethod> = (\n params: RequestTypeMap[M][\"params\"]\n) => McpDetail;\n\nfunction formatClientInfo(\n info: Implementation | undefined\n): string | undefined {\n if (info === undefined) return undefined;\n return typeof info.version === \"string\" && info.version !== \"\"\n ? `${info.name}/${info.version}`\n : info.name;\n}\n\n/**\n * Exhaustive over {@link RequestMethod}: adding a protocol method to the SDK\n * makes this table a compile error until a formatter is chosen — the inverse\n * of v1's silent `[unknown-method]` fallback.\n */\nconst detailFormatters: {\n [M in RequestMethod]: DetailFormatter<M>;\n} = {\n initialize: (p) => ({ subject: formatClientInfo(p.clientInfo) }),\n ping: () => ({}),\n \"server/discover\": () => ({}),\n \"completion/complete\": (p) => ({\n subject: p.ref.type === \"ref/prompt\" ? p.ref.name : p.ref.uri,\n input: p.argument,\n }),\n \"logging/setLevel\": (p) => ({ subject: p.level }),\n \"prompts/get\": (p) => ({ subject: p.name, input: p.arguments }),\n \"prompts/list\": () => ({}),\n \"resources/list\": () => ({}),\n \"resources/templates/list\": () => ({}),\n \"resources/read\": (p) => ({ subject: p.uri }),\n \"resources/subscribe\": (p) => ({ subject: p.uri }),\n \"resources/unsubscribe\": (p) => ({ subject: p.uri }),\n \"subscriptions/listen\": () => ({}),\n \"tools/call\": (p) => ({ subject: p.name, input: p.arguments }),\n \"tools/list\": () => ({}),\n \"sampling/createMessage\": () => ({}),\n \"elicitation/create\": () => ({}),\n \"roots/list\": () => ({}),\n};\n\nfunction isKnownMethod(method: string): method is RequestMethod {\n return Object.prototype.hasOwnProperty.call(detailFormatters, method);\n}\n\n/**\n * Detail for a guard-proved JSON-RPC request. The guard proves the JSON-RPC\n * envelope, not method-specific params, so the formatter call is fenced: a\n * malformed body (which the SDK will reject downstream anyway) logs without\n * a subject rather than throwing here.\n */\nfunction formatDetail(message: JSONRPCRequest): McpDetail {\n if (!isKnownMethod(message.method)) return {};\n try {\n const formatter = detailFormatters[message.method] as (\n params: unknown\n ) => McpDetail;\n const detail = formatter(message.params);\n return typeof detail.subject === \"string\" || detail.subject === undefined\n ? detail\n : {};\n } catch {\n return {};\n }\n}\n\n/** Longest inline JSON segment (input or output) before truncation. */\nconst INLINE_JSON_MAX_LENGTH = 80;\n\n/**\n * Compact single-line JSON for inline input/output echoing, truncated to\n * {@link INLINE_JSON_MAX_LENGTH} characters.\n */\nfunction inlineJson(value: unknown): string {\n let text: string;\n try {\n text = JSON.stringify(value) ?? String(value);\n } catch {\n text = String(value);\n }\n return text.length > INLINE_JSON_MAX_LENGTH\n ? `${text.slice(0, INLINE_JSON_MAX_LENGTH)}...`\n : text;\n}\n\n/**\n * Client identity from the per-request `_meta` envelope every 2026-07-28\n * request carries (`io.modelcontextprotocol/clientInfo`) — the stateless\n * replacement for v1's session-id prefix. `undefined` for requests without\n * the envelope (legacy-era traffic).\n */\nfunction formatClientIdentity(message: JSONRPCRequest): string | undefined {\n const meta = message.params?._meta;\n if (meta === undefined) return undefined;\n const info = (meta as Record<string, unknown>)[CLIENT_INFO_META_KEY];\n if (\n typeof info !== \"object\" ||\n info === null ||\n typeof (info as Implementation).name !== \"string\"\n ) {\n return undefined;\n }\n return formatClientInfo(info as Implementation);\n}\n\n/**\n * Strip control characters (newlines, ANSI escapes, …) from request-derived\n * strings so a hostile method/subject/error value cannot forge extra log\n * lines or terminal escape sequences.\n */\nfunction sanitize(text: string): string {\n // eslint-disable-next-line no-control-regex\n return text.replace(/[\\u0000-\\u001F\\u007F-\\u009F]+/g, \" \");\n}\n\n/** Namespace color for the detail line's method segment. */\nfunction methodStyle(method: string): Style {\n if (method.startsWith(\"tools/\")) return cyan;\n if (method.startsWith(\"resources/\")) return green;\n if (method.startsWith(\"prompts/\")) return magenta;\n if (method === \"initialize\" || method === \"ping\") return gray;\n return blue;\n}\n\n/* ------------------------------------------------------------------------ *\n * Response outcome\n * ------------------------------------------------------------------------ */\n\n/** Header names whose values are credentials and never worth dumping. */\nconst REDACTED_HEADERS = new Set([\n \"authorization\",\n \"proxy-authorization\",\n \"cookie\",\n \"set-cookie\",\n \"x-api-key\",\n]);\n\n/** Replace credential-bearing header values with a `[REDACTED]` marker. */\nfunction redactHeaders(\n headers: Record<string, string>\n): Record<string, string> {\n return Object.fromEntries(\n Object.entries(headers).map(([name, value]) => [\n name,\n REDACTED_HEADERS.has(name.toLowerCase()) ? \"[REDACTED]\" : value,\n ])\n );\n}\n\n/** The JSON-RPC-level outcome parsed from a response body. */\ninterface ResponseOutcome {\n /** Error message when the exchange failed (JSON-RPC error or tool error). */\n errorMessage: string | null;\n /** The JSON-RPC `result` payload when the exchange succeeded. */\n result?: unknown;\n}\n\n/**\n * Parse the JSON-RPC outcome from the response body: an error message from\n * the error envelope (`{ error: { message } }`) or a tool-call error\n * (`{ result: { isError: true, content: [{ text }] } }`), otherwise the\n * successful `result` payload. Handles both `application/json` and\n * `text/event-stream` bodies.\n */\nasync function extractResponseOutcome(res: Response): Promise<ResponseOutcome> {\n if (!res.body) return { errorMessage: null };\n\n let text: string;\n try {\n text = await res.clone().text();\n } catch {\n return { errorMessage: null };\n }\n if (!text) return { errorMessage: null };\n\n const isSse = (res.headers.get(\"content-type\") ?? \"\").includes(\n \"text/event-stream\"\n );\n const payloads: unknown[] = [];\n const tryParse = (raw: string) => {\n try {\n payloads.push(JSON.parse(raw));\n } catch {\n // not JSON — skip\n }\n };\n if (isSse) {\n for (const line of text.split(/\\r?\\n/)) {\n if (line.startsWith(\"data:\")) {\n const data = line.slice(5).trim();\n if (data) tryParse(data);\n }\n }\n } else {\n tryParse(text);\n }\n\n let result: unknown;\n for (const payload of payloads) {\n if (payload === null || typeof payload !== \"object\") continue;\n const message = payload as {\n error?: { message?: unknown };\n result?: { isError?: unknown; content?: unknown };\n };\n if (typeof message.error?.message === \"string\") {\n return { errorMessage: message.error.message };\n }\n if (message.result?.isError === true) {\n const blocks = Array.isArray(message.result.content)\n ? (message.result.content as { type?: unknown; text?: unknown }[])\n : [];\n const textBlock = blocks.find(\n (b) => b?.type === \"text\" && typeof b.text === \"string\"\n );\n return {\n errorMessage: textBlock ? String(textBlock.text) : \"tool error\",\n };\n }\n if (\"result\" in message) result = message.result;\n }\n return { errorMessage: null, result };\n}\n\n/**\n * Compact view of a successful `tools/call` result for inline echoing:\n * `structuredContent` when present, a lone text block's text, or the raw\n * content blocks.\n */\nfunction compactToolResult(result: unknown): unknown {\n if (result === null || typeof result !== \"object\") return result;\n const { structuredContent, content } = result as {\n structuredContent?: unknown;\n content?: unknown;\n };\n if (structuredContent !== undefined) return structuredContent;\n if (Array.isArray(content)) {\n const [block] = content as { type?: unknown; text?: unknown }[];\n if (content.length === 1 && block?.type === \"text\") return block.text;\n }\n return content;\n}\n\n/* ------------------------------------------------------------------------ *\n * Trace dump\n * ------------------------------------------------------------------------ */\n\n/** Pretty-print a value for the trace dump, truncating long strings. */\nfunction formatForDump(value: unknown): string {\n function truncate(val: unknown): unknown {\n if (typeof val === \"string\" && val.length > 100) {\n return `${val.slice(0, 100)}...`;\n }\n if (Array.isArray(val)) return val.map(truncate);\n if (val !== null && typeof val === \"object\") {\n return Object.fromEntries(\n Object.entries(val as Record<string, unknown>).map(([k, v]) => [\n k,\n truncate(v),\n ])\n );\n }\n return val;\n }\n try {\n return JSON.stringify(truncate(value), null, 2);\n } catch {\n return String(value);\n }\n}\n\nconst DUMP_BODY_MAX_LENGTH = 10_000;\n\nasync function printTraceDump(\n response: Response,\n requestHeaders: Record<string, string>,\n requestBody: unknown,\n readResponseBody: boolean\n): Promise<void> {\n console.log(`\\n${cyan(\"=\".repeat(80))}`);\n console.log(bold(cyan(\"[TRACE] Request Details\")));\n console.log(cyan(\"-\".repeat(80)));\n\n if (Object.keys(requestHeaders).length > 0) {\n console.log(yellow(\"Request Headers:\"));\n console.log(formatForDump(redactHeaders(requestHeaders)));\n }\n if (requestBody !== undefined) {\n console.log(yellow(\"Request Body:\"));\n console.log(\n typeof requestBody === \"string\" ? requestBody : formatForDump(requestBody)\n );\n }\n\n const responseHeaders: Record<string, string> = {};\n response.headers.forEach((value, key) => {\n responseHeaders[key] = value;\n });\n if (Object.keys(responseHeaders).length > 0) {\n console.log(yellow(\"Response Headers:\"));\n console.log(formatForDump(redactHeaders(responseHeaders)));\n }\n\n if (!readResponseBody) {\n console.log(`${yellow(\"Response Body:\")} (streaming — not dumped)`);\n } else if (response.body === null) {\n console.log(`${yellow(\"Response Body:\")} (no body)`);\n } else {\n try {\n const text = await response.clone().text();\n if (text.length === 0) {\n console.log(`${yellow(\"Response Body:\")} (empty)`);\n } else {\n console.log(yellow(\"Response Body:\"));\n try {\n console.log(formatForDump(JSON.parse(text)));\n } catch {\n console.log(\n text.length > DUMP_BODY_MAX_LENGTH\n ? `${text.slice(0, DUMP_BODY_MAX_LENGTH)}\\n... (truncated, ${\n text.length - DUMP_BODY_MAX_LENGTH\n } more characters)`\n : text\n );\n }\n }\n } catch {\n console.log(`${yellow(\"Response Body:\")} (unable to read)`);\n }\n }\n\n console.log(`${cyan(\"=\".repeat(80))}\\n`);\n}\n\n/* ------------------------------------------------------------------------ *\n * Middleware\n * ------------------------------------------------------------------------ */\n\n/** Style an HTTP status code by its class. */\nfunction styleStatus(status: number): string {\n const text = String(status);\n if (status >= 500) return magenta(text);\n if (status >= 400) return red(text);\n if (status >= 300) return yellow(text);\n return green(text);\n}\n\n/**\n * Cosmetic noise suppression: inspector shell page loads and favicon probes\n * add nothing to a request log.\n */\nfunction isNoisyRequest(httpMethod: string, pathname: string): boolean {\n if (httpMethod !== \"GET\" && httpMethod !== \"HEAD\") return false;\n return pathname.includes(\"/inspector\") || pathname.endsWith(\"/favicon.ico\");\n}\n\n/**\n * Fetch middleware logging every request in the compact two-line format (see\n * the module docs). `MCPServer` registers it automatically unless\n * `config.logging.enabled` is `false`.\n */\nexport function requestLogger(options: LoggingOptions = {}): FetchMiddleware {\n if (options.enabled === false) {\n return (_request, next) => next();\n }\n return async (request, next) => {\n const level = resolveLogLevel(options.level);\n const startedAt = Date.now();\n const httpMethod = request.method;\n const pathname = new URL(request.url).pathname;\n\n if (isNoisyRequest(httpMethod, pathname)) {\n return next();\n }\n\n const requestHeaders: Record<string, string> = {};\n if (level === \"trace\") {\n request.headers.forEach((value, key) => {\n requestHeaders[key] = value;\n });\n }\n\n let requestBody: unknown;\n if (httpMethod !== \"GET\" && httpMethod !== \"HEAD\") {\n const parsedBody = getRequestBag(request).parsedBody;\n if (parsedBody !== undefined) {\n requestBody = parsedBody;\n } else {\n try {\n requestBody = await request.clone().json();\n } catch {\n // Non-JSON body — the summary line logs without MCP detail.\n }\n }\n }\n\n const response = await next();\n\n const durationMs = Date.now() - startedAt;\n const timestamp = new Date().toISOString().substring(11, 19);\n const mcpRequest = isJSONRPCRequest(requestBody) ? requestBody : undefined;\n const isStreamingMethod = mcpRequest?.method === \"subscriptions/listen\";\n\n const lines: string[] = [\n [\n dim(timestamp),\n bold(httpMethod),\n pathname,\n styleStatus(response.status),\n dim(`in ${durationMs}ms`),\n ].join(\" \"),\n ];\n\n if (mcpRequest !== undefined) {\n const method = sanitize(mcpRequest.method);\n const parts: string[] = [` ${methodStyle(method)(method)}`];\n const detail = formatDetail(mcpRequest);\n if (detail.subject !== undefined) {\n parts.push(bold(sanitize(detail.subject)));\n }\n const echoPayloads = level !== \"info\";\n if (echoPayloads && detail.input !== undefined) {\n parts.push(inlineJson(detail.input));\n }\n const outcome: ResponseOutcome = isStreamingMethod\n ? { errorMessage: null }\n : await extractResponseOutcome(response);\n if (\n echoPayloads &&\n mcpRequest.method === \"tools/call\" &&\n outcome.errorMessage === null &&\n outcome.result !== undefined\n ) {\n parts.push(dim(\"->\"), inlineJson(compactToolResult(outcome.result)));\n }\n if (mcpRequest.method !== \"initialize\") {\n const client = formatClientIdentity(mcpRequest);\n if (client !== undefined) parts.push(dim(sanitize(client)));\n }\n if (outcome.errorMessage !== null) {\n parts.push(red(`ERROR ${sanitize(outcome.errorMessage)}`));\n } else if (response.status >= 400) {\n parts.push(red(`ERROR (HTTP ${response.status})`));\n }\n lines.push(parts.join(\" \"));\n }\n\n console.log(lines.join(\"\\n\"));\n\n if (level === \"trace\") {\n await printTraceDump(\n response,\n requestHeaders,\n requestBody,\n !isStreamingMethod\n );\n }\n\n return response;\n };\n}\n","import {\n createMcpHandler,\n type AuthInfo,\n type CreateMcpHandlerOptions,\n type McpHttpHandler,\n type McpServerFactory,\n} from \"@modelcontextprotocol/server\";\n\nimport { getRequestBag, matchesPath, type FetchHandler } from \"./fetch-app.js\";\nimport {\n extractClientCapabilitiesFromBody,\n stashClientCapabilities,\n} from \"./views/capabilities.js\";\n\n/** Options for {@link createMcpMount}. */\nexport interface MountMcpOptions {\n /** Route path the MCP endpoint is served on. Defaults to `/mcp`. */\n path?: string;\n /**\n * Options forwarded to the SDK's `createMcpHandler`.\n *\n * `legacy` defaults to `\"stateless\"`: 2025-era (non-envelope) requests are\n * served by a fresh instance over a session-less streamable HTTP transport.\n * Pass `legacy: \"reject\"` for modern-only strict serving, where\n * legacy-classified requests get the unsupported-protocol-version error.\n */\n handler?: CreateMcpHandlerOptions;\n /**\n * Produce verified {@link AuthInfo} for the request before the SDK handler\n * runs. When omitted, requests are served without authenticated identity.\n */\n authInfo?: (request: Request) => AuthInfo | undefined;\n}\n\n/** Result of {@link createMcpMount}. */\nexport interface McpMount {\n /** Underlying SDK handler (`close`, `notify`, `bus`). */\n handler: McpHttpHandler;\n /** Fetch handler for the MCP path only (compose into a larger app). */\n fetch: FetchHandler;\n}\n\n/**\n * Create the MCP Streamable HTTP endpoint as a fetch handler.\n *\n * Returns the underlying `McpHttpHandler` so callers can call `close()` on\n * shutdown to abort in-flight exchanges, and use `notify`/`bus` for\n * list-changed notifications.\n *\n * Compose the returned `fetch` into a larger app with {@link composeFetch}\n * from `mcp-use`, and put Host/Origin validation in front when binding\n * locally or exposing the process directly.\n *\n * @example\n * ```ts\n * const { handler, fetch: mcpFetch } = createMcpMount(factory);\n * const app = composeFetch(mcpFetch, jsonBodyMiddleware(), hostValidationMiddleware(hosts));\n * ```\n */\nexport function createMcpMount(\n factory: McpServerFactory,\n options: MountMcpOptions = {}\n): McpMount {\n const {\n path = \"/mcp\",\n handler: handlerOptions,\n authInfo: getAuthInfo,\n } = options;\n const legacyMode = handlerOptions?.legacy ?? \"stateless\";\n const handler = createMcpHandler(factory, {\n legacy: \"stateless\",\n ...handlerOptions,\n });\n\n const fetch: FetchHandler = async (request) => {\n if (!matchesPath(request, path)) {\n return new Response(\"Not Found\", { status: 404 });\n }\n\n // ponytail: stateless wire is POST-only; SDK GET/DELETE/HEAD probes are optional.\n // 204 avoids browser console noise from 405 while remaining client-safe.\n if (legacyMode === \"stateless\") {\n const method = request.method.toUpperCase();\n if (method === \"GET\" || method === \"DELETE\" || method === \"HEAD\") {\n return new Response(null, { status: 204 });\n }\n }\n\n const bag = getRequestBag(request);\n let parsedBody = bag.parsedBody;\n if (parsedBody === undefined) {\n try {\n parsedBody = await request.clone().json();\n } catch {\n // Non-JSON or empty body — the SDK handler will surface the error.\n }\n }\n\n const capabilities = extractClientCapabilitiesFromBody(parsedBody);\n if (capabilities !== undefined) {\n stashClientCapabilities(request, capabilities);\n }\n\n const authInfo = getAuthInfo?.(request) ?? bag.authInfo;\n return handler.fetch(request, {\n ...(parsedBody !== undefined && { parsedBody }),\n ...(authInfo !== undefined && { authInfo }),\n });\n };\n\n return { handler, fetch };\n}\n","import type {\n CallToolResult,\n InputRequiredResult,\n MetaObject,\n StandardSchemaWithJSON,\n ToolAnnotations,\n} from \"@modelcontextprotocol/server\";\n\nimport type { McpUiResourceCsp } from \"@modelcontextprotocol/ext-apps\";\n\nimport type { RequestContext } from \"./context.js\";\nimport type { UiPermissions } from \"./views/types.js\";\n\n/**\n * Binds a tool to a view directory for MCP Apps rendering.\n *\n * Any number of tools may share the same `name`. Resource facts\n * (`description`, `csp`, `permissions`, `domain`, `prefersBorder`) have one\n * authoring point — at most one binder may declare them; others pass only\n * `{ name }`. The view file exports only the component; the framework reads\n * these fields at registration and emits them on the bound view's MCP\n * resource (hosts read resource `_meta.ui`, not tool-level copies).\n */\nexport interface ToolViewConfig {\n /** View directory / manifest name, e.g. `\"product-search-result\"`. */\n name: string;\n /**\n * Human-readable description of the view resource → the resource's\n * `description` on `resources/list` and `resources/read`.\n */\n description?: string;\n /**\n * CSP domains the host must allow → resource `_meta.ui.csp`. The framework\n * auto-appends its serving origin to `resourceDomains` at emission time;\n * other author-set fields (`frameDomains`, `baseUriDomains`, …) pass through.\n */\n csp?: McpUiResourceCsp;\n /** Sandbox permissions the view needs → resource `_meta.ui.permissions`. */\n permissions?: UiPermissions;\n /**\n * Dedicated origin hint for hosts that render views on a separate domain →\n * resource `_meta.ui.domain`.\n */\n domain?: string;\n /**\n * Ask the host to draw a border around the view → resource\n * `_meta.ui.prefersBorder`.\n */\n prefersBorder?: boolean;\n}\n\n/** Declares a tool's identity, LLM-facing description, and schemas. First argument to {@link MCPServer.tool}. */\nexport interface ToolDefinition {\n /** Unique tool identifier, e.g. `\"fetch-weather\"`. */\n name: string;\n /** Human-readable title shown in UIs (falls back to `name`). */\n title?: string;\n /** LLM-facing description of what the tool does. */\n description?: string;\n /**\n * Object schema for input validation — any Standard Schema library with\n * JSON Schema conversion ({@link StandardSchemaWithJSON}): zod v4, ArkType,\n * Valibot, …. Field descriptions become LLM hints. Input is validated by\n * the SDK before the callback runs. Emitted on the wire as `inputSchema`.\n */\n inputSchema?: StandardSchemaWithJSON;\n /**\n * Alias for {@link ToolDefinition.inputSchema}. Prefer `inputSchema` in new\n * code — it matches the MCP wire field name.\n */\n schema?: StandardSchemaWithJSON;\n /**\n * Schema for structured output ({@link StandardSchemaWithJSON}). Any JSON\n * root is allowed — object, array, or primitive (2026-07-28 protocol).\n * When set, the callback must return a result carrying matching\n * `structuredContent` or an explicit `isError` result — enforced at\n * compile time and validated by the SDK at runtime.\n */\n outputSchema?: StandardSchemaWithJSON;\n /** Behavioral hints for clients (readOnlyHint, destructiveHint, …). */\n annotations?: ToolAnnotations;\n /**\n * Extension metadata advertised on this tool's `tools/list` descriptor.\n *\n * Use vendor-namespaced keys for custom data. This definition metadata is\n * distinct from a tool callback result's `_meta`: it describes the tool,\n * while result `_meta` belongs to one invocation. For view-bound or\n * visibility-restricted tools, framework-owned MCP Apps keys are derived\n * from {@link ToolDefinition.view} and {@link ToolDefinition.visibility};\n * those derived values take precedence over colliding entries here.\n */\n _meta?: MetaObject;\n /**\n * Declares who may call or see the tool. Emitted as `_meta.ui.visibility`\n * on `tools/list`. Omitted = host default (callable by the model, visible\n * to the app). The server always lists every registered tool — hosts\n * filter by this declaration; the server never omits tools from\n * `tools/list`. `\"app\"` marks app-private helper tools callable from\n * views via `useCallTool` while the host hides them from the model.\n */\n visibility?: \"model\" | \"app\";\n /**\n * Bind this tool to a view for MCP Apps rendering. Requires\n * {@link ToolDefinition.outputSchema} — the view reads the result's\n * `structuredContent` typed by this schema.\n */\n view?: ToolViewConfig;\n}\n\n/**\n * Handle returned by {@link MCPServer.tool} — carries the tool name at runtime\n * and phantom input/output types for inference (e.g. `Register` / `useCallTool`).\n */\nexport interface ToolRef<\n Name extends string = string,\n Input = Record<string, unknown>,\n Output = never,\n> {\n /** The tool's registered name. */\n readonly name: Name;\n /**\n * Phantom carrier for the tool's inferred input/output types. Never set at\n * runtime.\n *\n * @internal\n */\n readonly \"~types\"?: { input: Input; output: Output };\n}\n\n/**\n * Result a tool callback may return, keyed by the tool's inferred output\n * type. Completed calls use the SDK's raw {@link CallToolResult}; interactive\n * calls may return an {@link InputRequiredResult}. There is no\n * framework-specific result layer.\n *\n * Without an `outputSchema` (`TOutput = never`) any `CallToolResult` is\n * accepted. With one, the result must carry `structuredContent` matching the\n * schema or set `isError: true` — mirroring the SDK's runtime rule, which\n * rejects results from schema'd tools that carry no structured content\n * unless `isError` is set.\n *\n * The SDK auto-appends a JSON text block when `structuredContent` is a\n * non-object value and no `type: \"text\"` block is present; for object-shaped\n * payloads include the text serialization yourself:\n *\n * ```ts\n * return {\n * content: [{ type: \"text\", text: JSON.stringify(data) }],\n * structuredContent: data,\n * };\n * ```\n */\nexport type ToolResult<TOutput = never> =\n | InputRequiredResult\n | ([TOutput] extends [never]\n ? CallToolResult\n :\n | (CallToolResult & { structuredContent: TOutput })\n | (CallToolResult & { isError: true }));\n\n/** Infer the callback params type from a tool definition's input schema. */\nexport type InferToolInput<T> = T extends {\n inputSchema: infer S extends StandardSchemaWithJSON;\n}\n ? StandardSchemaWithJSON.InferOutput<S> extends Record<string, unknown>\n ? StandardSchemaWithJSON.InferOutput<S>\n : Record<string, unknown>\n : T extends {\n schema: infer S extends StandardSchemaWithJSON;\n }\n ? StandardSchemaWithJSON.InferOutput<S> extends Record<string, unknown>\n ? StandardSchemaWithJSON.InferOutput<S>\n : Record<string, unknown>\n : Record<string, unknown>;\n\n/**\n * Resolve a tool definition's input schema. `inputSchema` wins when both are\n * set.\n *\n * @internal\n */\nexport function resolveToolInputSchema(\n definition: Pick<ToolDefinition, \"inputSchema\" | \"schema\">\n): StandardSchemaWithJSON | undefined {\n return definition.inputSchema ?? definition.schema;\n}\n\n/**\n * Infer the structured output type from a definition's `outputSchema` —\n * any JSON root, not just objects (2026-07-28 protocol); `never` when the\n * definition declares none (any {@link CallToolResult} is then accepted —\n * see {@link ToolResult}).\n */\nexport type InferToolOutput<T> = T extends {\n outputSchema: infer S extends StandardSchemaWithJSON;\n}\n ? StandardSchemaWithJSON.InferOutput<S>\n : never;\n\n/** Infer the literal tool name from a definition's `name` field. */\nexport type InferToolName<T> = T extends { name: infer N extends string }\n ? N\n : string;\n\n/**\n * Tool execution callback. The return type is {@link ToolResult}: tools with\n * an `outputSchema` must return matching `structuredContent` or an `isError`\n * result; tools without one accept any {@link CallToolResult}.\n */\nexport type ToolCallback<\n TInput = Record<string, unknown>,\n TOutput = never,\n TUser = never,\n HasOAuth extends boolean = false,\n> = (\n params: TInput,\n ctx: RequestContext<TUser, HasOAuth>\n) => ToolResult<TOutput> | Promise<ToolResult<TOutput>>;\n","import type { ViewsManifest } from \"./types.js\";\n\n/**\n * Symbol-keyed method on {@link MCPServer} that primes the views registry\n * from a build/dev manifest.\n *\n * @internal\n */\nexport const registerViews: unique symbol = Symbol(\"mcp-use/registerViews\");\n\n/**\n * Options for priming the views registry.\n *\n * @internal\n */\nexport interface RegisterViewsOptions {\n /**\n * When true, resource CSP emission appends the serving origin's websocket\n * variant to `connectDomains` so Vite HMR passes host-enforced CSP.\n */\n dev?: boolean;\n /**\n * Absolute project root for resolving the `public/` directory in dev.\n * Defaults to `process.cwd()` when omitted (production `start`).\n */\n projectRoot?: string;\n}\n\n/** Type of the {@link registerViews} method on {@link MCPServer}. */\nexport type RegisterViews = (\n views: ViewsManifest,\n options?: RegisterViewsOptions\n) => void;\n","import type { McpUiResourceCsp } from \"@modelcontextprotocol/ext-apps\";\n\nimport type { ViewResourceFacts } from \"./types.js\";\n\ntype CspCategory =\n | \"connectDomains\"\n | \"resourceDomains\"\n | \"frameDomains\"\n | \"baseUriDomains\";\n\nconst CATEGORY_ENV: Record<CspCategory, string> = {\n connectDomains: \"CSP_CONNECT_DOMAINS\",\n resourceDomains: \"CSP_RESOURCE_DOMAINS\",\n frameDomains: \"CSP_FRAME_DOMAINS\",\n baseUriDomains: \"CSP_BASE_URI_DOMAINS\",\n};\n\n/** Parse a comma-separated env var into trimmed non-empty domain strings. */\nexport function parseDomainList(raw: string | undefined): string[] {\n if (raw === undefined || raw.trim() === \"\") {\n return [];\n }\n return raw\n .split(\",\")\n .map((s) => s.trim())\n .filter((s) => s.length > 0);\n}\n\nfunction readEnvDomains(name: string): string[] | undefined {\n if (typeof process === \"undefined\") {\n return undefined;\n }\n const raw = process.env[name];\n if (raw === undefined || raw.trim() === \"\") {\n return undefined;\n }\n return parseDomainList(raw);\n}\n\n/** Domains from `CSP_URLS` (shortcut for all categories). */\nexport function readCspUrlsShortcut(): string[] {\n return readEnvDomains(\"CSP_URLS\") ?? [];\n}\n\n/** Per-category env override, or `CSP_URLS` when the category var is unset. */\nexport function readEnvDomainsForCategory(category: CspCategory): string[] {\n const perCategory = readEnvDomains(CATEGORY_ENV[category]);\n if (perCategory !== undefined) {\n return perCategory;\n }\n return readCspUrlsShortcut();\n}\n\n/**\n * Merge domain lists: earlier segments win on duplicate (higher priority).\n */\nexport function mergeDomainLists(...segments: string[][]): string[] {\n const seen = new Set<string>();\n const out: string[] = [];\n for (const segment of segments) {\n for (const domain of segment) {\n if (!seen.has(domain)) {\n seen.add(domain);\n out.push(domain);\n }\n }\n }\n return out;\n}\n\n/**\n * Resolved origins and flags used when merging author, env, and MCP CSP domains.\n *\n * @internal\n */\nexport interface BuildCspOptions {\n /** Public server origin from `MCP_URL` or forwarded request headers. */\n serverOrigin: string;\n /** Assets origin derived from `MCP_ASSETS_URL` or the server origin. */\n assetsOrigin: string;\n /** When false, server origin is appended to resourceDomains (same-origin assets). */\n explicitAssetsBase: boolean;\n /** When true, append the server origin's websocket variant for Vite HMR. */\n hmrWs?: boolean;\n}\n\nfunction toWebSocketOrigin(serverOrigin: string): string {\n if (serverOrigin.startsWith(\"https://\")) {\n return `wss://${serverOrigin.slice(\"https://\".length)}`;\n }\n if (serverOrigin.startsWith(\"http://\")) {\n return `ws://${serverOrigin.slice(\"http://\".length)}`;\n }\n return serverOrigin;\n}\n\n/**\n * Build final `_meta.ui.csp` from author facts, env vars, and MCP auto-append.\n *\n * Precedence (high → low): author → env (`CSP_*_DOMAINS` or `CSP_URLS`) →\n * MCP auto-append (lowest).\n */\nexport function buildMergedResourceCsp(\n authorFacts: ViewResourceFacts | undefined,\n options: BuildCspOptions\n): McpUiResourceCsp {\n const author = authorFacts?.csp;\n\n const mcpConnectAuto: string[] = [];\n if (options.serverOrigin !== \"\") {\n mcpConnectAuto.push(options.serverOrigin);\n if (options.hmrWs === true) {\n mcpConnectAuto.push(toWebSocketOrigin(options.serverOrigin));\n }\n }\n\n const mcpResourceAuto: string[] = [];\n const resourceOrigin = options.explicitAssetsBase\n ? options.assetsOrigin\n : options.serverOrigin;\n if (resourceOrigin !== \"\") {\n mcpResourceAuto.push(resourceOrigin);\n }\n\n const connectDomains = mergeDomainLists(\n author?.connectDomains ?? [],\n readEnvDomainsForCategory(\"connectDomains\"),\n mcpConnectAuto\n );\n\n const resourceDomains = mergeDomainLists(\n author?.resourceDomains ?? [],\n readEnvDomainsForCategory(\"resourceDomains\"),\n mcpResourceAuto\n );\n\n const frameDomains = mergeDomainLists(\n author?.frameDomains ?? [],\n readEnvDomainsForCategory(\"frameDomains\")\n );\n\n const baseUriDomains = mergeDomainLists(\n author?.baseUriDomains ?? [],\n readEnvDomainsForCategory(\"baseUriDomains\")\n );\n\n return {\n ...author,\n connectDomains,\n resourceDomains,\n frameDomains,\n baseUriDomains,\n };\n}\n","import {\n matchesPathPrefix,\n pathUnderBase,\n pathnameOf,\n type FetchHandler,\n} from \"../fetch-app.js\";\nimport type { ViewManifestEntry } from \"./types.js\";\n\nconst PUBLIC_BUILD_DIR = \".mcp-use/build/views/public\";\nconst PUBLIC_DEV_DIR = \"public\";\nconst VIEW_ASSETS_BUILD_ROOT = \".mcp-use/build/views\";\n\n/**\n * Fetch handler for built view bundles under\n * `${basePath}/_mcp-use/views/<name>/…`.\n *\n * Production only — dev serves view modules through Vite middleware.\n *\n * @param basePath - MCP mount prefix (e.g. `/mcp`).\n * @param views - Primed view registry; empty skips mounting.\n * @param options - `projectRoot` defaults to `process.cwd()`.\n *\n * @internal\n */\nexport function createViewAssetsHandler(\n basePath: string,\n views: ReadonlyMap<string, ViewManifestEntry>,\n options?: { projectRoot?: string; deferCors?: boolean }\n): FetchHandler | undefined {\n if (views.size === 0) {\n return undefined;\n }\n\n const assetsPrefix = pathUnderBase(basePath, \"_mcp-use/views\");\n const projectRoot = options?.projectRoot ?? process.cwd();\n\n return async (request) => {\n if (request.method !== \"GET\" && request.method !== \"HEAD\") {\n return new Response(\"Method Not Allowed\", { status: 405 });\n }\n if (!matchesPathPrefix(request, assetsPrefix)) {\n return new Response(\"Not Found\", { status: 404 });\n }\n\n const pathname = pathnameOf(request);\n const remainder = pathname.slice(assetsPrefix.length + 1);\n const slash = remainder.indexOf(\"/\");\n if (slash <= 0 || slash === remainder.length - 1) {\n return new Response(\"Not Found\", { status: 404 });\n }\n\n const viewName = remainder.slice(0, slash);\n const subpath = remainder.slice(slash + 1);\n const entry = views.get(viewName);\n if (entry === undefined || entry.kind !== \"external\") {\n return new Response(\"Not Found\", { status: 404 });\n }\n\n const [{ join }, { resolvePublicFilePath, servePublicFile }] =\n await Promise.all([import(\"node:path\"), import(\"./public-route.js\")]);\n const viewRoot = join(projectRoot, VIEW_ASSETS_BUILD_ROOT, viewName);\n const diskPath = await resolvePublicFilePath(viewRoot, subpath);\n if (diskPath === null) {\n return new Response(\"Not Found\", { status: 404 });\n }\n return await servePublicFile(\n diskPath,\n options?.deferCors === true ? { deferCors: true } : {}\n );\n };\n}\n\n/**\n * Fetch handler for public view assets under `${basePath}/_mcp-use/public/`.\n *\n * Public responses include `Access-Control-Allow-Origin: *` for\n * cross-origin sandboxed view iframes.\n *\n * Node filesystem modules load only on the first public-asset request so the\n * library entry stays edge-safe for `getHandler()`-only deployments.\n *\n * @param basePath - MCP mount prefix (e.g. `/mcp`).\n * @param views - Primed view registry; empty skips mounting.\n * @param options - When `dev` is true, the public route reads from\n * `<projectRoot>/public` instead of `.mcp-use/build/views/public/`.\n * `projectRoot` defaults to `process.cwd()`.\n *\n * @internal\n */\nexport function createViewPublicHandler(\n basePath: string,\n views: ReadonlyMap<string, ViewManifestEntry>,\n options?: { dev?: boolean; projectRoot?: string; deferCors?: boolean }\n): FetchHandler | undefined {\n if (views.size === 0) {\n return undefined;\n }\n\n const publicPrefix = pathUnderBase(basePath, \"_mcp-use/public\");\n const subdir = options?.dev === true ? PUBLIC_DEV_DIR : PUBLIC_BUILD_DIR;\n const projectRoot = options?.projectRoot ?? process.cwd();\n\n return async (request) => {\n if (request.method !== \"GET\" && request.method !== \"HEAD\") {\n return new Response(\"Method Not Allowed\", { status: 405 });\n }\n if (!matchesPathPrefix(request, publicPrefix)) {\n return new Response(\"Not Found\", { status: 404 });\n }\n\n const pathname = pathnameOf(request);\n const subpath = pathname.slice(publicPrefix.length + 1);\n if (subpath.length === 0) {\n return new Response(\"Not Found\", { status: 404 });\n }\n\n const [{ join }, { resolvePublicFilePath, servePublicFile }] =\n await Promise.all([import(\"node:path\"), import(\"./public-route.js\")]);\n const publicRoot = join(projectRoot, subdir);\n const diskPath = await resolvePublicFilePath(publicRoot, subpath);\n if (diskPath === null) {\n return new Response(\"Not Found\", { status: 404 });\n }\n return await servePublicFile(\n diskPath,\n options?.deferCors === true ? { deferCors: true } : {}\n );\n };\n}\n\n/**\n * @deprecated Use {@link createViewPublicHandler}.\n *\n * @internal\n */\nexport function mountViewRoutes(): void {\n throw new Error(\n \"mountViewRoutes(app) was removed — use createViewPublicHandler\"\n );\n}\n","import type { MetaObject } from \"@modelcontextprotocol/server\";\n\nimport type { ViewManifestEntry, ViewResourceFacts } from \"./types.js\";\nimport {\n UI_META_KEY,\n UI_MIME_TYPE,\n UI_RESOURCE_URI_META_KEY,\n viewResourceUri,\n} from \"./constants.js\";\nimport { buildMergedResourceCsp, type BuildCspOptions } from \"./csp-env.js\";\nimport {\n hasExplicitAssetsBase,\n originFromAssetsBase,\n resolveAssetsBase,\n resolveServerOrigin,\n} from \"./origin.js\";\n\n/**\n * Tool declaration `_meta` for `tools/list`.\n *\n * When `viewName` is set, emits `ui.resourceUri` plus the legacy flat\n * {@link UI_RESOURCE_URI_META_KEY} key. When `visibility` is set, emits\n * `ui.visibility: [visibility]`. Either may be set independently — a\n * view-less tool can still declare app-only visibility. Returns `undefined`\n * only when no view, visibility, or existing metadata is provided.\n *\n * @param viewName - Bound view directory / manifest key, or `undefined` when\n * the tool has no view.\n * @param visibility - Optional model/app visibility narrowing from the tool\n * definition's top-level `visibility` field.\n * @param existingMetadata - Optional author-supplied definition metadata. Other\n * keys pass through, while framework-owned resource URI and visibility keys\n * are derived exclusively from `viewName` and `visibility`.\n * @returns Wire metadata for the tool listing, or `undefined` when there is\n * nothing to emit.\n */\nexport function buildToolUiMeta(\n viewName: string | undefined,\n visibility: \"model\" | \"app\" | undefined,\n existingMetadata?: MetaObject\n): MetaObject | undefined {\n if (\n viewName === undefined &&\n visibility === undefined &&\n existingMetadata === undefined\n ) {\n return undefined;\n }\n\n const meta: MetaObject = { ...existingMetadata };\n const existingUi = existingMetadata?.[UI_META_KEY];\n const existingUiIsObject =\n typeof existingUi === \"object\" &&\n existingUi !== null &&\n !Array.isArray(existingUi);\n const ui: MetaObject = existingUiIsObject ? { ...existingUi } : {};\n\n if (viewName !== undefined) {\n const resourceUri = viewResourceUri(viewName);\n ui[\"resourceUri\"] = resourceUri;\n meta[UI_RESOURCE_URI_META_KEY] = resourceUri;\n } else {\n // These keys describe the top-level view contract. Do not advertise an\n // author-supplied URI when the tool has no declared view.\n delete ui[\"resourceUri\"];\n delete meta[UI_RESOURCE_URI_META_KEY];\n }\n\n if (visibility !== undefined) {\n ui[\"visibility\"] = [visibility];\n } else {\n // Visibility is likewise derived exclusively from the top-level field.\n delete ui[\"visibility\"];\n }\n\n if (\n viewName !== undefined ||\n visibility !== undefined ||\n existingUiIsObject\n ) {\n meta[UI_META_KEY] = ui;\n }\n\n return meta;\n}\n\n/**\n * Tool result `_meta` stamped on every non-error `CallToolResult` from a\n * view-bound tool.\n *\n * Emits the nested `ui.resourceUri` key and the legacy flat\n * {@link UI_RESOURCE_URI_META_KEY} key so hosts can open the bound view.\n * Error results (`isError: true`) must not receive this metadata — a\n * stamped URI would create a new rendered view through legacy host\n * behavior. Result `_meta` is view-only and never enters model context.\n *\n * @param viewName - Bound view directory / manifest key.\n * @returns Nested and legacy resource-URI wire keys.\n */\nexport function buildToolResultUiMeta(\n viewName: string\n): Record<string, unknown> {\n const resourceUri = viewResourceUri(viewName);\n return {\n [UI_META_KEY]: { resourceUri },\n [UI_RESOURCE_URI_META_KEY]: resourceUri,\n };\n}\n\n/**\n * Options for {@link buildResourceUiMeta}.\n *\n * @internal\n */\nexport interface BuildResourceUiMetaOptions {\n /** Request used to resolve server/assets origins when not passed explicitly. */\n request?: Request;\n /** Explicit server origin (overrides request resolution). */\n serverOrigin?: string;\n /** Explicit assets URL prefix (overrides request resolution). */\n assetsBase?: string;\n /**\n * When true, append the server origin's websocket variant to\n * `csp.connectDomains` for Vite HMR under host-enforced CSP.\n */\n hmrWs?: boolean;\n}\n\nfunction resolveCspOptions(\n options?: BuildResourceUiMetaOptions\n): BuildCspOptions {\n const request = options?.request;\n const serverOrigin =\n options?.serverOrigin ??\n (request !== undefined ? resolveServerOrigin(request) : \"\");\n const assetsBase =\n options?.assetsBase ??\n (request !== undefined ? resolveAssetsBase(request) : serverOrigin);\n\n return {\n serverOrigin,\n assetsOrigin: originFromAssetsBase(assetsBase),\n explicitAssetsBase: hasExplicitAssetsBase(),\n ...(options?.hmrWs === true ? { hmrWs: true as const } : {}),\n };\n}\n\n/**\n * Resource `_meta.ui` for a primed view.\n *\n * Emits `csp` by merging author `view.csp`, env (`CSP_URLS` / `CSP_*_DOMAINS`),\n * and MCP auto-append (`MCP_URL` → connect; assets origin → resource).\n */\nexport function buildResourceUiMeta(\n authorFacts: ViewResourceFacts | undefined,\n options?: BuildResourceUiMetaOptions\n): Record<string, unknown> {\n const csp = buildMergedResourceCsp(authorFacts, resolveCspOptions(options));\n\n const ui: Record<string, unknown> = { csp };\n\n if (authorFacts?.permissions !== undefined) {\n ui[\"permissions\"] = authorFacts.permissions;\n }\n if (authorFacts?.domain !== undefined) {\n ui[\"domain\"] = authorFacts.domain;\n }\n if (authorFacts?.prefersBorder !== undefined) {\n ui[\"prefersBorder\"] = authorFacts.prefersBorder;\n }\n\n return { [UI_META_KEY]: ui };\n}\n\n/**\n * Listing metadata for a primed view resource.\n */\nexport function viewResourceConfig(\n _viewName: string,\n _entry: ViewManifestEntry,\n authorFacts: ViewResourceFacts | undefined,\n options?: BuildResourceUiMetaOptions\n): {\n mimeType: string;\n description?: string;\n _meta: Record<string, unknown>;\n} {\n return {\n mimeType: UI_MIME_TYPE,\n ...(authorFacts?.description !== undefined && {\n description: authorFacts.description,\n }),\n _meta: buildResourceUiMeta(authorFacts, options),\n };\n}\n","/**\n * `mcp-use` — MCP server framework on the official v2 SDK (fetch-native).\n *\n * Greenfield rebuild of the mcp-use server package against the stateless\n * 2026-07-28 MCP protocol. See specs/SPEC.md for the phase plan and API contract.\n */\n\nexport { MCPServer } from \"./server.js\";\nexport { createMcpMount } from \"./mount-mcp.js\";\nexport type { MountMcpOptions, McpMount } from \"./mount-mcp.js\";\nexport {\n composeFetch,\n getRequestBag,\n hostValidationMiddleware,\n jsonBodyMiddleware,\n matchesPath,\n matchesPathPrefix,\n originValidationMiddleware,\n pathnameOf,\n routeFetch,\n toFrameworkHandler,\n} from \"./fetch-app.js\";\nexport type {\n FetchHandler,\n FetchMiddleware,\n FrameworkHandler,\n FrameworkRequestLike,\n RequestBag,\n} from \"./fetch-app.js\";\nexport { registerViews } from \"./views/index.js\";\nexport { requestLogger } from \"./logging.js\";\nexport type { LoggingOptions, LogLevel } from \"./logging.js\";\nexport type {\n LandingPageOptions,\n LandingPagePrompt,\n LandingPageResource,\n LandingPageTool,\n} from \"./landing.js\";\n\n/**\n * Wire result shapes (re-exported from the SDK): callbacks return these raw\n * shapes directly — tools return {@link CallToolResult}, resources\n * {@link ReadResourceResult}, prompts {@link GetPromptResult}. There is no\n * framework-specific result layer.\n */\nexport type {\n CallToolResult,\n ContentBlock,\n GetPromptResult,\n InputRequest,\n InputRequiredResult,\n InputResponses,\n PromptMessage,\n ReadResourceResult,\n} from \"@modelcontextprotocol/server\";\n/**\n * Official SDK descriptor metadata contracts. Tools use\n * {@link ToolAnnotations}; resources and resource templates use\n * {@link Annotations}; every descriptor's extension `_meta` uses\n * {@link MetaObject}.\n */\nexport type {\n Annotations,\n MetaObject,\n ToolAnnotations,\n} from \"@modelcontextprotocol/server\";\n/**\n * Official SDK helpers for authoring and reading multi-round-trip\n * `input_required` results.\n */\nexport {\n acceptedContent,\n createRequestStateCodec,\n inputRequired,\n inputResponse,\n isInputRequiredResult,\n} from \"@modelcontextprotocol/server\";\n\nexport { completable } from \"./completable.js\";\nexport type { CompletionCallback, CompletionContext } from \"./completable.js\";\n\n/**\n * Schema contracts accepted by `inputSchema`/`outputSchema` fields (re-exported\n * from the SDK): `StandardSchemaWithJSON` requires validation plus JSON\n * Schema conversion; `completable()` needs only `StandardSchemaV1`.\n * Implemented by zod v4, ArkType, Valibot, …\n */\nexport type {\n StandardSchemaV1,\n StandardSchemaWithJSON,\n} from \"@modelcontextprotocol/server\";\n\nexport type { InspectorOptions, ServerConfig, CorsOptions } from \"./config.js\";\nexport type {\n MiddlewareContext,\n McpCompleteEventListenerFn,\n McpEventListenerFn,\n McpMiddlewareFn,\n McpMiddlewareFnFor,\n McpMiddlewarePatternMap,\n PromptsGetMiddlewareContext,\n ResourcesReadMiddlewareContext,\n ToolsCallMiddlewareContext,\n} from \"./middleware/mcp-middleware.js\";\nexport {\n composeMiddleware,\n matchesPattern,\n} from \"./middleware/mcp-middleware.js\";\nexport type { NodeRequestHandler } from \"./node-bridge.js\";\nexport type {\n FromOpenAPIOptions,\n OpenAPIAuth,\n OpenAPIDocument,\n OpenAPIExcludeRule,\n} from \"./openapi/index.js\";\nexport type {\n Elicit,\n ElicitationResult,\n OAuthAuth,\n RequestClientContext,\n RequestContext,\n} from \"./context.js\";\nexport type {\n InferToolInput,\n InferToolName,\n InferToolOutput,\n ToolCallback,\n ToolDefinition,\n ToolRef,\n ToolResult,\n ToolViewConfig,\n} from \"./tools.js\";\nexport type {\n ExternalViewManifestEntry,\n InlineViewManifestEntry,\n UiPermissions,\n ViewManifestEntry,\n ViewsManifest,\n} from \"./views/index.js\";\nexport type {\n InferTemplateParams,\n ResourceCallback,\n ResourceDefinition,\n ResourceTemplateCallback,\n ResourceTemplateCompleter,\n ResourceTemplateCompletions,\n ResourceTemplateDefinition,\n TemplateVariableValue,\n} from \"./resources.js\";\nexport type {\n InferPromptInput,\n PromptCallback,\n PromptDefinition,\n} from \"./prompts.js\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb;AAAA,EACA;AAAA,OAOK;;;AC8NA,SAAS,mBAAmB,QAAsC;AACvE,MAAI,OAAO,aAAa,QAAW;AACjC,QAAI,OAAO,OAAO,aAAa,UAAU;AACvC,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IACF;AACA,UAAM,EAAE,SAAS,IAAI;AACrB,QACE,CAAC,SAAS,WAAW,GAAG,KACxB,SAAS,SAAS,GAAG,KACrB,SAAS,SAAS,GAAG,KACrB,KAAK,KAAK,QAAQ,KAClB,SAAS,SAAS,IAAI,KACrB,SAAS,SAAS,KAAK,SAAS,SAAS,GAAG,GAC7C;AACA,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;;;AC/PA;AAAA,EACE,gCAAAA;AAAA,EACA;AAAA,EACA;AAAA,OAOK;;;ACVP;AAAA,EACE;AAAA,OAEK;;;ACFA,IAAM,kBAAkB;AAGxB,IAAM,eAAe;AAGrB,IAAM,yBAAyB;AAG/B,IAAM,cAAc;AAGpB,IAAM,2BAA2B;AAOjC,SAAS,gBAAgB,UAA0B;AACxD,SAAO,GAAG,sBAAsB,GAAG,QAAQ;AAC7C;;;ADdA,IAAM,8BAA8B,oBAAI,QAAqC;AAQtE,SAAS,wBACd,SACA,cACM;AACN,8BAA4B,IAAI,SAAS,YAAY;AACvD;AAqBO,SAAS,kCACd,MACgC;AAChC,MAAI,OAAO,SAAS,YAAY,SAAS,MAAM;A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AACA,WAAO,8BAAqC,GAAG;AAAA,EAIjD;AACF;;;Ael5CA;AAAA,EACE;AAAA,EACA;AAAA,EACA,iBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,yBAAAC;AAAA,OACK;","names":["CLIENT_CAPABILITIES_META_KEY","CLIENT_CAPABILITIES_META_KEY","corsHeaders","inputRequired","inputResponse","isInputRequiredResult"]}
@@ -1,87 +0,0 @@
1
- /**
2
- * Inspector CDN shell — the FastAPI `/docs` analog.
3
- *
4
- * The server ships no inspector code: it serves a tiny self-contained HTML
5
- * page whose `<script type="module">` loads the `@mcp-use/inspector` CDN
6
- * bundle entry (`dist/cdn/inspector.js`) plus lazy chunks, pinned to a major
7
- * version so the UI updates independently of SDK releases. Runtime configuration crosses to
8
- * the bundle through a serialized `window` global; the connect URL is derived
9
- * in the browser from the page's own origin, so the server never guesses its
10
- * public hostname.
11
- */
12
- import type { InspectorOptions } from "./config.js";
13
- import { type FetchHandler } from "./fetch-app.js";
14
- /**
15
- * npm dist-tag of the `@mcp-use/inspector` CDN bundle the default URL follows.
16
- *
17
- * Every new Inspector beta published with this tag becomes the default
18
- * inspector for mcp-use servers without requiring an mcp-use release.
19
- */
20
- export declare const INSPECTOR_TAG = "beta";
21
- /**
22
- * Default URL the inspector shell loads the UI bundle from: the
23
- * `@mcp-use/inspector` CDN build (`dist/cdn/inspector.js`) built from this
24
- * branch and served by jsDelivr from npm's {@link INSPECTOR_TAG} tag.
25
- * Override per server with {@link InspectorOptions.assetsUrl}.
26
- */
27
- export declare const DEFAULT_INSPECTOR_ASSETS_URL = "https://cdn.jsdelivr.net/npm/@mcp-use/inspector@beta/dist/cdn/inspector.js";
28
- /**
29
- * Derive the stylesheet URL that accompanies an inspector bundle URL.
30
- *
31
- * The CDN build ships as dist/cdn/inspector.js + dist/cdn/inspector.css
32
- * plus sibling lazy chunks referenced by the entry script. The stylesheet URL
33
- * is the script URL with its `.js` suffix swapped for `.css`. Query
34
- * strings and fragments are preserved.
35
- */
36
- export declare function inspectorStylesUrl(assetsUrl: string): string;
37
- /** True for the default jsDelivr `@mcp-use/inspector@*` CDN bundle URL. */
38
- export declare function isDefaultJsdelivrInspectorUrl(url: string): boolean;
39
- /** Append a per-request cache-bust query param for the default jsDelivr CDN URL. */
40
- export declare function withInspectorCacheBust(assetsUrl: string): string;
41
- /** True for inspector UI shell routes (SPA), excluding `/inspector/api/*`. */
42
- export declare function matchesInspectorShellPath(pathname: string, basePath: string): boolean;
43
- /** Inputs for {@link renderInspectorShell}. */
44
- export interface InspectorShellOptions {
45
- /** Server display name, used in the page title. */
46
- serverName: string;
47
- /** Route path the MCP endpoint is mounted on (e.g. `/mcp`). */
48
- basePath: string;
49
- /**
50
- * Full replacement URL for the inspector bundle script. Defaults to
51
- * {@link DEFAULT_INSPECTOR_ASSETS_URL}.
52
- */
53
- assetsUrl?: string | undefined;
54
- /** Hosted managed-chat URL (`window.__MANUFACT_CHAT_URL__`). */
55
- manufactChatUrl?: string | undefined;
56
- }
57
- /**
58
- * Render the inspector shell page.
59
- *
60
- * A minimal shell document whose background matches the inspector UI
61
- * with a `#root` mount node, an inline script publishing
62
- * `window.__MCP_USE_INSPECTOR__ = { autoConnectUrl, basePath }` — where
63
- * `autoConnectUrl` is computed client-side as
64
- * `window.location.origin + basePath` — a stylesheet link for the bundle's
65
- * companion CSS (see {@link inspectorStylesUrl}), and a module script
66
- * loading the inspector bundle. All server-provided values are HTML-escaped
67
- * or JSON-serialized with `<` escaped, so config can't inject markup.
68
- */
69
- export declare function renderInspectorShell(options: InspectorShellOptions): string;
70
- /**
71
- * Fetch handler for `${basePath}/inspector` (GET and HEAD).
72
- *
73
- * No-op when `inspector.enabled` is `false`; `undefined` and `{}` mean enabled.
74
- *
75
- * @internal Wiring for `MCPServer`.
76
- */
77
- export declare function createInspectorHandler(inspector: InspectorOptions | undefined, options: {
78
- serverName: string;
79
- basePath: string;
80
- }): FetchHandler | undefined;
81
- /**
82
- * @deprecated Use {@link createInspectorHandler}.
83
- *
84
- * @internal
85
- */
86
- export declare function mountInspectorShell(): void;
87
- //# sourceMappingURL=inspector-shell.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inspector-shell.d.ts","sourceRoot":"","sources":["../src/inspector-shell.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAiB,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAElE;;;;;GAKG;AACH,eAAO,MAAM,aAAa,SAAS,CAAC;AAEpC;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,+EAA2F,CAAC;AAErI;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED,2EAA2E;AAC3E,wBAAgB,6BAA6B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAElE;AAED,oFAAoF;AACpF,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAIhE;AAED,8EAA8E;AAC9E,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACf,OAAO,CAOT;AAED,+CAA+C;AAC/C,MAAM,WAAW,qBAAqB;IACpC,mDAAmD;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,gEAAgE;IAChE,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC;AAuBD;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,qBAAqB,GAAG,MAAM,CAiE3E;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,gBAAgB,GAAG,SAAS,EACvC,OAAO,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAChD,YAAY,GAAG,SAAS,CA+B1B;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAI1C"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,31 +0,0 @@
1
- import {
2
- generateLandingPage
3
- } from "./chunk-FCGJJVL2.js";
4
- import {
5
- resolveServerOrigin
6
- } from "./chunk-FC2Z2VFO.js";
7
-
8
- // src/landing-handler.ts
9
- function createLandingPageResponse(request, basePath, config, tools, prompts, resources) {
10
- const origin = resolveServerOrigin(request);
11
- const url = new URL(basePath, `${origin}/`).href;
12
- const html = generateLandingPage({
13
- ...config,
14
- url,
15
- tools: Array.from(tools, (entry) => entry.definition),
16
- prompts: Array.from(prompts, (entry) => entry.definition),
17
- resources: Array.from(resources, (entry) => entry.definition)
18
- });
19
- return new Response(request.method === "HEAD" ? null : html, {
20
- status: 200,
21
- headers: {
22
- "cache-control": "no-store",
23
- "content-type": "text/html; charset=utf-8",
24
- "x-content-type-options": "nosniff"
25
- }
26
- });
27
- }
28
- export {
29
- createLandingPageResponse
30
- };
31
- //# sourceMappingURL=landing-handler-VQRYCQOV.js.map