@mcp-use/inspector 0.18.4 → 0.18.5-canary.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +116 -39
- package/dist/client/components/ui/SandboxedIframe.d.ts.map +1 -1
- package/dist/server/{chunk-LUMZ7A6H.js → chunk-ATXH3EXI.js} +9 -5
- package/dist/server/chunk-IDMHJUEM.js +42 -0
- package/dist/server/{chunk-3CIR2XAF.js → chunk-LWRYFYSL.js} +13 -4
- package/dist/server/{chunk-AINOWQTV.js → chunk-OJE2DNAQ.js} +30 -5
- package/dist/server/{chunk-3QHKG7YB.js → chunk-RRJYFKES.js} +80 -23
- package/dist/server/cli.js +4 -4
- package/dist/server/file-utils.d.ts +17 -0
- package/dist/server/file-utils.d.ts.map +1 -0
- package/dist/server/file-utils.js +11 -0
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +7 -7
- package/dist/server/middleware.d.ts +4 -0
- package/dist/server/middleware.d.ts.map +1 -1
- package/dist/server/middleware.js +5 -5
- package/dist/server/routes/mcp-apps.d.ts +1 -1
- package/dist/server/server.js +4 -4
- package/dist/server/shared-routes.d.ts.map +1 -1
- package/dist/server/shared-routes.js +2 -2
- package/dist/server/shared-static.d.ts +12 -1
- package/dist/server/shared-static.d.ts.map +1 -1
- package/dist/server/shared-static.js +2 -2
- package/dist/server/shared-utils.d.ts +55 -17
- package/dist/server/shared-utils.d.ts.map +1 -1
- package/dist/server/shared-utils.js +5 -9
- package/dist/web/assets/{1c-CHY5n2Ai.js → 1c-BBHcITBK.js} +1 -1
- package/dist/web/assets/{abnf-CnX85kh-.js → abnf-un68cfIv.js} +1 -1
- package/dist/web/assets/{accesslog-C37I1RRs.js → accesslog-CNSxLJhI.js} +1 -1
- package/dist/web/assets/{actionscript-Bdg7q_VI.js → actionscript-Bwd7bdBF.js} +1 -1
- package/dist/web/assets/{ada-EvMToLIv.js → ada-BJuMhWmj.js} +1 -1
- package/dist/web/assets/{angelscript-DuDYAHID.js → angelscript-B2Ht4BsP.js} +1 -1
- package/dist/web/assets/{apache-DIhMaMOQ.js → apache-DxFN7ux-.js} +1 -1
- package/dist/web/assets/{applescript-KXi0IpYh.js → applescript--od5uZFU.js} +1 -1
- package/dist/web/assets/{arcade-Cle8xh3E.js → arcade-BS6V-iN-.js} +1 -1
- package/dist/web/assets/{arduino-C95noiPX.js → arduino-6fJdBA7V.js} +1 -1
- package/dist/web/assets/{armasm-BmN3DfWx.js → armasm-Bpy2_GgD.js} +1 -1
- package/dist/web/assets/{asciidoc-DjO2pgjB.js → asciidoc-DyR7zVqT.js} +1 -1
- package/dist/web/assets/{aspectj-CBQFJKjr.js → aspectj-BFHs1ztw.js} +1 -1
- package/dist/web/assets/{autohotkey-Ce_Dihr8.js → autohotkey-DevW6aA0.js} +1 -1
- package/dist/web/assets/{autoit-B6eUCU-X.js → autoit-Dcg59qVk.js} +1 -1
- package/dist/web/assets/{avrasm-BrETty04.js → avrasm-hWw2vk-o.js} +1 -1
- package/dist/web/assets/{awk-DZ3AU0Ys.js → awk-DzSG7iNt.js} +1 -1
- package/dist/web/assets/{axapta-CULsIlPH.js → axapta-Cwe1pPXj.js} +1 -1
- package/dist/web/assets/{bash-CVNNRKym.js → bash-CNPFZ_lH.js} +1 -1
- package/dist/web/assets/{basic-M2errA2p.js → basic-yPQRGA0h.js} +1 -1
- package/dist/web/assets/{bnf-L6IKV_mJ.js → bnf-BGU1J5i4.js} +1 -1
- package/dist/web/assets/{brainfuck-reI_YHkX.js → brainfuck-n3Md3SWz.js} +1 -1
- package/dist/web/assets/{browser-B3I60sE-.js → browser-DGCdhaUC.js} +3 -3
- package/dist/web/assets/{c-D3fAvnxj.js → c-CnB8CqJC.js} +1 -1
- package/dist/web/assets/{c-like-CTCZdATc.js → c-like-vMc8eDO6.js} +1 -1
- package/dist/web/assets/{cal-C-fqAxiZ.js → cal-tI5pAYoY.js} +1 -1
- package/dist/web/assets/{capnproto-CHmRk0Rp.js → capnproto-Duc_AIsB.js} +1 -1
- package/dist/web/assets/{ceylon-CwcYWKxy.js → ceylon-DMo48Sct.js} +1 -1
- package/dist/web/assets/{clean-DGNr5JGH.js → clean-DGtxxoLC.js} +1 -1
- package/dist/web/assets/{client-Cvty3Q_z.js → client-2pc_H_VJ.js} +1 -1
- package/dist/web/assets/{clojure-CUKExYof.js → clojure-CL3ye4x7.js} +1 -1
- package/dist/web/assets/{clojure-repl-C73KPb8a.js → clojure-repl-CP8Pm3XN.js} +1 -1
- package/dist/web/assets/{cmake-xtQ-X-tp.js → cmake-kRNHleXY.js} +1 -1
- package/dist/web/assets/{coffeescript-BFqlSCWC.js → coffeescript-BW1werH3.js} +1 -1
- package/dist/web/assets/{coq-BbZzVQ6l.js → coq-CrM7LQO0.js} +1 -1
- package/dist/web/assets/{core-D1NGB59Z.js → core-Bq1qMz_0.js} +1 -1
- package/dist/web/assets/{cos-ChjUSX1n.js → cos-tzfNQpOV.js} +1 -1
- package/dist/web/assets/{cpp-CdvBIrz0.js → cpp-DREvzEog.js} +1 -1
- package/dist/web/assets/{crmsh-Cnil-C2S.js → crmsh-Cgh3epoc.js} +1 -1
- package/dist/web/assets/{crystal-OqIB5gps.js → crystal-CEErXVPC.js} +1 -1
- package/dist/web/assets/{csharp-DmaGYEgg.js → csharp-BKH4cBK_.js} +1 -1
- package/dist/web/assets/{csp-CrRWmxEH.js → csp-D-JLsMCm.js} +1 -1
- package/dist/web/assets/{css-SPy6Gpkn.js → css-Bg-w0Ocj.js} +1 -1
- package/dist/web/assets/{d-DM_S8gCg.js → d-Qd0RdQdB.js} +1 -1
- package/dist/web/assets/{dart-C88hVGHd.js → dart-Dll6p13M.js} +1 -1
- package/dist/web/assets/{delphi-BGtJogiC.js → delphi-V0_Gr3fB.js} +1 -1
- package/dist/web/assets/{diff-Cge9Z-0T.js → diff-DwjRUNIC.js} +1 -1
- package/dist/web/assets/{display-A5IEINAP-DR2dDBWT.js → display-A5IEINAP-DBOYvF_u.js} +2 -2
- package/dist/web/assets/{django-DoGFy2Q1.js → django-NClmPrs9.js} +1 -1
- package/dist/web/assets/{dns-CPJdIcS-.js → dns-CAB11Bve.js} +1 -1
- package/dist/web/assets/{dockerfile-B4oj7boL.js → dockerfile-CwlYdWKX.js} +1 -1
- package/dist/web/assets/{dos-MMVflXDm.js → dos-D4NaN27V.js} +1 -1
- package/dist/web/assets/{dsconfig-vGZ39bcY.js → dsconfig-IUIgcsa3.js} +1 -1
- package/dist/web/assets/{dts-B6n7pCNt.js → dts-8cF1modA.js} +1 -1
- package/dist/web/assets/{dust-CSjNM4v5.js → dust-BIonYBtO.js} +1 -1
- package/dist/web/assets/{ebnf-pzfFm7rQ.js → ebnf-BsK7V6AU.js} +1 -1
- package/dist/web/assets/{elixir-CTYiS-Ed.js → elixir-0py2B6p6.js} +1 -1
- package/dist/web/assets/{elm-B4_MzkG4.js → elm-BC3YRRfw.js} +1 -1
- package/dist/web/assets/{embeddings-BgwBgUC6.js → embeddings-BvQIhBan.js} +1 -1
- package/dist/web/assets/{erb-B83B1gja.js → erb-vvagTOrH.js} +1 -1
- package/dist/web/assets/{erlang-BhE1ZlMQ.js → erlang-DcYIWBJU.js} +1 -1
- package/dist/web/assets/{erlang-repl-CdnfDxlo.js → erlang-repl-3eoaMAHZ.js} +1 -1
- package/dist/web/assets/{excel-DX4dF1iH.js → excel-b4200nj6.js} +1 -1
- package/dist/web/assets/{fix-Cv3lz5vx.js → fix-g2k5vDlZ.js} +1 -1
- package/dist/web/assets/{flix-CdGkCLCl.js → flix-BaRjPG6O.js} +1 -1
- package/dist/web/assets/{fortran-FS4sOOjP.js → fortran-DUowUEQq.js} +1 -1
- package/dist/web/assets/{fsharp-D_LIOvQq.js → fsharp-BXH6Nh6X.js} +1 -1
- package/dist/web/assets/{gams-NcRKNkvS.js → gams-DcGHDL6M.js} +1 -1
- package/dist/web/assets/{gauss-Cy1OT2pz.js → gauss-BVVpr8A1.js} +1 -1
- package/dist/web/assets/{gcode-Wv1r_9Of.js → gcode-C-w3H3Ai.js} +1 -1
- package/dist/web/assets/{gherkin-C6xBem4R.js → gherkin-Czbv7wRW.js} +1 -1
- package/dist/web/assets/{glsl-L9N4onfU.js → glsl-DLCX-pkD.js} +1 -1
- package/dist/web/assets/{gml-F4C3iWE8.js → gml-BYTuNWsa.js} +1 -1
- package/dist/web/assets/{go-CIU6XOrZ.js → go-HDKRVCcL.js} +1 -1
- package/dist/web/assets/{golo-QGMUhPOw.js → golo-CBB8pdaA.js} +1 -1
- package/dist/web/assets/{gradle-DlfqY0A1.js → gradle-D3ipCR18.js} +1 -1
- package/dist/web/assets/{groovy-B8qkKMLA.js → groovy-CAFYfObP.js} +1 -1
- package/dist/web/assets/{haml-D_hpibnd.js → haml-R1JTD27v.js} +1 -1
- package/dist/web/assets/{handlebars-CkMGXARG.js → handlebars-XCJtUwRz.js} +1 -1
- package/dist/web/assets/{haskell-DmlTp82A.js → haskell-C4zSAbtl.js} +1 -1
- package/dist/web/assets/{haxe-JW7M5vbo.js → haxe-BmmYPu_E.js} +1 -1
- package/dist/web/assets/{hsp-CQ1b24Rp.js → hsp-CSnTv-u1.js} +1 -1
- package/dist/web/assets/{htmlbars-CVMdeFsX.js → htmlbars-CosFteXD.js} +1 -1
- package/dist/web/assets/{http-CfSj_CTo.js → http-BR9niaIk.js} +1 -1
- package/dist/web/assets/{hy-BBmRBicC.js → hy-BTtHbc1V.js} +1 -1
- package/dist/web/assets/{index-ncalzW8w.js → index-4kGLcqPi.js} +1 -1
- package/dist/web/assets/{index-Dn13ZBFe.js → index-BYzBSJcD.js} +1 -1
- package/dist/web/assets/{index-DQDg1VXd.js → index-BpY8ipNo.js} +1 -1
- package/dist/web/assets/{index-CgfwQGIl.js → index-C7Faet4f.js} +1 -1
- package/dist/web/assets/{index-DaIJZn0K.js → index-C8_1B3V8.js} +1 -1
- package/dist/web/assets/{index-Dp3L0LGb.js → index-CQpLswHP.js} +1 -1
- package/dist/web/assets/{index-Ch_2OfQZ.js → index-UaBZgCrT.js} +10 -10
- package/dist/web/assets/{index-Cyw8_-xg.js → index-vOm1vYzz.js} +1 -1
- package/dist/web/assets/{inform7-DFKAazVT.js → inform7-l_ppgyjQ.js} +1 -1
- package/dist/web/assets/{ini-CPVYm0ur.js → ini-Bk9PYoLS.js} +1 -1
- package/dist/web/assets/{irpf90-CFI9alp7.js → irpf90-DPZMfrpV.js} +1 -1
- package/dist/web/assets/{isbl-Ce7xeMj9.js → isbl-Bcl2IlC2.js} +1 -1
- package/dist/web/assets/{java-EhtBXbSx.js → java-BJ4UoQUZ.js} +1 -1
- package/dist/web/assets/{javascript-J6uLVaeC.js → javascript-CB3HEfFt.js} +1 -1
- package/dist/web/assets/{jboss-cli-BduxvnHm.js → jboss-cli-BeGQccNS.js} +1 -1
- package/dist/web/assets/{json-O2RNKFSZ.js → json-CHKyi0pR.js} +1 -1
- package/dist/web/assets/{julia-30d6RmQb.js → julia-DMfik9LU.js} +1 -1
- package/dist/web/assets/{julia-repl-Cj9TPqdK.js → julia-repl-DnU-gKVc.js} +1 -1
- package/dist/web/assets/{kotlin-eUYWb6QQ.js → kotlin-CBSRk7aX.js} +1 -1
- package/dist/web/assets/{lasso-iAn0noRE.js → lasso-BdsjOcUj.js} +1 -1
- package/dist/web/assets/{latex-CF0sAbq0.js → latex-D-_Ry5Ma.js} +1 -1
- package/dist/web/assets/{ldif-B9eJDjCy.js → ldif-DBuu9Aue.js} +1 -1
- package/dist/web/assets/{leaf-DWXfMffo.js → leaf-D8KL1A4w.js} +1 -1
- package/dist/web/assets/{less-D0yMqYv4.js → less-CCaCDqbl.js} +1 -1
- package/dist/web/assets/{lisp-DRxW_wSp.js → lisp-BN71EiND.js} +1 -1
- package/dist/web/assets/{livecodeserver-DnYFbgZ8.js → livecodeserver-BcP5GREz.js} +1 -1
- package/dist/web/assets/{livescript-DNZC7Kzy.js → livescript-BfhbU6xC.js} +1 -1
- package/dist/web/assets/{llms-CIL2JuTk.js → llms-B9mcMfot.js} +1 -1
- package/dist/web/assets/{llvm-C6YacbSa.js → llvm-D4h_4FwV.js} +1 -1
- package/dist/web/assets/{lsl-DbSw6XM0.js → lsl-Kbe5I0uK.js} +1 -1
- package/dist/web/assets/{lua-IhHJcIWN.js → lua-CvsOzR5K.js} +1 -1
- package/dist/web/assets/{makefile-BMEJ3BtM.js → makefile-CgIcIhzo.js} +1 -1
- package/dist/web/assets/{markdown-DH50-tYz.js → markdown-DDrCcudu.js} +1 -1
- package/dist/web/assets/{mathematica-QJYe-AMW.js → mathematica-D4I-H1Qk.js} +1 -1
- package/dist/web/assets/{matlab-DJp_2Sl1.js → matlab-CLWI8zMJ.js} +1 -1
- package/dist/web/assets/{maxima-8r3hycox.js → maxima-D00Q5b4h.js} +1 -1
- package/dist/web/assets/{mel-BzYi-r0W.js → mel-vuXgM6jG.js} +1 -1
- package/dist/web/assets/{mercury-J_mrQpKK.js → mercury-DUi9Uejj.js} +1 -1
- package/dist/web/assets/{mipsasm-Bvt_iGJh.js → mipsasm-CuWvncx7.js} +1 -1
- package/dist/web/assets/{mizar-BS452FJf.js → mizar-Bwp-TZ5W.js} +1 -1
- package/dist/web/assets/{mojolicious-ijw5tUiM.js → mojolicious-CrBZ7dYH.js} +1 -1
- package/dist/web/assets/{monkey-CB9Ijm40.js → monkey-wNCJhAzJ.js} +1 -1
- package/dist/web/assets/{moonscript-D-UA_PXY.js → moonscript-Bw5nVVf2.js} +1 -1
- package/dist/web/assets/{n1ql-ji3ab4gq.js → n1ql-DjlNivTl.js} +1 -1
- package/dist/web/assets/{nginx-Bgrq3f6_.js → nginx-BTwcnobX.js} +1 -1
- package/dist/web/assets/{nim-C_LTMoHd.js → nim-RkJzGHee.js} +1 -1
- package/dist/web/assets/{nix-B8C-gpLF.js → nix-Bi9IxLee.js} +1 -1
- package/dist/web/assets/{node-repl-BNT0hCTT.js → node-repl-CcCsbplm.js} +1 -1
- package/dist/web/assets/{nsis-BloiH0G_.js → nsis-B3e9QLDn.js} +1 -1
- package/dist/web/assets/{objectivec-BS_unzHd.js → objectivec-CdPLs9In.js} +1 -1
- package/dist/web/assets/{ocaml-BXT4tbwS.js → ocaml-CvuM87NU.js} +1 -1
- package/dist/web/assets/{openscad-Da3XUda6.js → openscad-CvKbXELb.js} +1 -1
- package/dist/web/assets/{oxygene-EH9TXswl.js → oxygene-D0Ea8pbG.js} +1 -1
- package/dist/web/assets/{parser3-Dtu0FBva.js → parser3-CqIUkAS0.js} +1 -1
- package/dist/web/assets/{perl-Db2ai956.js → perl-BaXd4SoC.js} +1 -1
- package/dist/web/assets/{pf-CbZFOu1H.js → pf-BRX-KE0R.js} +1 -1
- package/dist/web/assets/{pgsql-zHL_iUg-.js → pgsql-C1ino5Ye.js} +1 -1
- package/dist/web/assets/{php-BEWerIrd.js → php-D_mwnK2g.js} +1 -1
- package/dist/web/assets/{php-template-C-7pPNIs.js → php-template-Bb1-wgDZ.js} +1 -1
- package/dist/web/assets/{plaintext-DPC-Sj4y.js → plaintext-BTYIJ7wY.js} +1 -1
- package/dist/web/assets/{pony-95skwilW.js → pony-Ch3ZZgPK.js} +1 -1
- package/dist/web/assets/{powershell-CGqTp84f.js → powershell-DQbI7e4u.js} +1 -1
- package/dist/web/assets/{processing--5G8wFJW.js → processing-CEWsT6S1.js} +1 -1
- package/dist/web/assets/{profile-CakRxQNP.js → profile-l1V-eHBb.js} +1 -1
- package/dist/web/assets/{prolog-dD9_d7Zw.js → prolog-alnui_El.js} +1 -1
- package/dist/web/assets/{properties-CBfzfRUN.js → properties-Bnz72PM2.js} +1 -1
- package/dist/web/assets/{protobuf-iFDI4q54.js → protobuf-DPlfoxEV.js} +1 -1
- package/dist/web/assets/{puppet-DoeuEBfd.js → puppet-CwxbQKC4.js} +1 -1
- package/dist/web/assets/{purebasic-D9QNhRcO.js → purebasic-DPaDdgvN.js} +1 -1
- package/dist/web/assets/{python-BkwOsgeW.js → python-DVqIMHVx.js} +1 -1
- package/dist/web/assets/{python-repl-D9oOmzjk.js → python-repl-mpn38z6w.js} +1 -1
- package/dist/web/assets/{q-DscqoBJ2.js → q-D7h2NEnb.js} +1 -1
- package/dist/web/assets/{qml-UCmeEj-f.js → qml-DDnwCL1a.js} +1 -1
- package/dist/web/assets/{r-DUpJHasE.js → r-_ZCYLaxy.js} +1 -1
- package/dist/web/assets/{reasonml-BYLsPuvk.js → reasonml-4nCfqATf.js} +1 -1
- package/dist/web/assets/{rib-HOG6WM5X.js → rib-ZLrreaN8.js} +1 -1
- package/dist/web/assets/{roboconf-ByZsJacE.js → roboconf-4dlWHXSi.js} +1 -1
- package/dist/web/assets/{routeros-WylqsEoC.js → routeros-BMhNqHpK.js} +1 -1
- package/dist/web/assets/{rsl-P58E8Lp5.js → rsl-CFRUtOVb.js} +1 -1
- package/dist/web/assets/{ruby-CFB6MZuK.js → ruby-CgHmWtML.js} +1 -1
- package/dist/web/assets/{ruleslanguage-bdOd4sZA.js → ruleslanguage-RfZteEVu.js} +1 -1
- package/dist/web/assets/{rust-DiggWTm4.js → rust-CZBvQV75.js} +1 -1
- package/dist/web/assets/{sas-Dst8zNmw.js → sas-EPzjjUjj.js} +1 -1
- package/dist/web/assets/{scala-DAm1JbEu.js → scala-DP7aclaI.js} +1 -1
- package/dist/web/assets/{scheme-eCE025bd.js → scheme-D4yJKFU9.js} +1 -1
- package/dist/web/assets/{scilab-33nigZf1.js → scilab-D5lnFYRV.js} +1 -1
- package/dist/web/assets/{scss-B8U_VQPG.js → scss-DqPnTdH6.js} +1 -1
- package/dist/web/assets/{shell-DJv4X5ec.js → shell-Biz0KTDP.js} +1 -1
- package/dist/web/assets/{smali-gn1aWxt4.js → smali-CkCZ14UW.js} +1 -1
- package/dist/web/assets/{smalltalk-rvgf_yAl.js → smalltalk-qOacs0Fs.js} +1 -1
- package/dist/web/assets/{sml-CPlK4Oat.js → sml-DRNh0Nn6.js} +1 -1
- package/dist/web/assets/{sqf-jP1unKv8.js → sqf-DkdYkWhM.js} +1 -1
- package/dist/web/assets/{sql-CYzwVeLy.js → sql-Dqn8Akby.js} +1 -1
- package/dist/web/assets/{sql_more-C-u0k8jn.js → sql_more-C_78paHS.js} +1 -1
- package/dist/web/assets/{stan-CnWwtkMI.js → stan-CvgaNjPf.js} +1 -1
- package/dist/web/assets/{stata-DPssmHQn.js → stata-ChRaz2Kg.js} +1 -1
- package/dist/web/assets/{step21-COX6dx5F.js → step21-BQRk1tud.js} +1 -1
- package/dist/web/assets/{stylus-BuBUBi3U.js → stylus-_X5Tedhm.js} +1 -1
- package/dist/web/assets/{subunit-DCnXrOHi.js → subunit-DAzBBAyh.js} +1 -1
- package/dist/web/assets/{swift-BfKSJw9P.js → swift-NNePtHAq.js} +1 -1
- package/dist/web/assets/{taggerscript-BPFY6dR8.js → taggerscript-DIbNvCcD.js} +1 -1
- package/dist/web/assets/{tap-DPUEBeHN.js → tap-ybywaDyk.js} +1 -1
- package/dist/web/assets/{tcl-Bjxk4iWb.js → tcl-0BypuF3B.js} +1 -1
- package/dist/web/assets/{thrift-Dird-0Vc.js → thrift-Qz9SvBHE.js} +1 -1
- package/dist/web/assets/{tp-DnRMfY_3.js → tp-dOvRDex6.js} +1 -1
- package/dist/web/assets/{twig-B62gaZEk.js → twig-Bf3A114Z.js} +1 -1
- package/dist/web/assets/{typescript-C9Qf7_Hf.js → typescript-DALopehJ.js} +1 -1
- package/dist/web/assets/{vala-C8YpX4nM.js → vala-DMf3rsGd.js} +1 -1
- package/dist/web/assets/{vbnet-DXf_iDJx.js → vbnet-C4kBerP_.js} +1 -1
- package/dist/web/assets/{vbscript-DdsDQFLr.js → vbscript-Dqbq44vx.js} +1 -1
- package/dist/web/assets/{vbscript-html-Bsm5KiTZ.js → vbscript-html-c4rpEAdw.js} +1 -1
- package/dist/web/assets/{verilog-BuPNez1R.js → verilog-OVPODDY9.js} +1 -1
- package/dist/web/assets/{vhdl-C6eueW7P.js → vhdl-0WAaypuz.js} +1 -1
- package/dist/web/assets/{vim-eYJGDtlf.js → vim-BuZzidpv.js} +1 -1
- package/dist/web/assets/{x86asm-C4oiWIZo.js → x86asm-NlxWk416.js} +1 -1
- package/dist/web/assets/{xl-CnonMolE.js → xl-x86M8H-q.js} +1 -1
- package/dist/web/assets/{xml-Bf5GQVdD.js → xml-BheYedwF.js} +1 -1
- package/dist/web/assets/{xquery-RoL6-XIk.js → xquery-Cd2x7_1l.js} +1 -1
- package/dist/web/assets/{yaml-BNueGptO.js → yaml-BOiNkJSb.js} +1 -1
- package/dist/web/assets/{zephir-C0vISb0X.js → zephir-D3t7Uu-s.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +2 -2
- package/dist/server/chunk-R4HZ2WDD.js +0 -721
- package/dist/server/shared-utils-browser.d.ts +0 -173
- package/dist/server/shared-utils-browser.d.ts.map +0 -1
- package/dist/server/shared-utils-browser.js +0 -21
package/dist/cli.js
CHANGED
|
@@ -13,7 +13,7 @@ import open from "open";
|
|
|
13
13
|
// src/server/shared-routes.ts
|
|
14
14
|
import { mountMcpProxy, mountOAuthProxy } from "mcp-use/server";
|
|
15
15
|
|
|
16
|
-
// src/server/shared-utils
|
|
16
|
+
// src/server/shared-utils.ts
|
|
17
17
|
function toBase64(str) {
|
|
18
18
|
if (typeof window !== "undefined" && typeof window.btoa === "function") {
|
|
19
19
|
return window.btoa(str);
|
|
@@ -461,6 +461,9 @@ function generateWidgetContentHtml(widgetData) {
|
|
|
461
461
|
}
|
|
462
462
|
|
|
463
463
|
// Inject MCP widget utilities for Image component and file access
|
|
464
|
+
// __mcpServerUrl provides the server origin for widgets to use in API calls
|
|
465
|
+
// (e.g., fetch(window.__mcpServerUrl + '/api/fruits') instead of hardcoding localhost)
|
|
466
|
+
window.__mcpServerUrl = ${devServerBaseUrl ? `"${devServerBaseUrl}"` : '""'};
|
|
464
467
|
window.__mcpPublicUrl = ${devServerBaseUrl ? `"${devServerBaseUrl}/mcp-use/public"` : '""'};
|
|
465
468
|
window.__getFile = function(filename) {
|
|
466
469
|
return ${devServerBaseUrl ? `"${devServerBaseUrl}/mcp-use/widgets/"` : '""'} + filename;
|
|
@@ -741,7 +744,7 @@ function generateWidgetContentHtml(widgetData) {
|
|
|
741
744
|
console.log("[Widget Content] Generated HTML length:", modifiedHtml.length);
|
|
742
745
|
return { html: modifiedHtml };
|
|
743
746
|
}
|
|
744
|
-
function getWidgetSecurityHeaders(widgetCSP, devServerBaseUrl) {
|
|
747
|
+
function getWidgetSecurityHeaders(widgetCSP, devServerBaseUrl, frameAncestors) {
|
|
745
748
|
const trustedCdns = [
|
|
746
749
|
"https://persistent.oaistatic.com",
|
|
747
750
|
"https://*.oaistatic.com",
|
|
@@ -788,6 +791,12 @@ function getWidgetSecurityHeaders(widgetCSP, devServerBaseUrl) {
|
|
|
788
791
|
if (frameDomains && frameDomains.length > 0) {
|
|
789
792
|
frameSrc = `'self' blob: ${frameDomains.join(" ")}`;
|
|
790
793
|
}
|
|
794
|
+
let frameAncestorsPolicy = "'self'";
|
|
795
|
+
if (devServerOrigin && !frameAncestors) {
|
|
796
|
+
frameAncestorsPolicy = "*";
|
|
797
|
+
} else if (frameAncestors) {
|
|
798
|
+
frameAncestorsPolicy = frameAncestors;
|
|
799
|
+
}
|
|
791
800
|
const headers = {
|
|
792
801
|
"Content-Security-Policy": [
|
|
793
802
|
"default-src 'self'",
|
|
@@ -800,7 +809,7 @@ function getWidgetSecurityHeaders(widgetCSP, devServerBaseUrl) {
|
|
|
800
809
|
`media-src ${mediaSrc}`,
|
|
801
810
|
`font-src ${fontSrc}`,
|
|
802
811
|
`connect-src ${connectSrc}`,
|
|
803
|
-
|
|
812
|
+
`frame-ancestors ${frameAncestorsPolicy}`
|
|
804
813
|
].join("; "),
|
|
805
814
|
"X-Frame-Options": "SAMEORIGIN",
|
|
806
815
|
"X-Content-Type-Options": "nosniff",
|
|
@@ -826,7 +835,7 @@ function getWidgetSecurityHeaders(widgetCSP, devServerBaseUrl) {
|
|
|
826
835
|
"media-src 'self' data: https: blob:",
|
|
827
836
|
`font-src 'self' data: ${prodResourceDomainsStr}`,
|
|
828
837
|
`connect-src ${prodConnectSrc}`,
|
|
829
|
-
|
|
838
|
+
`frame-ancestors ${frameAncestorsPolicy}`
|
|
830
839
|
].join("; ");
|
|
831
840
|
}
|
|
832
841
|
return headers;
|
|
@@ -1301,6 +1310,36 @@ function formatErrorResponse(error, context) {
|
|
|
1301
1310
|
}
|
|
1302
1311
|
|
|
1303
1312
|
// src/server/shared-routes.ts
|
|
1313
|
+
function getFrameAncestorsFromEnv() {
|
|
1314
|
+
const envValue = process.env.MCP_INSPECTOR_FRAME_ANCESTORS;
|
|
1315
|
+
if (!envValue) return void 0;
|
|
1316
|
+
const trimmed = envValue.trim();
|
|
1317
|
+
if (trimmed === "*") return "*";
|
|
1318
|
+
return trimmed;
|
|
1319
|
+
}
|
|
1320
|
+
function toLocalhostUrl(externalUrl, requestUrl) {
|
|
1321
|
+
try {
|
|
1322
|
+
const url = new URL(externalUrl);
|
|
1323
|
+
if (url.hostname === "localhost" || url.hostname === "127.0.0.1") {
|
|
1324
|
+
return externalUrl;
|
|
1325
|
+
}
|
|
1326
|
+
let localPort = "3000";
|
|
1327
|
+
try {
|
|
1328
|
+
const reqUrl = new URL(requestUrl);
|
|
1329
|
+
if (reqUrl.hostname === "localhost" || reqUrl.hostname === "127.0.0.1") {
|
|
1330
|
+
localPort = reqUrl.port || "3000";
|
|
1331
|
+
}
|
|
1332
|
+
} catch {
|
|
1333
|
+
}
|
|
1334
|
+
const portMatch = url.hostname.match(/^(\d+)-/);
|
|
1335
|
+
if (portMatch) {
|
|
1336
|
+
localPort = portMatch[1];
|
|
1337
|
+
}
|
|
1338
|
+
return `http://localhost:${localPort}${url.pathname}${url.search}`;
|
|
1339
|
+
} catch {
|
|
1340
|
+
return externalUrl;
|
|
1341
|
+
}
|
|
1342
|
+
}
|
|
1304
1343
|
async function fetchWithRetry2(url, options, maxRetries = 3, initialDelay = 500) {
|
|
1305
1344
|
let lastError;
|
|
1306
1345
|
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
@@ -1439,7 +1478,12 @@ function registerInspectorRoutes(app2, config) {
|
|
|
1439
1478
|
if (result.error) {
|
|
1440
1479
|
return c.html(`<html><body>Error: ${result.error}</body></html>`, 404);
|
|
1441
1480
|
}
|
|
1442
|
-
const headers = getWidgetSecurityHeaders(
|
|
1481
|
+
const headers = getWidgetSecurityHeaders(
|
|
1482
|
+
widgetData.widgetCSP,
|
|
1483
|
+
void 0,
|
|
1484
|
+
// No dev server for production widgets
|
|
1485
|
+
getFrameAncestorsFromEnv()
|
|
1486
|
+
);
|
|
1443
1487
|
Object.entries(headers).forEach(([key, value]) => {
|
|
1444
1488
|
c.header(key, value);
|
|
1445
1489
|
});
|
|
@@ -1462,7 +1506,14 @@ function registerInspectorRoutes(app2, config) {
|
|
|
1462
1506
|
404
|
|
1463
1507
|
);
|
|
1464
1508
|
}
|
|
1465
|
-
const
|
|
1509
|
+
const localDevWidgetUrl = toLocalhostUrl(
|
|
1510
|
+
widgetData.devWidgetUrl,
|
|
1511
|
+
c.req.url
|
|
1512
|
+
);
|
|
1513
|
+
console.log(
|
|
1514
|
+
`[Dev Widget Proxy] Fetching from: ${localDevWidgetUrl} (original: ${widgetData.devWidgetUrl})`
|
|
1515
|
+
);
|
|
1516
|
+
const response = await fetchWithRetry2(localDevWidgetUrl);
|
|
1466
1517
|
if (!response.ok) {
|
|
1467
1518
|
const status = response.status;
|
|
1468
1519
|
return c.html(
|
|
@@ -1483,7 +1534,6 @@ function registerInspectorRoutes(app2, config) {
|
|
|
1483
1534
|
return c.html(`<html><body>Error: ${result.error}</body></html>`, 500);
|
|
1484
1535
|
}
|
|
1485
1536
|
html = result.html;
|
|
1486
|
-
const proxyBase = `/inspector/api/dev-widget/${toolId}/assets`;
|
|
1487
1537
|
const widgetNameMatch = widgetData.devWidgetUrl?.match(
|
|
1488
1538
|
/\/mcp-use\/widgets\/([^/?]+)/
|
|
1489
1539
|
);
|
|
@@ -1494,23 +1544,22 @@ function registerInspectorRoutes(app2, config) {
|
|
|
1494
1544
|
);
|
|
1495
1545
|
html = html.replace(
|
|
1496
1546
|
new RegExp(
|
|
1497
|
-
`(src|href)="(${escapedBaseUrl}/mcp-use/widgets/[^"]+)"`,
|
|
1547
|
+
`(src|href)="(${escapedBaseUrl})(/mcp-use/widgets/[^"]+)"`,
|
|
1498
1548
|
"g"
|
|
1499
1549
|
),
|
|
1500
|
-
(_match, attr,
|
|
1501
|
-
|
|
1502
|
-
return `${attr}="${proxyBase}${path}"`;
|
|
1550
|
+
(_match, attr, _origin, path) => {
|
|
1551
|
+
return `${attr}="${path}"`;
|
|
1503
1552
|
}
|
|
1504
1553
|
);
|
|
1505
1554
|
html = html.replace(
|
|
1506
|
-
/(src|href)
|
|
1507
|
-
(_match, attr, path) => {
|
|
1508
|
-
return `${attr}
|
|
1555
|
+
/((?:src|href)\s*=\s*|from\s+)(['"])(https?:\/\/(?:localhost|0\.0\.0\.0|127\.0\.0\.1):\d+)(\/mcp-use\/widgets\/[^'"]+)(['"])/g,
|
|
1556
|
+
(_match, attr, q1, _origin, path, q2) => {
|
|
1557
|
+
return `${attr}${q1}${path}${q2}`;
|
|
1509
1558
|
}
|
|
1510
1559
|
);
|
|
1511
1560
|
html = html.replace(/(src|href)="\.\/([^"]+)"/g, (match, attr, path) => {
|
|
1512
1561
|
if (path.match(/\.(js|css|png|jpg|jpeg|gif|svg|woff|woff2|ttf|eot)$/i)) {
|
|
1513
|
-
return `${attr}="
|
|
1562
|
+
return `${attr}="/mcp-use/widgets/${widgetName}/${path}"`;
|
|
1514
1563
|
}
|
|
1515
1564
|
return match;
|
|
1516
1565
|
});
|
|
@@ -1519,7 +1568,7 @@ function registerInspectorRoutes(app2, config) {
|
|
|
1519
1568
|
const wsProtocol = devServerUrl.protocol === "https:" ? "wss" : "ws";
|
|
1520
1569
|
const wsHost = devServerUrl.host;
|
|
1521
1570
|
const directWsUrl = `${wsProtocol}://${wsHost}/mcp-use/widgets/`;
|
|
1522
|
-
const baseTag = `<base href="
|
|
1571
|
+
const baseTag = `<base href="/mcp-use/widgets/${widgetName}/">`;
|
|
1523
1572
|
const cspWarningScript = `
|
|
1524
1573
|
<script>
|
|
1525
1574
|
// Listen for CSP violations (from Report-Only policy)
|
|
@@ -1551,11 +1600,16 @@ function registerInspectorRoutes(app2, config) {
|
|
|
1551
1600
|
}
|
|
1552
1601
|
const headers = getWidgetSecurityHeaders(
|
|
1553
1602
|
widgetData.widgetCSP,
|
|
1554
|
-
widgetData.devServerBaseUrl
|
|
1603
|
+
widgetData.devServerBaseUrl,
|
|
1604
|
+
getFrameAncestorsFromEnv()
|
|
1555
1605
|
);
|
|
1556
1606
|
Object.entries(headers).forEach(([key, value]) => {
|
|
1557
1607
|
c.header(key, value);
|
|
1558
1608
|
});
|
|
1609
|
+
const scriptUrls = [...html.matchAll(/src\s*=\s*["']([^"']+)["']/g)].map(
|
|
1610
|
+
(m) => m[1]
|
|
1611
|
+
);
|
|
1612
|
+
console.log(`[Dev Widget Proxy] Final HTML script URLs:`, scriptUrls);
|
|
1559
1613
|
return c.html(html);
|
|
1560
1614
|
} catch (error) {
|
|
1561
1615
|
console.error("[Dev Widget Proxy] Error:", error);
|
|
@@ -1566,24 +1620,36 @@ function registerInspectorRoutes(app2, config) {
|
|
|
1566
1620
|
app2.get("/inspector/api/dev-widget/:toolId/assets/*", async (c) => {
|
|
1567
1621
|
try {
|
|
1568
1622
|
const toolId = c.req.param("toolId");
|
|
1569
|
-
const
|
|
1623
|
+
const reqUrl = new URL(c.req.url);
|
|
1624
|
+
const assetPath = reqUrl.pathname.replace(
|
|
1570
1625
|
`/inspector/api/dev-widget/${toolId}/assets`,
|
|
1571
1626
|
""
|
|
1572
|
-
);
|
|
1627
|
+
) + reqUrl.search;
|
|
1573
1628
|
const widgetData = getWidgetData(toolId);
|
|
1574
1629
|
if (!widgetData?.devServerBaseUrl) {
|
|
1575
1630
|
return c.notFound();
|
|
1576
1631
|
}
|
|
1577
|
-
const
|
|
1632
|
+
const localBaseUrl = toLocalhostUrl(
|
|
1633
|
+
widgetData.devServerBaseUrl,
|
|
1634
|
+
c.req.url
|
|
1635
|
+
);
|
|
1636
|
+
const devAssetUrl = `${localBaseUrl}${assetPath}`;
|
|
1637
|
+
console.log(`[Dev Widget Asset Proxy] ${assetPath} \u2192 ${devAssetUrl}`);
|
|
1578
1638
|
const response = await fetch(devAssetUrl, {
|
|
1579
1639
|
headers: {
|
|
1580
1640
|
Accept: c.req.header("Accept") || "*/*"
|
|
1581
1641
|
}
|
|
1582
1642
|
});
|
|
1583
1643
|
if (!response.ok) {
|
|
1644
|
+
console.warn(
|
|
1645
|
+
`[Dev Widget Asset Proxy] ${devAssetUrl} \u2192 ${response.status}`
|
|
1646
|
+
);
|
|
1584
1647
|
return c.notFound();
|
|
1585
1648
|
}
|
|
1586
1649
|
const contentType = response.headers.get("Content-Type") || "application/octet-stream";
|
|
1650
|
+
console.log(
|
|
1651
|
+
`[Dev Widget Asset Proxy] ${assetPath} \u2192 ${response.status} ${contentType}`
|
|
1652
|
+
);
|
|
1587
1653
|
const headers = {
|
|
1588
1654
|
"Content-Type": contentType
|
|
1589
1655
|
};
|
|
@@ -1759,8 +1825,7 @@ function registerInspectorRoutes(app2, config) {
|
|
|
1759
1825
|
import { existsSync as existsSync2, readFileSync } from "fs";
|
|
1760
1826
|
import { join as join2 } from "path";
|
|
1761
1827
|
|
|
1762
|
-
// src/server/
|
|
1763
|
-
import { Buffer as Buffer2 } from "buffer";
|
|
1828
|
+
// src/server/file-utils.ts
|
|
1764
1829
|
import { existsSync } from "fs";
|
|
1765
1830
|
import { dirname, join } from "path";
|
|
1766
1831
|
import { fileURLToPath } from "url";
|
|
@@ -1796,22 +1861,25 @@ function getClientDistPath() {
|
|
|
1796
1861
|
}
|
|
1797
1862
|
return join(__dirname, "../web");
|
|
1798
1863
|
}
|
|
1799
|
-
var widgetDataStore2 = /* @__PURE__ */ new Map();
|
|
1800
|
-
setInterval(
|
|
1801
|
-
() => {
|
|
1802
|
-
const now = Date.now();
|
|
1803
|
-
const ONE_HOUR = 60 * 60 * 1e3;
|
|
1804
|
-
for (const [toolId, data] of widgetDataStore2.entries()) {
|
|
1805
|
-
if (now - data.timestamp > ONE_HOUR) {
|
|
1806
|
-
widgetDataStore2.delete(toolId);
|
|
1807
|
-
}
|
|
1808
|
-
}
|
|
1809
|
-
},
|
|
1810
|
-
5 * 60 * 1e3
|
|
1811
|
-
).unref();
|
|
1812
1864
|
|
|
1813
1865
|
// src/server/shared-static.ts
|
|
1814
|
-
function
|
|
1866
|
+
function injectRuntimeConfig(html, config) {
|
|
1867
|
+
if (!config) return html;
|
|
1868
|
+
const scripts = [];
|
|
1869
|
+
if (config.devMode) {
|
|
1870
|
+
scripts.push(`<script>window.__MCP_DEV_MODE__ = true;</script>`);
|
|
1871
|
+
}
|
|
1872
|
+
if (config.sandboxOrigin) {
|
|
1873
|
+
scripts.push(
|
|
1874
|
+
`<script>window.__MCP_SANDBOX_ORIGIN__ = ${JSON.stringify(config.sandboxOrigin)};</script>`
|
|
1875
|
+
);
|
|
1876
|
+
}
|
|
1877
|
+
if (scripts.length === 0) return html;
|
|
1878
|
+
const injection = scripts.join("\n ");
|
|
1879
|
+
return html.replace("</head>", ` ${injection}
|
|
1880
|
+
</head>`);
|
|
1881
|
+
}
|
|
1882
|
+
function registerStaticRoutes(app2, clientDistPath, runtimeConfig) {
|
|
1815
1883
|
const distPath = clientDistPath || getClientDistPath();
|
|
1816
1884
|
if (!checkClientFiles(distPath)) {
|
|
1817
1885
|
console.warn(`\u26A0\uFE0F MCP Inspector client files not found at ${distPath}`);
|
|
@@ -1853,7 +1921,10 @@ function registerStaticRoutes(app2, clientDistPath) {
|
|
|
1853
1921
|
app2.get("/inspector", (c) => {
|
|
1854
1922
|
const indexPath = join2(distPath, "index.html");
|
|
1855
1923
|
if (existsSync2(indexPath)) {
|
|
1856
|
-
const content =
|
|
1924
|
+
const content = injectRuntimeConfig(
|
|
1925
|
+
readFileSync(indexPath, "utf-8"),
|
|
1926
|
+
runtimeConfig
|
|
1927
|
+
);
|
|
1857
1928
|
return c.html(content);
|
|
1858
1929
|
}
|
|
1859
1930
|
return c.html(`
|
|
@@ -1872,7 +1943,10 @@ function registerStaticRoutes(app2, clientDistPath) {
|
|
|
1872
1943
|
const handleInspectorRoute = (c) => {
|
|
1873
1944
|
const indexPath = join2(distPath, "index.html");
|
|
1874
1945
|
if (existsSync2(indexPath)) {
|
|
1875
|
-
const content =
|
|
1946
|
+
const content = injectRuntimeConfig(
|
|
1947
|
+
readFileSync(indexPath, "utf-8"),
|
|
1948
|
+
runtimeConfig
|
|
1949
|
+
);
|
|
1876
1950
|
return c.html(content);
|
|
1877
1951
|
}
|
|
1878
1952
|
return c.notFound();
|
|
@@ -1882,7 +1956,10 @@ function registerStaticRoutes(app2, clientDistPath) {
|
|
|
1882
1956
|
app2.get("*", (c) => {
|
|
1883
1957
|
const indexPath = join2(distPath, "index.html");
|
|
1884
1958
|
if (existsSync2(indexPath)) {
|
|
1885
|
-
const content =
|
|
1959
|
+
const content = injectRuntimeConfig(
|
|
1960
|
+
readFileSync(indexPath, "utf-8"),
|
|
1961
|
+
runtimeConfig
|
|
1962
|
+
);
|
|
1886
1963
|
return c.html(content);
|
|
1887
1964
|
}
|
|
1888
1965
|
return c.html(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SandboxedIframe.d.ts","sourceRoot":"","sources":["../../../../src/client/components/ui/SandboxedIframe.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAaH,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,gBAAgB,EAAE,MAAM,iBAAiB,GAAG,IAAI,CAAC;CAClD;AAED,UAAU,oBAAoB;IAC5B,4CAA4C;IAC5C,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yDAAyD;IACzD,GAAG,CAAC,EAAE;QACJ,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;QAC1B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;QAC3B,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;QACxB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;KAC3B,CAAC;IACF,yEAAyE;IACzE,WAAW,CAAC,EAAE;QACZ,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,gEAAgE;IAChE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,2CAA2C;IAC3C,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,gFAAgF;IAChF,SAAS,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IACzC,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yCAAyC;IACzC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,8BAA8B;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"SandboxedIframe.d.ts","sourceRoot":"","sources":["../../../../src/client/components/ui/SandboxedIframe.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAaH,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,gBAAgB,EAAE,MAAM,iBAAiB,GAAG,IAAI,CAAC;CAClD;AAED,UAAU,oBAAoB;IAC5B,4CAA4C;IAC5C,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yDAAyD;IACzD,GAAG,CAAC,EAAE;QACJ,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;QAC1B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;QAC3B,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;QACxB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;KAC3B,CAAC;IACF,yEAAyE;IACzE,WAAW,CAAC,EAAE;QACZ,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,gEAAgE;IAChE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,2CAA2C;IAC3C,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,gFAAgF;IAChF,SAAS,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IACzC,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yCAAyC;IACzC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,8BAA8B;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,wHAsJ1B,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
registerInspectorRoutes
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RRJYFKES.js";
|
|
4
4
|
import {
|
|
5
5
|
registerStaticRoutes
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-OJE2DNAQ.js";
|
|
7
7
|
import {
|
|
8
8
|
checkClientFiles,
|
|
9
9
|
getClientDistPath
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-IDMHJUEM.js";
|
|
11
11
|
|
|
12
12
|
// src/server/middleware.ts
|
|
13
13
|
import { Hono } from "hono";
|
|
@@ -21,14 +21,18 @@ function mountInspector(app, config) {
|
|
|
21
21
|
` Run 'yarn build' in the inspector package to build the UI`
|
|
22
22
|
);
|
|
23
23
|
}
|
|
24
|
+
const runtimeConfig = {
|
|
25
|
+
devMode: config?.devMode,
|
|
26
|
+
sandboxOrigin: config?.sandboxOrigin
|
|
27
|
+
};
|
|
24
28
|
if (app instanceof Hono) {
|
|
25
29
|
registerInspectorRoutes(app, config);
|
|
26
|
-
registerStaticRoutes(app, clientDistPath);
|
|
30
|
+
registerStaticRoutes(app, clientDistPath, runtimeConfig);
|
|
27
31
|
return;
|
|
28
32
|
}
|
|
29
33
|
const honoApp = new Hono();
|
|
30
34
|
registerInspectorRoutes(honoApp, config);
|
|
31
|
-
registerStaticRoutes(honoApp, clientDistPath);
|
|
35
|
+
registerStaticRoutes(honoApp, clientDistPath, runtimeConfig);
|
|
32
36
|
app.use((req, res, next) => {
|
|
33
37
|
const url = new URL(req.url || "", `http://${req.headers.host}`);
|
|
34
38
|
const request = new Request(url, {
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// src/server/file-utils.ts
|
|
2
|
+
import { existsSync } from "fs";
|
|
3
|
+
import { dirname, join } from "path";
|
|
4
|
+
import { fileURLToPath } from "url";
|
|
5
|
+
function getContentType(filePath) {
|
|
6
|
+
if (filePath.endsWith(".js")) {
|
|
7
|
+
return "application/javascript";
|
|
8
|
+
} else if (filePath.endsWith(".css")) {
|
|
9
|
+
return "text/css";
|
|
10
|
+
} else if (filePath.endsWith(".svg")) {
|
|
11
|
+
return "image/svg+xml";
|
|
12
|
+
} else if (filePath.endsWith(".html")) {
|
|
13
|
+
return "text/html";
|
|
14
|
+
} else if (filePath.endsWith(".json")) {
|
|
15
|
+
return "application/json";
|
|
16
|
+
} else if (filePath.endsWith(".png")) {
|
|
17
|
+
return "image/png";
|
|
18
|
+
} else if (filePath.endsWith(".jpg") || filePath.endsWith(".jpeg")) {
|
|
19
|
+
return "image/jpeg";
|
|
20
|
+
} else if (filePath.endsWith(".ico")) {
|
|
21
|
+
return "image/x-icon";
|
|
22
|
+
} else {
|
|
23
|
+
return "application/octet-stream";
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function checkClientFiles(clientDistPath) {
|
|
27
|
+
return existsSync(clientDistPath);
|
|
28
|
+
}
|
|
29
|
+
function getClientDistPath() {
|
|
30
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
31
|
+
const __dirname = dirname(__filename);
|
|
32
|
+
if (__dirname.endsWith("dist") || __dirname.endsWith("dist/")) {
|
|
33
|
+
return join(__dirname, "web");
|
|
34
|
+
}
|
|
35
|
+
return join(__dirname, "../web");
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export {
|
|
39
|
+
getContentType,
|
|
40
|
+
checkClientFiles,
|
|
41
|
+
getClientDistPath
|
|
42
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// src/server/shared-utils
|
|
1
|
+
// src/server/shared-utils.ts
|
|
2
2
|
function toBase64(str) {
|
|
3
3
|
if (typeof window !== "undefined" && typeof window.btoa === "function") {
|
|
4
4
|
return window.btoa(str);
|
|
@@ -446,6 +446,9 @@ function generateWidgetContentHtml(widgetData) {
|
|
|
446
446
|
}
|
|
447
447
|
|
|
448
448
|
// Inject MCP widget utilities for Image component and file access
|
|
449
|
+
// __mcpServerUrl provides the server origin for widgets to use in API calls
|
|
450
|
+
// (e.g., fetch(window.__mcpServerUrl + '/api/fruits') instead of hardcoding localhost)
|
|
451
|
+
window.__mcpServerUrl = ${devServerBaseUrl ? `"${devServerBaseUrl}"` : '""'};
|
|
449
452
|
window.__mcpPublicUrl = ${devServerBaseUrl ? `"${devServerBaseUrl}/mcp-use/public"` : '""'};
|
|
450
453
|
window.__getFile = function(filename) {
|
|
451
454
|
return ${devServerBaseUrl ? `"${devServerBaseUrl}/mcp-use/widgets/"` : '""'} + filename;
|
|
@@ -740,7 +743,7 @@ function transformMcpAppsCspToSnakeCase(mcpAppsCsp) {
|
|
|
740
743
|
}
|
|
741
744
|
return Object.keys(result).length > 0 ? result : void 0;
|
|
742
745
|
}
|
|
743
|
-
function getWidgetSecurityHeaders(widgetCSP, devServerBaseUrl) {
|
|
746
|
+
function getWidgetSecurityHeaders(widgetCSP, devServerBaseUrl, frameAncestors) {
|
|
744
747
|
const trustedCdns = [
|
|
745
748
|
"https://persistent.oaistatic.com",
|
|
746
749
|
"https://*.oaistatic.com",
|
|
@@ -787,6 +790,12 @@ function getWidgetSecurityHeaders(widgetCSP, devServerBaseUrl) {
|
|
|
787
790
|
if (frameDomains && frameDomains.length > 0) {
|
|
788
791
|
frameSrc = `'self' blob: ${frameDomains.join(" ")}`;
|
|
789
792
|
}
|
|
793
|
+
let frameAncestorsPolicy = "'self'";
|
|
794
|
+
if (devServerOrigin && !frameAncestors) {
|
|
795
|
+
frameAncestorsPolicy = "*";
|
|
796
|
+
} else if (frameAncestors) {
|
|
797
|
+
frameAncestorsPolicy = frameAncestors;
|
|
798
|
+
}
|
|
790
799
|
const headers = {
|
|
791
800
|
"Content-Security-Policy": [
|
|
792
801
|
"default-src 'self'",
|
|
@@ -799,7 +808,7 @@ function getWidgetSecurityHeaders(widgetCSP, devServerBaseUrl) {
|
|
|
799
808
|
`media-src ${mediaSrc}`,
|
|
800
809
|
`font-src ${fontSrc}`,
|
|
801
810
|
`connect-src ${connectSrc}`,
|
|
802
|
-
|
|
811
|
+
`frame-ancestors ${frameAncestorsPolicy}`
|
|
803
812
|
].join("; "),
|
|
804
813
|
"X-Frame-Options": "SAMEORIGIN",
|
|
805
814
|
"X-Content-Type-Options": "nosniff",
|
|
@@ -825,7 +834,7 @@ function getWidgetSecurityHeaders(widgetCSP, devServerBaseUrl) {
|
|
|
825
834
|
"media-src 'self' data: https: blob:",
|
|
826
835
|
`font-src 'self' data: ${prodResourceDomainsStr}`,
|
|
827
836
|
`connect-src ${prodConnectSrc}`,
|
|
828
|
-
|
|
837
|
+
`frame-ancestors ${frameAncestorsPolicy}`
|
|
829
838
|
].join("; ");
|
|
830
839
|
}
|
|
831
840
|
return headers;
|
|
@@ -2,12 +2,28 @@ import {
|
|
|
2
2
|
checkClientFiles,
|
|
3
3
|
getClientDistPath,
|
|
4
4
|
getContentType
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-IDMHJUEM.js";
|
|
6
6
|
|
|
7
7
|
// src/server/shared-static.ts
|
|
8
8
|
import { existsSync, readFileSync } from "fs";
|
|
9
9
|
import { join } from "path";
|
|
10
|
-
function
|
|
10
|
+
function injectRuntimeConfig(html, config) {
|
|
11
|
+
if (!config) return html;
|
|
12
|
+
const scripts = [];
|
|
13
|
+
if (config.devMode) {
|
|
14
|
+
scripts.push(`<script>window.__MCP_DEV_MODE__ = true;</script>`);
|
|
15
|
+
}
|
|
16
|
+
if (config.sandboxOrigin) {
|
|
17
|
+
scripts.push(
|
|
18
|
+
`<script>window.__MCP_SANDBOX_ORIGIN__ = ${JSON.stringify(config.sandboxOrigin)};</script>`
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
if (scripts.length === 0) return html;
|
|
22
|
+
const injection = scripts.join("\n ");
|
|
23
|
+
return html.replace("</head>", ` ${injection}
|
|
24
|
+
</head>`);
|
|
25
|
+
}
|
|
26
|
+
function registerStaticRoutes(app, clientDistPath, runtimeConfig) {
|
|
11
27
|
const distPath = clientDistPath || getClientDistPath();
|
|
12
28
|
if (!checkClientFiles(distPath)) {
|
|
13
29
|
console.warn(`\u26A0\uFE0F MCP Inspector client files not found at ${distPath}`);
|
|
@@ -49,7 +65,10 @@ function registerStaticRoutes(app, clientDistPath) {
|
|
|
49
65
|
app.get("/inspector", (c) => {
|
|
50
66
|
const indexPath = join(distPath, "index.html");
|
|
51
67
|
if (existsSync(indexPath)) {
|
|
52
|
-
const content =
|
|
68
|
+
const content = injectRuntimeConfig(
|
|
69
|
+
readFileSync(indexPath, "utf-8"),
|
|
70
|
+
runtimeConfig
|
|
71
|
+
);
|
|
53
72
|
return c.html(content);
|
|
54
73
|
}
|
|
55
74
|
return c.html(`
|
|
@@ -68,7 +87,10 @@ function registerStaticRoutes(app, clientDistPath) {
|
|
|
68
87
|
const handleInspectorRoute = (c) => {
|
|
69
88
|
const indexPath = join(distPath, "index.html");
|
|
70
89
|
if (existsSync(indexPath)) {
|
|
71
|
-
const content =
|
|
90
|
+
const content = injectRuntimeConfig(
|
|
91
|
+
readFileSync(indexPath, "utf-8"),
|
|
92
|
+
runtimeConfig
|
|
93
|
+
);
|
|
72
94
|
return c.html(content);
|
|
73
95
|
}
|
|
74
96
|
return c.notFound();
|
|
@@ -78,7 +100,10 @@ function registerStaticRoutes(app, clientDistPath) {
|
|
|
78
100
|
app.get("*", (c) => {
|
|
79
101
|
const indexPath = join(distPath, "index.html");
|
|
80
102
|
if (existsSync(indexPath)) {
|
|
81
|
-
const content =
|
|
103
|
+
const content = injectRuntimeConfig(
|
|
104
|
+
readFileSync(indexPath, "utf-8"),
|
|
105
|
+
runtimeConfig
|
|
106
|
+
);
|
|
82
107
|
return c.html(content);
|
|
83
108
|
}
|
|
84
109
|
return c.html(`
|