@mcp-use/cli 4.0.0-beta.1 → 4.0.0-beta.3

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 (45) hide show
  1. package/dist/api-5C5J73XS.js +23 -0
  2. package/dist/bin.js +37 -0
  3. package/dist/build-BL3SCD2Q.js +23 -0
  4. package/dist/chunk-4Q7KWFEW.js +65 -0
  5. package/dist/chunk-4WKUTVLA.js +1 -0
  6. package/dist/chunk-7G4TXPP4.js +1 -0
  7. package/dist/chunk-7LRTFWC6.js +205 -0
  8. package/dist/chunk-AMCCKJH2.js +1 -0
  9. package/dist/chunk-HU2QUJ7M.js +1 -0
  10. package/dist/chunk-JAFV3QGS.js +1 -0
  11. package/dist/chunk-LHNHT6HO.js +8 -0
  12. package/dist/chunk-N6R74JIF.js +33 -0
  13. package/dist/chunk-N7BU45K6.js +1 -0
  14. package/dist/chunk-N7GIB7UG.js +2 -0
  15. package/dist/chunk-V2YAB5J5.js +20 -0
  16. package/dist/chunk-YAUVPOKC.js +618 -0
  17. package/dist/chunk-ZELLSKD2.js +1 -0
  18. package/dist/chunk-ZWRDP37E.js +1 -0
  19. package/dist/commands/build.js +5 -0
  20. package/dist/commands/client.js +1 -0
  21. package/dist/commands/deploy.js +1 -0
  22. package/dist/commands/deployments.js +6 -0
  23. package/dist/commands/dev.js +2 -0
  24. package/dist/commands/identity.js +2 -0
  25. package/dist/commands/organizations.js +2 -0
  26. package/dist/commands/screenshot.js +5 -0
  27. package/dist/commands/servers.js +2 -0
  28. package/dist/commands/skills.js +1 -0
  29. package/dist/commands/start.js +4 -0
  30. package/dist/dist-ATUXZA3G.js +1 -0
  31. package/dist/dist-DSLOT2HN.js +139 -0
  32. package/dist/false-AWHO5BNV.js +1 -0
  33. package/dist/jiti-IZ2GHWFT.js +1 -0
  34. package/dist/lexer-DQCqS3nf-TWOGUR6Y.js +3 -0
  35. package/dist/main-25QSIQDF.js +1 -0
  36. package/dist/next-server-shims.js +1 -0
  37. package/dist/node-7FETFLWX.js +1 -0
  38. package/dist/node-bridge-P3XTCFXS.js +1 -0
  39. package/dist/postcss-YNTG32JE.js +33 -0
  40. package/dist/postcss-import-VHSC6LGV.js +5 -0
  41. package/package.json +33 -7
  42. package/types/index.d.ts +1 -0
  43. package/dist/index.d.ts +0 -3
  44. package/dist/index.d.ts.map +0 -1
  45. package/dist/index.js +0 -10
@@ -0,0 +1 @@
1
+ var e=!1;export{e as a};
@@ -0,0 +1 @@
1
+ import{b as w}from"./chunk-ZWRDP37E.js";var se=w(V=>{"use strict";var ie="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");V.encode=function(t){if(0<=t&&t<ie.length)return ie[t];throw new TypeError("Must be between 0 and 63: "+t)};V.decode=function(t){var e=65,n=90,r=97,o=122,i=48,s=57,u=43,l=47,a=26,c=52;return e<=t&&t<=n?t-e:r<=t&&t<=o?t-r+a:i<=t&&t<=s?t-i+c:t==u?62:t==l?63:-1}});var X=w(J=>{"use strict";var ue=se(),k=5,le=1<<k,ae=le-1,ce=le;function Ge(t){return t<0?(-t<<1)+1:(t<<1)+0}function Ie(t){var e=(t&1)===1,n=t>>1;return e?-n:n}J.encode=function(e){var n="",r,o=Ge(e);do r=o&ae,o>>>=k,o>0&&(r|=ce),n+=ue.encode(r);while(o>0);return n};J.decode=function(e,n,r){var o=e.length,i=0,s=0,u,l;do{if(n>=o)throw new Error("Expected more digits in base 64 VLQ value.");if(l=ue.decode(e.charCodeAt(n++)),l===-1)throw new Error("Invalid base64 digit: "+e.charAt(n-1));u=!!(l&ce),l&=ae,i=i+(l<<s),s+=k}while(u);r.value=Ie(i),r.rest=n}});var I=w(S=>{"use strict";function xe(t,e,n){if(e in t)return t[e];if(arguments.length===3)return n;throw new Error('"'+e+'" is a required argument.')}S.getArg=xe;var fe=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,Te=/^data:.+\,.+$/;function D(t){var e=t.match(fe);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}S.urlParse=D;function G(t){var e="";return t.scheme&&(e+=t.scheme+":"),e+="//",t.auth&&(e+=t.auth+"@"),t.host&&(e+=t.host),t.port&&(e+=":"+t.port),t.path&&(e+=t.path),e}S.urlGenerate=G;var De=32;function qe(t){var e=[];return function(n){for(var r=0;r<e.length;r++)if(e[r].input===n){var o=e[0];return e[0]=e[r],e[r]=o,e[0].result}var i=t(n);return e.unshift({input:n,result:i}),e.length>De&&e.pop(),i}}var Z=qe(function(e){var n=e,r=D(e);if(r){if(!r.path)return e;n=r.path}for(var o=S.isAbsolute(n),i=[],s=0,u=0;;)if(s=u,u=n.indexOf("/",s),u===-1){i.push(n.slice(s));break}else for(i.push(n.slice(s,u));u<n.length&&n[u]==="/";)u++;for(var l,a=0,u=i.length-1;u>=0;u--)l=i[u],l==="."?i.splice(u,1):l===".."?a++:a>0&&(l===""?(i.splice(u+1,a),a=0):(i.splice(u,2),a--));return n=i.join("/"),n===""&&(n=o?"/":"."),r?(r.path=n,G(r)):n});S.normalize=Z;function he(t,e){t===""&&(t="."),e===""&&(e=".");var n=D(e),r=D(t);if(r&&(t=r.path||"/"),n&&!n.scheme)return r&&(n.scheme=r.scheme),G(n);if(n||e.match(Te))return e;if(r&&!r.host&&!r.path)return r.host=e,G(r);var o=e.charAt(0)==="/"?e:Z(t.replace(/\/+$/,"")+"/"+e);return r?(r.path=o,G(r)):o}S.join=he;S.isAbsolute=function(t){return t.charAt(0)==="/"||fe.test(t)};function Pe(t,e){t===""&&(t="."),t=t.replace(/\/$/,"");for(var n=0;e.indexOf(t+"/")!==0;){var r=t.lastIndexOf("/");if(r<0||(t=t.slice(0,r),t.match(/^([^\/]+:\/)?\/*$/)))return e;++n}return Array(n+1).join("../")+e.substr(t.length+1)}S.relative=Pe;var ge=(function(){var t=Object.create(null);return!("__proto__"in t)})();function de(t){return t}function je(t){return ve(t)?"$"+t:t}S.toSetString=ge?de:je;function Fe(t){return ve(t)?t.slice(1):t}S.fromSetString=ge?de:Fe;function ve(t){if(!t)return!1;var e=t.length;if(e<9||t.charCodeAt(e-1)!==95||t.charCodeAt(e-2)!==95||t.charCodeAt(e-3)!==111||t.charCodeAt(e-4)!==116||t.charCodeAt(e-5)!==111||t.charCodeAt(e-6)!==114||t.charCodeAt(e-7)!==112||t.charCodeAt(e-8)!==95||t.charCodeAt(e-9)!==95)return!1;for(var n=e-10;n>=0;n--)if(t.charCodeAt(n)!==36)return!1;return!0}function Ue(t,e,n){var r=O(t.source,e.source);return r!==0||(r=t.originalLine-e.originalLine,r!==0)||(r=t.originalColumn-e.originalColumn,r!==0||n)||(r=t.generatedColumn-e.generatedColumn,r!==0)||(r=t.generatedLine-e.generatedLine,r!==0)?r:O(t.name,e.name)}S.compareByOriginalPositions=Ue;function ze(t,e,n){var r;return r=t.originalLine-e.originalLine,r!==0||(r=t.originalColumn-e.originalColumn,r!==0||n)||(r=t.generatedColumn-e.generatedColumn,r!==0)||(r=t.generatedLine-e.generatedLine,r!==0)?r:O(t.name,e.name)}S.compareByOriginalPositionsNoSource=ze;function Be(t,e,n){var r=t.generatedLine-e.generatedLine;return r!==0||(r=t.generatedColumn-e.generatedColumn,r!==0||n)||(r=O(t.source,e.source),r!==0)||(r=t.originalLine-e.originalLine,r!==0)||(r=t.originalColumn-e.originalColumn,r!==0)?r:O(t.name,e.name)}S.compareByGeneratedPositionsDeflated=Be;function Qe(t,e,n){var r=t.generatedColumn-e.generatedColumn;return r!==0||n||(r=O(t.source,e.source),r!==0)||(r=t.originalLine-e.originalLine,r!==0)||(r=t.originalColumn-e.originalColumn,r!==0)?r:O(t.name,e.name)}S.compareByGeneratedPositionsDeflatedNoLine=Qe;function O(t,e){return t===e?0:t===null?1:e===null?-1:t>e?1:-1}function We(t,e){var n=t.generatedLine-e.generatedLine;return n!==0||(n=t.generatedColumn-e.generatedColumn,n!==0)||(n=O(t.source,e.source),n!==0)||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0)?n:O(t.name,e.name)}S.compareByGeneratedPositionsInflated=We;function $e(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))}S.parseSourceMapInput=$e;function Ve(t,e,n){if(e=e||"",t&&(t[t.length-1]!=="/"&&e[0]!=="/"&&(t+="/"),e=t+e),n){var r=D(n);if(!r)throw new Error("sourceMapURL could not be parsed");if(r.path){var o=r.path.lastIndexOf("/");o>=0&&(r.path=r.path.substring(0,o+1))}e=he(G(r),e)}return Z(e)}S.computeSourceURL=Ve});var H=w(_e=>{"use strict";var K=I(),Y=Object.prototype.hasOwnProperty,b=typeof Map<"u";function E(){this._array=[],this._set=b?new Map:Object.create(null)}E.fromArray=function(e,n){for(var r=new E,o=0,i=e.length;o<i;o++)r.add(e[o],n);return r};E.prototype.size=function(){return b?this._set.size:Object.getOwnPropertyNames(this._set).length};E.prototype.add=function(e,n){var r=b?e:K.toSetString(e),o=b?this.has(e):Y.call(this._set,r),i=this._array.length;(!o||n)&&this._array.push(e),o||(b?this._set.set(e,i):this._set[r]=i)};E.prototype.has=function(e){if(b)return this._set.has(e);var n=K.toSetString(e);return Y.call(this._set,n)};E.prototype.indexOf=function(e){if(b){var n=this._set.get(e);if(n>=0)return n}else{var r=K.toSetString(e);if(Y.call(this._set,r))return this._set[r]}throw new Error('"'+e+'" is not in the set.')};E.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)};E.prototype.toArray=function(){return this._array.slice()};_e.ArraySet=E});var Se=w(me=>{"use strict";var pe=I();function ke(t,e){var n=t.generatedLine,r=e.generatedLine,o=t.generatedColumn,i=e.generatedColumn;return r>n||r==n&&i>=o||pe.compareByGeneratedPositionsInflated(t,e)<=0}function U(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}U.prototype.unsortedForEach=function(e,n){this._array.forEach(e,n)};U.prototype.add=function(e){ke(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))};U.prototype.toArray=function(){return this._sorted||(this._array.sort(pe.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};me.MappingList=U});var ee=w(Ce=>{"use strict";var q=X(),p=I(),z=H().ArraySet,Je=Se().MappingList;function M(t){t||(t={}),this._file=p.getArg(t,"file",null),this._sourceRoot=p.getArg(t,"sourceRoot",null),this._skipValidation=p.getArg(t,"skipValidation",!1),this._ignoreInvalidMapping=p.getArg(t,"ignoreInvalidMapping",!1),this._sources=new z,this._names=new z,this._mappings=new Je,this._sourcesContents=null}M.prototype._version=3;M.fromSourceMap=function(e,n){var r=e.sourceRoot,o=new M(Object.assign(n||{},{file:e.file,sourceRoot:r}));return e.eachMapping(function(i){var s={generated:{line:i.generatedLine,column:i.generatedColumn}};i.source!=null&&(s.source=i.source,r!=null&&(s.source=p.relative(r,s.source)),s.original={line:i.originalLine,column:i.originalColumn},i.name!=null&&(s.name=i.name)),o.addMapping(s)}),e.sources.forEach(function(i){var s=i;r!==null&&(s=p.relative(r,i)),o._sources.has(s)||o._sources.add(s);var u=e.sourceContentFor(i);u!=null&&o.setSourceContent(i,u)}),o};M.prototype.addMapping=function(e){var n=p.getArg(e,"generated"),r=p.getArg(e,"original",null),o=p.getArg(e,"source",null),i=p.getArg(e,"name",null);!this._skipValidation&&this._validateMapping(n,r,o,i)===!1||(o!=null&&(o=String(o),this._sources.has(o)||this._sources.add(o)),i!=null&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:n.line,generatedColumn:n.column,originalLine:r!=null&&r.line,originalColumn:r!=null&&r.column,source:o,name:i}))};M.prototype.setSourceContent=function(e,n){var r=e;this._sourceRoot!=null&&(r=p.relative(this._sourceRoot,r)),n!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[p.toSetString(r)]=n):this._sourcesContents&&(delete this._sourcesContents[p.toSetString(r)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};M.prototype.applySourceMap=function(e,n,r){var o=n;if(n==null){if(e.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);o=e.file}var i=this._sourceRoot;i!=null&&(o=p.relative(i,o));var s=new z,u=new z;this._mappings.unsortedForEach(function(l){if(l.source===o&&l.originalLine!=null){var a=e.originalPositionFor({line:l.originalLine,column:l.originalColumn});a.source!=null&&(l.source=a.source,r!=null&&(l.source=p.join(r,l.source)),i!=null&&(l.source=p.relative(i,l.source)),l.originalLine=a.line,l.originalColumn=a.column,a.name!=null&&(l.name=a.name))}var c=l.source;c!=null&&!s.has(c)&&s.add(c);var g=l.name;g!=null&&!u.has(g)&&u.add(g)},this),this._sources=s,this._names=u,e.sources.forEach(function(l){var a=e.sourceContentFor(l);a!=null&&(r!=null&&(l=p.join(r,l)),i!=null&&(l=p.relative(i,l)),this.setSourceContent(l,a))},this)};M.prototype._validateMapping=function(e,n,r,o){if(n&&typeof n.line!="number"&&typeof n.column!="number"){var i="original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(i),!1;throw new Error(i)}if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!n&&!r&&!o)){if(e&&"line"in e&&"column"in e&&n&&"line"in n&&"column"in n&&e.line>0&&e.column>=0&&n.line>0&&n.column>=0&&r)return;var i="Invalid mapping: "+JSON.stringify({generated:e,source:r,original:n,name:o});if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(i),!1;throw new Error(i)}};M.prototype._serializeMappings=function(){for(var e=0,n=1,r=0,o=0,i=0,s=0,u="",l,a,c,g,h=this._mappings.toArray(),d=0,_=h.length;d<_;d++){if(a=h[d],l="",a.generatedLine!==n)for(e=0;a.generatedLine!==n;)l+=";",n++;else if(d>0){if(!p.compareByGeneratedPositionsInflated(a,h[d-1]))continue;l+=","}l+=q.encode(a.generatedColumn-e),e=a.generatedColumn,a.source!=null&&(g=this._sources.indexOf(a.source),l+=q.encode(g-s),s=g,l+=q.encode(a.originalLine-1-o),o=a.originalLine-1,l+=q.encode(a.originalColumn-r),r=a.originalColumn,a.name!=null&&(c=this._names.indexOf(a.name),l+=q.encode(c-i),i=c)),u+=l}return u};M.prototype._generateSourcesContent=function(e,n){return e.map(function(r){if(!this._sourcesContents)return null;n!=null&&(r=p.relative(n,r));var o=p.toSetString(r);return Object.prototype.hasOwnProperty.call(this._sourcesContents,o)?this._sourcesContents[o]:null},this)};M.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e};M.prototype.toString=function(){return JSON.stringify(this.toJSON())};Ce.SourceMapGenerator=M});var ye=w(N=>{"use strict";N.GREATEST_LOWER_BOUND=1;N.LEAST_UPPER_BOUND=2;function re(t,e,n,r,o,i){var s=Math.floor((e-t)/2)+t,u=o(n,r[s],!0);return u===0?s:u>0?e-s>1?re(s,e,n,r,o,i):i==N.LEAST_UPPER_BOUND?e<r.length?e:-1:s:s-t>1?re(t,s,n,r,o,i):i==N.LEAST_UPPER_BOUND?s:t<0?-1:t}N.search=function(e,n,r,o){if(n.length===0)return-1;var i=re(-1,n.length,e,n,r,o||N.GREATEST_LOWER_BOUND);if(i<0)return-1;for(;i-1>=0&&r(n[i],n[i-1],!0)===0;)--i;return i}});var we=w(Me=>{"use strict";function Xe(t){function e(o,i,s){var u=o[i];o[i]=o[s],o[s]=u}function n(o,i){return Math.round(o+Math.random()*(i-o))}function r(o,i,s,u){if(s<u){var l=n(s,u),a=s-1;e(o,l,u);for(var c=o[u],g=s;g<u;g++)i(o[g],c,!1)<=0&&(a+=1,e(o,a,g));e(o,a+1,g);var h=a+1;r(o,i,s,h-1),r(o,i,h+1,u)}}return r}function Ze(t){let e=Xe.toString();return new Function(`return ${e}`)()(t)}var Le=new WeakMap;Me.quickSort=function(t,e,n=0){let r=Le.get(e);r===void 0&&(r=Ze(e),Le.set(e,r)),r(t,e,n,t.length-1)}});var Ee=w(B=>{"use strict";var f=I(),te=ye(),x=H().ArraySet,Ke=X(),P=we().quickSort;function v(t,e){var n=t;return typeof t=="string"&&(n=f.parseSourceMapInput(t)),n.sections!=null?new A(n,e):new C(n,e)}v.fromSourceMap=function(t,e){return C.fromSourceMap(t,e)};v.prototype._version=3;v.prototype.__generatedMappings=null;Object.defineProperty(v.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});v.prototype.__originalMappings=null;Object.defineProperty(v.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});v.prototype._charIsMappingSeparator=function(e,n){var r=e.charAt(n);return r===";"||r===","};v.prototype._parseMappings=function(e,n){throw new Error("Subclasses must implement _parseMappings")};v.GENERATED_ORDER=1;v.ORIGINAL_ORDER=2;v.GREATEST_LOWER_BOUND=1;v.LEAST_UPPER_BOUND=2;v.prototype.eachMapping=function(e,n,r){var o=n||null,i=r||v.GENERATED_ORDER,s;switch(i){case v.GENERATED_ORDER:s=this._generatedMappings;break;case v.ORIGINAL_ORDER:s=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}for(var u=this.sourceRoot,l=e.bind(o),a=this._names,c=this._sources,g=this._sourceMapURL,h=0,d=s.length;h<d;h++){var _=s[h],m=_.source===null?null:c.at(_.source);m!==null&&(m=f.computeSourceURL(u,m,g)),l({source:m,generatedLine:_.generatedLine,generatedColumn:_.generatedColumn,originalLine:_.originalLine,originalColumn:_.originalColumn,name:_.name===null?null:a.at(_.name)})}};v.prototype.allGeneratedPositionsFor=function(e){var n=f.getArg(e,"line"),r={source:f.getArg(e,"source"),originalLine:n,originalColumn:f.getArg(e,"column",0)};if(r.source=this._findSourceIndex(r.source),r.source<0)return[];var o=[],i=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",f.compareByOriginalPositions,te.LEAST_UPPER_BOUND);if(i>=0){var s=this._originalMappings[i];if(e.column===void 0)for(var u=s.originalLine;s&&s.originalLine===u;)o.push({line:f.getArg(s,"generatedLine",null),column:f.getArg(s,"generatedColumn",null),lastColumn:f.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i];else for(var l=s.originalColumn;s&&s.originalLine===n&&s.originalColumn==l;)o.push({line:f.getArg(s,"generatedLine",null),column:f.getArg(s,"generatedColumn",null),lastColumn:f.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i]}return o};B.SourceMapConsumer=v;function C(t,e){var n=t;typeof t=="string"&&(n=f.parseSourceMapInput(t));var r=f.getArg(n,"version"),o=f.getArg(n,"sources"),i=f.getArg(n,"names",[]),s=f.getArg(n,"sourceRoot",null),u=f.getArg(n,"sourcesContent",null),l=f.getArg(n,"mappings"),a=f.getArg(n,"file",null);if(r!=this._version)throw new Error("Unsupported version: "+r);s&&(s=f.normalize(s)),o=o.map(String).map(f.normalize).map(function(c){return s&&f.isAbsolute(s)&&f.isAbsolute(c)?f.relative(s,c):c}),this._names=x.fromArray(i.map(String),!0),this._sources=x.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map(function(c){return f.computeSourceURL(s,c,e)}),this.sourceRoot=s,this.sourcesContent=u,this._mappings=l,this._sourceMapURL=e,this.file=a}C.prototype=Object.create(v.prototype);C.prototype.consumer=v;C.prototype._findSourceIndex=function(t){var e=t;if(this.sourceRoot!=null&&(e=f.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);var n;for(n=0;n<this._absoluteSources.length;++n)if(this._absoluteSources[n]==t)return n;return-1};C.fromSourceMap=function(e,n){var r=Object.create(C.prototype),o=r._names=x.fromArray(e._names.toArray(),!0),i=r._sources=x.fromArray(e._sources.toArray(),!0);r.sourceRoot=e._sourceRoot,r.sourcesContent=e._generateSourcesContent(r._sources.toArray(),r.sourceRoot),r.file=e._file,r._sourceMapURL=n,r._absoluteSources=r._sources.toArray().map(function(d){return f.computeSourceURL(r.sourceRoot,d,n)});for(var s=e._mappings.toArray().slice(),u=r.__generatedMappings=[],l=r.__originalMappings=[],a=0,c=s.length;a<c;a++){var g=s[a],h=new Oe;h.generatedLine=g.generatedLine,h.generatedColumn=g.generatedColumn,g.source&&(h.source=i.indexOf(g.source),h.originalLine=g.originalLine,h.originalColumn=g.originalColumn,g.name&&(h.name=o.indexOf(g.name)),l.push(h)),u.push(h)}return P(r.__originalMappings,f.compareByOriginalPositions),r};C.prototype._version=3;Object.defineProperty(C.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function Oe(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}var ne=f.compareByGeneratedPositionsDeflatedNoLine;function Ae(t,e){let n=t.length,r=t.length-e;if(!(r<=1))if(r==2){let o=t[e],i=t[e+1];ne(o,i)>0&&(t[e]=i,t[e+1]=o)}else if(r<20)for(let o=e;o<n;o++)for(let i=o;i>e;i--){let s=t[i-1],u=t[i];if(ne(s,u)<=0)break;t[i-1]=u,t[i]=s}else P(t,ne,e)}C.prototype._parseMappings=function(e,n){var r=1,o=0,i=0,s=0,u=0,l=0,a=e.length,c=0,g={},h={},d=[],_=[],m,Re,y,R,oe;let $=0;for(;c<a;)if(e.charAt(c)===";")r++,c++,o=0,Ae(_,$),$=_.length;else if(e.charAt(c)===",")c++;else{for(m=new Oe,m.generatedLine=r,R=c;R<a&&!this._charIsMappingSeparator(e,R);R++);for(Re=e.slice(c,R),y=[];c<R;)Ke.decode(e,c,h),oe=h.value,c=h.rest,y.push(oe);if(y.length===2)throw new Error("Found a source, but no line and column");if(y.length===3)throw new Error("Found a source and line, but no column");if(m.generatedColumn=o+y[0],o=m.generatedColumn,y.length>1&&(m.source=u+y[1],u+=y[1],m.originalLine=i+y[2],i=m.originalLine,m.originalLine+=1,m.originalColumn=s+y[3],s=m.originalColumn,y.length>4&&(m.name=l+y[4],l+=y[4])),_.push(m),typeof m.originalLine=="number"){let F=m.source;for(;d.length<=F;)d.push(null);d[F]===null&&(d[F]=[]),d[F].push(m)}}Ae(_,$),this.__generatedMappings=_;for(var j=0;j<d.length;j++)d[j]!=null&&P(d[j],f.compareByOriginalPositionsNoSource);this.__originalMappings=[].concat(...d)};C.prototype._findMapping=function(e,n,r,o,i,s){if(e[r]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[r]);if(e[o]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[o]);return te.search(e,n,i,s)};C.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var n=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var r=this._generatedMappings[e+1];if(n.generatedLine===r.generatedLine){n.lastGeneratedColumn=r.generatedColumn-1;continue}}n.lastGeneratedColumn=1/0}};C.prototype.originalPositionFor=function(e){var n={generatedLine:f.getArg(e,"line"),generatedColumn:f.getArg(e,"column")},r=this._findMapping(n,this._generatedMappings,"generatedLine","generatedColumn",f.compareByGeneratedPositionsDeflated,f.getArg(e,"bias",v.GREATEST_LOWER_BOUND));if(r>=0){var o=this._generatedMappings[r];if(o.generatedLine===n.generatedLine){var i=f.getArg(o,"source",null);i!==null&&(i=this._sources.at(i),i=f.computeSourceURL(this.sourceRoot,i,this._sourceMapURL));var s=f.getArg(o,"name",null);return s!==null&&(s=this._names.at(s)),{source:i,line:f.getArg(o,"originalLine",null),column:f.getArg(o,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}};C.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1};C.prototype.sourceContentFor=function(e,n){if(!this.sourcesContent)return null;var r=this._findSourceIndex(e);if(r>=0)return this.sourcesContent[r];var o=e;this.sourceRoot!=null&&(o=f.relative(this.sourceRoot,o));var i;if(this.sourceRoot!=null&&(i=f.urlParse(this.sourceRoot))){var s=o.replace(/^file:\/\//,"");if(i.scheme=="file"&&this._sources.has(s))return this.sourcesContent[this._sources.indexOf(s)];if((!i.path||i.path=="/")&&this._sources.has("/"+o))return this.sourcesContent[this._sources.indexOf("/"+o)]}if(n)return null;throw new Error('"'+o+'" is not in the SourceMap.')};C.prototype.generatedPositionFor=function(e){var n=f.getArg(e,"source");if(n=this._findSourceIndex(n),n<0)return{line:null,column:null,lastColumn:null};var r={source:n,originalLine:f.getArg(e,"line"),originalColumn:f.getArg(e,"column")},o=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",f.compareByOriginalPositions,f.getArg(e,"bias",v.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===r.source)return{line:f.getArg(i,"generatedLine",null),column:f.getArg(i,"generatedColumn",null),lastColumn:f.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};B.BasicSourceMapConsumer=C;function A(t,e){var n=t;typeof t=="string"&&(n=f.parseSourceMapInput(t));var r=f.getArg(n,"version"),o=f.getArg(n,"sections");if(r!=this._version)throw new Error("Unsupported version: "+r);this._sources=new x,this._names=new x;var i={line:-1,column:0};this._sections=o.map(function(s){if(s.url)throw new Error("Support for url field in sections not implemented.");var u=f.getArg(s,"offset"),l=f.getArg(u,"line"),a=f.getArg(u,"column");if(l<i.line||l===i.line&&a<i.column)throw new Error("Section offsets must be ordered and non-overlapping.");return i=u,{generatedOffset:{generatedLine:l+1,generatedColumn:a+1},consumer:new v(f.getArg(s,"map"),e)}})}A.prototype=Object.create(v.prototype);A.prototype.constructor=v;A.prototype._version=3;Object.defineProperty(A.prototype,"sources",{get:function(){for(var t=[],e=0;e<this._sections.length;e++)for(var n=0;n<this._sections[e].consumer.sources.length;n++)t.push(this._sections[e].consumer.sources[n]);return t}});A.prototype.originalPositionFor=function(e){var n={generatedLine:f.getArg(e,"line"),generatedColumn:f.getArg(e,"column")},r=te.search(n,this._sections,function(i,s){var u=i.generatedLine-s.generatedOffset.generatedLine;return u||i.generatedColumn-s.generatedOffset.generatedColumn}),o=this._sections[r];return o?o.consumer.originalPositionFor({line:n.generatedLine-(o.generatedOffset.generatedLine-1),column:n.generatedColumn-(o.generatedOffset.generatedLine===n.generatedLine?o.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}};A.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})};A.prototype.sourceContentFor=function(e,n){for(var r=0;r<this._sections.length;r++){var o=this._sections[r],i=o.consumer.sourceContentFor(e,!0);if(i||i==="")return i}if(n)return null;throw new Error('"'+e+'" is not in the SourceMap.')};A.prototype.generatedPositionFor=function(e){for(var n=0;n<this._sections.length;n++){var r=this._sections[n];if(r.consumer._findSourceIndex(f.getArg(e,"source"))!==-1){var o=r.consumer.generatedPositionFor(e);if(o){var i={line:o.line+(r.generatedOffset.generatedLine-1),column:o.column+(r.generatedOffset.generatedLine===o.line?r.generatedOffset.generatedColumn-1:0)};return i}}}return{line:null,column:null}};A.prototype._parseMappings=function(e,n){this.__generatedMappings=[],this.__originalMappings=[];for(var r=0;r<this._sections.length;r++)for(var o=this._sections[r],i=o.consumer._generatedMappings,s=0;s<i.length;s++){var u=i[s],l=o.consumer._sources.at(u.source);l!==null&&(l=f.computeSourceURL(o.consumer.sourceRoot,l,this._sourceMapURL)),this._sources.add(l),l=this._sources.indexOf(l);var a=null;u.name&&(a=o.consumer._names.at(u.name),this._names.add(a),a=this._names.indexOf(a));var c={source:l,generatedLine:u.generatedLine+(o.generatedOffset.generatedLine-1),generatedColumn:u.generatedColumn+(o.generatedOffset.generatedLine===u.generatedLine?o.generatedOffset.generatedColumn-1:0),originalLine:u.originalLine,originalColumn:u.originalColumn,name:a};this.__generatedMappings.push(c),typeof c.originalLine=="number"&&this.__originalMappings.push(c)}P(this.__generatedMappings,f.compareByGeneratedPositionsDeflated),P(this.__originalMappings,f.compareByOriginalPositions)};B.IndexedSourceMapConsumer=A});var Ne=w(be=>{"use strict";var Ye=ee().SourceMapGenerator,Q=I(),He=/(\r?\n)/,er=10,T="$$$isSourceNode$$$";function L(t,e,n,r,o){this.children=[],this.sourceContents={},this.line=t??null,this.column=e??null,this.source=n??null,this.name=o??null,this[T]=!0,r!=null&&this.add(r)}L.fromStringWithSourceMap=function(e,n,r){var o=new L,i=e.split(He),s=0,u=function(){var h=_(),d=_()||"";return h+d;function _(){return s<i.length?i[s++]:void 0}},l=1,a=0,c=null;return n.eachMapping(function(h){if(c!==null)if(l<h.generatedLine)g(c,u()),l++,a=0;else{var d=i[s]||"",_=d.substr(0,h.generatedColumn-a);i[s]=d.substr(h.generatedColumn-a),a=h.generatedColumn,g(c,_),c=h;return}for(;l<h.generatedLine;)o.add(u()),l++;if(a<h.generatedColumn){var d=i[s]||"";o.add(d.substr(0,h.generatedColumn)),i[s]=d.substr(h.generatedColumn),a=h.generatedColumn}c=h},this),s<i.length&&(c&&g(c,u()),o.add(i.splice(s).join(""))),n.sources.forEach(function(h){var d=n.sourceContentFor(h);d!=null&&(r!=null&&(h=Q.join(r,h)),o.setSourceContent(h,d))}),o;function g(h,d){if(h===null||h.source===void 0)o.add(d);else{var _=r?Q.join(r,h.source):h.source;o.add(new L(h.originalLine,h.originalColumn,_,d,h.name))}}};L.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(n){this.add(n)},this);else if(e[T]||typeof e=="string")e&&this.children.push(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};L.prototype.prepend=function(e){if(Array.isArray(e))for(var n=e.length-1;n>=0;n--)this.prepend(e[n]);else if(e[T]||typeof e=="string")this.children.unshift(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};L.prototype.walk=function(e){for(var n,r=0,o=this.children.length;r<o;r++)n=this.children[r],n[T]?n.walk(e):n!==""&&e(n,{source:this.source,line:this.line,column:this.column,name:this.name})};L.prototype.join=function(e){var n,r,o=this.children.length;if(o>0){for(n=[],r=0;r<o-1;r++)n.push(this.children[r]),n.push(e);n.push(this.children[r]),this.children=n}return this};L.prototype.replaceRight=function(e,n){var r=this.children[this.children.length-1];return r[T]?r.replaceRight(e,n):typeof r=="string"?this.children[this.children.length-1]=r.replace(e,n):this.children.push("".replace(e,n)),this};L.prototype.setSourceContent=function(e,n){this.sourceContents[Q.toSetString(e)]=n};L.prototype.walkSourceContents=function(e){for(var n=0,r=this.children.length;n<r;n++)this.children[n][T]&&this.children[n].walkSourceContents(e);for(var o=Object.keys(this.sourceContents),n=0,r=o.length;n<r;n++)e(Q.fromSetString(o[n]),this.sourceContents[o[n]])};L.prototype.toString=function(){var e="";return this.walk(function(n){e+=n}),e};L.prototype.toStringWithSourceMap=function(e){var n={code:"",line:1,column:0},r=new Ye(e),o=!1,i=null,s=null,u=null,l=null;return this.walk(function(a,c){n.code+=a,c.source!==null&&c.line!==null&&c.column!==null?((i!==c.source||s!==c.line||u!==c.column||l!==c.name)&&r.addMapping({source:c.source,original:{line:c.line,column:c.column},generated:{line:n.line,column:n.column},name:c.name}),i=c.source,s=c.line,u=c.column,l=c.name,o=!0):o&&(r.addMapping({generated:{line:n.line,column:n.column}}),i=null,o=!1);for(var g=0,h=a.length;g<h;g++)a.charCodeAt(g)===er?(n.line++,n.column=0,g+1===h?(i=null,o=!1):o&&r.addMapping({source:c.source,original:{line:c.line,column:c.column},generated:{line:n.line,column:n.column},name:c.name})):n.column++}),this.walkSourceContents(function(a,c){r.setSourceContent(a,c)}),{code:n.code,map:r}};be.SourceNode=L});var rr=w(W=>{"use strict";W.SourceMapGenerator=ee().SourceMapGenerator;W.SourceMapConsumer=Ee().SourceMapConsumer;W.SourceNode=Ne().SourceNode});export{rr as a};
@@ -0,0 +1 @@
1
+ var f="127.0.0.1";function u(n,e,t=process.env){if(n!==void 0)return n;let r=t.HOST?.trim();return r!==void 0&&r!==""?r:e??f}function a(n,e,t=process.env){if(n!==void 0)return n;let r=c(t.PORT);return r!==void 0?r:e??3e3}function c(n){if(n===void 0||n.trim()==="")return;let e=Number(n);return Number.isInteger(e)&&e>=0&&e<=65535?e:void 0}function m(n){let e={command:void 0,port:void 0,entry:void 0,path:void 0,mcpDir:void 0,viewsDir:void 0,host:void 0,tunnel:!1,open:!0,inspector:!0,withInspector:!1,sourceMaps:!1,inline:!1,help:!1,version:!1};for(let t=0;t<n.length;t++){let r=n[t];if(r===void 0)continue;let i=r,d;if(r.startsWith("--")){let s=r.indexOf("=");s!==-1&&(i=r.slice(0,s),d=r.slice(s+1))}let o=()=>{if(d!==void 0)return d;let s=n[++t];if(s===void 0||s.startsWith("-"))throw new Error(`Missing value for ${i}`);return s};switch(i){case"-h":case"--help":e.help=!0;break;case"-v":case"--version":e.version=!0;break;case"-p":case"--port":e.port=p(o());break;case"--entry":e.entry=o();break;case"--path":e.path=o();break;case"--mcp-dir":e.mcpDir=o();break;case"--views-dir":e.viewsDir=o();break;case"--host":e.host=o();break;case"--tunnel":e.tunnel=!0;break;case"--no-open":e.open=!1;break;case"--no-inspector":e.inspector=!1;break;case"--with-inspector":e.withInspector=!0;break;case"--source-maps":e.sourceMaps=!0;break;case"--inline":e.inline=!0;break;default:if(i.startsWith("-"))throw new Error(`Unknown option: ${i}`);if(e.command!==void 0)throw new Error(`Unexpected argument: ${i}`);e.command=i}}return e}function h(n,e=process.env,t){return a(n,t,e)}function v(n,e=process.env,t){return u(n,t,e)}function p(n){let e=Number(n);if(!l(e))throw new Error(`Invalid port: ${n}`);return e}function l(n){return Number.isInteger(n)&&n>=0&&n<=65535}export{m as a,h as b,v as c};
@@ -0,0 +1,8 @@
1
+ import{spawn as p}from"child_process";import{constants as u}from"fs";import{access as f,chmod as a,mkdir as m,readFile as l,rename as w,rm as g,writeFile as y}from"fs/promises";import{homedir as x}from"os";import{dirname as $,join as c}from"path";import{createInterface as E}from"readline/promises";var r=class extends Error{exitCode=2},s=class extends Error{code;details;constructor(n,e,o){super(e),this.code=n,this.details=o}};function P(t){return t.includes("--json")}function h(t,n,e){n?process.stdout.write(`${JSON.stringify(t)}
2
+ `):e!==void 0?process.stdout.write(`${e}
3
+ `):typeof t=="string"?process.stdout.write(`${t}
4
+ `):process.stdout.write(`${JSON.stringify(t,null,2)}
5
+ `)}function k(t,n){let e=t instanceof r,o=t instanceof s,d=o?t.code:e?"usage_error":"command_failed",i=t instanceof Error?t.message:String(t);return n?process.stderr.write(`${JSON.stringify({error:{code:d,message:i,...o&&t.details!==void 0?{details:t.details}:{}}})}
6
+ `):process.stderr.write(`${i}
7
+ `),e?2:1}async function _(t,n){if(n.yes)return!0;if(n.json||!process.stdin.isTTY)throw new r(`${t} Pass --yes to confirm.`);let e=E({input:process.stdin,output:process.stdout});try{return(await e.question(`${t} [y/N] `)).trim().toLowerCase()==="y"}finally{e.close()}}function v(t){let[n,e]=process.platform==="darwin"?["open",[t]]:process.platform==="win32"?["cmd",["/c","start","",t]]:["xdg-open",[t]];try{let o=p(n,e,{detached:!0,stdio:"ignore"});o.on("error",()=>{}),o.unref()}catch{}}async function j(t){try{return await f(t,u.F_OK),!0}catch{return!1}}async function F(t,n){try{return JSON.parse(await l(t,"utf8"))}catch(e){if(e.code==="ENOENT")return n;throw new s("invalid_state",`Could not read ${t}.`,{cause:e instanceof Error?e.message:String(e)})}}async function I(t,n){let e=$(t);await m(e,{recursive:!0,mode:448}),await a(e,448);let o=c(e,`.${t.slice(t.lastIndexOf("/")+1)}.${process.pid}.${Date.now()}.tmp`);await y(o,`${JSON.stringify(n,null,2)}
8
+ `,{mode:384}),await w(o,t),await a(t,384)}async function L(t){await g(t,{force:!0})}var A=c(x(),".mcp-use");export{r as a,s as b,P as c,h as d,k as e,_ as f,v as g,j as h,F as i,I as j,L as k,A as l};
@@ -0,0 +1,33 @@
1
+ import{a,b as E,c as L,d as p,e as N,f as S,g as U,h,i as k,j as w,l as R}from"./chunk-LHNHT6HO.js";import{createHash as ie}from"crypto";import{rm as J}from"fs/promises";import{join as P}from"path";import{parseArgs as b}from"util";import{spawn as K}from"child_process";import{readFileSync as W}from"fs";import{chmod as z,mkdir as q}from"fs/promises";import{dirname as V,join as y,resolve as Y}from"path";import{pathToFileURL as M}from"url";var g=y(R,"client-sdk"),m="@mcp-use/client",Z="^2.0.0-alpha.0",Q=[`[mcp-use] ${m} is not installed.`,"The `mcp-use client` and `mcp-use screenshot` commands require it.","Install it in your project:",""," npm install @mcp-use/client",""," pnpm add @mcp-use/client",""," bun add @mcp-use/client"].join(`
2
+ `);async function X(e){let n=Y(e);for(;;){if(await h(y(n,"package.json")))return n;let t=V(n);if(t===n)return;n=t}}async function D(){try{return await oe()}catch(e){if(!j(e))throw e;let n=await ee();try{return n.location==="sandbox"?await se():await re(n.projectRoot)}catch(t){throw j(t)?new a(Q):t}}}async function ee(){let e=ne(),n=`${m}@${e}`,t=await X(process.cwd());if(process.stderr.write(`[mcp-use] installing ${m}\u2026
3
+ `),t!==void 0){let[s,c]=te(n);if(await I(s,c,t)!==0)throw new E("client_install_failed",`Failed to install ${m}.`);return{location:"project",projectRoot:t}}await q(g,{recursive:!0,mode:448}),await z(g,448);let r=y(g,"package.json");if(await h(r)||await w(r,{private:!0,dependencies:{[m]:e}}),await I("npm",["install",n],g)!==0)throw new E("client_install_failed",`Failed to install ${m}.`);return{location:"sandbox"}}function te(e){let n=process.env.npm_config_user_agent??"";return n.startsWith("pnpm/")?["pnpm",["add",e]]:n.startsWith("bun/")?["bun",["add",e]]:["npm",["install",e]]}function ne(){for(let e of["../package.json","../../package.json"])try{let n=W(new URL(e,import.meta.url),"utf8"),t=JSON.parse(n);if(t.name!=="mcp-use")continue;let r=t.peerDependencies?.[m];if(typeof r=="string"&&r.length>0)return r}catch{}return Z}async function oe(){return import("@mcp-use/client")}async function re(e){let n=M(y(e,"package.json")).href;return import(await import.meta.resolve(m,n))}async function se(){let e=y(g,"node_modules",m,"dist","index.js");return await import(M(e).href)}function j(e){if(!(e instanceof Error))return!1;let n=e.code;return n==="ERR_MODULE_NOT_FOUND"||n==="MODULE_NOT_FOUND"?e.message.includes(m)||e.message.includes("Cannot find package"):!1}function I(e,n,t){return new Promise((r,o)=>{let s=K(e,n,{cwd:t,stdio:"inherit",shell:process.platform==="win32"});s.once("error",o),s.once("exit",(c,u)=>{r(u==="SIGINT"?130:c??1)})})}var B=P(R,"client"),_=P(B,"servers.json"),ae=`Usage: mcp-use client <command> [options]
4
+
5
+ Commands:
6
+ connect <name> <url> Connect and save an HTTP(S) MCP server
7
+ list List saved servers
8
+ remove <name> Remove a saved server
9
+ <name> Invoke tools/resources/prompts on a saved server
10
+
11
+ Connect options:
12
+ -H, --header <"Key: Value"> Static header (repeatable)
13
+ --no-oauth Skip OAuth on authorization challenges
14
+ --auth-timeout <ms> OAuth wait timeout (default: 300000)
15
+ --protocol <auto|2026-07-28|2025-11-25>
16
+ --open Open the OAuth URL in a browser without prompting
17
+ --no-open Print the OAuth URL only
18
+ --json Emit machine-readable output
19
+
20
+ Saved server commands:
21
+ mcp-use client <name> tools list|describe|call ...
22
+ mcp-use client <name> resources list|read ...
23
+ mcp-use client <name> prompts list|get ...
24
+ mcp-use client <name> auth status|logout
25
+
26
+ Examples:
27
+ mcp-use client connect linear https://mcp.linear.app/mcp
28
+ mcp-use client linear tools list
29
+ mcp-use client linear tools call search_issues query="open bugs"`;async function _e(e){if(e.includes("--help")||e.includes("-h"))return console.log(ae),0;let n=L(e);try{let t=e[0];if(t==="connect")return await ce(e.slice(1),n);if(t==="list")return await le(e.slice(1),n);if(t==="remove")return await ue(e.slice(1),n);if(t===void 0)throw new a("Usage: mcp-use client <connect|list|remove|name>");return await pe(t,e.slice(1),n)}catch(t){return N(t instanceof TypeError?new a(t.message):t,n)}}async function ce(e,n){let{values:t,positionals:r}=b({args:[...e],allowPositionals:!0,strict:!0,options:{header:{type:"string",short:"H",multiple:!0},"no-oauth":{type:"boolean"},"auth-timeout":{type:"string"},protocol:{type:"string",default:"auto"},open:{type:"boolean"},"no-open":{type:"boolean"},json:{type:"boolean"}}});if(t.open===!0&&t["no-open"]===!0)throw new a("Cannot combine --open and --no-open.");if(r.length!==2)throw new a("Usage: mcp-use client connect <name> <url>");let[o,s]=r;he(o);let c=new URL(s);if(!["http:","https:"].includes(c.protocol))throw new a("Client URLs must use http or https.");let u=we(t.protocol),l=F(t["auth-timeout"]??"300000","--auth-timeout"),i=await C();if(i.servers[o]!==void 0)throw new a(`Saved server already exists: ${o}`);let d={headers:fe(t.header??[])},f={url:c.href,oauth:t["no-oauth"]!==!0,protocol:u};return await(await $(o,f,d,l,me({open:t.open===!0,noOpen:t["no-open"]===!0,json:n}))).disconnect(),i.servers[o]=f,await w(_,i),await w(x(o),d),p({name:o,url:f.url,protocol:u},n,`Connected and saved ${o}.`),0}async function le(e,n){v(e);let t=await C(),r=Object.entries(t.servers).map(([o,s])=>({name:o,...s}));return p(r,n,r.map(o=>`${o.name} ${o.url}`).join(`
30
+ `)||"No saved servers."),0}async function ue(e,n){let{values:t,positionals:r}=b({args:[...e],allowPositionals:!0,strict:!0,options:{yes:{type:"boolean"},json:{type:"boolean"}}}),o=T(r,"mcp-use client remove <name>");if(!await S(`Remove saved server ${o}?`,{yes:t.yes===!0,json:n}))return 0;let s=await C();return delete s.servers[o],await w(_,s),await J(A(o),{recursive:!0,force:!0}),p({removed:o},n,`Removed ${o}.`),0}async function pe(e,n,t){let o=(await C()).servers[e];if(o===void 0)throw new a(`Unknown saved server: ${e}. Run \`mcp-use client connect ${e} <url>\`.`);let s=n[0],c=n[1];if(s==="auth"){if(c==="status"){v(n.slice(2));let i=await h(O(e));return p({name:e,oauth:o.oauth,authenticated:i},t,i?"Authenticated.":"No saved OAuth session."),0}if(c==="logout"){let{values:i,positionals:d}=b({args:[...n.slice(2)],allowPositionals:!0,strict:!0,options:{yes:{type:"boolean"},json:{type:"boolean"}}});if(d.length!==0)throw new a(`Usage: mcp-use client ${e} auth logout`);return await S(`Delete OAuth credentials for ${e}?`,{yes:i.yes===!0,json:t})&&(await J(O(e),{recursive:!0,force:!0}),p({loggedOut:e},t,`Logged out ${e}.`)),0}}let u=await k(x(e),{}),l=await $(e,o,u,3e5);try{if(s==="tools"){if(c==="list"){v(n.slice(2));let i=await l.listTools();return p(i,t,i.map(d=>`${d.name} ${d.description??""}`).join(`
31
+ `)),0}if(c==="describe"){let i=T(n.slice(2),`mcp-use client ${e} tools describe <tool>`),d=(await l.listTools()).find(f=>f.name===i);if(d===void 0)throw new a(`Tool not found: ${i}`);return p(d,t),0}if(c==="call")return await de(l,e,n.slice(2),t)}if(s==="resources"){if(c==="list"){v(n.slice(2));let i=await l.listResources();return p(i,t),0}if(c==="read"){let i=T(n.slice(2),`mcp-use client ${e} resources read <uri>`);return p(await l.readResource(i),t),0}}if(s==="prompts"){if(c==="list")return v(n.slice(2)),p(await l.listPrompts(),t),0;if(c==="get"){let i=n[2];if(i===void 0)throw new a(`Usage: mcp-use client ${e} prompts get <prompt> [args]`);return p(await l.getPrompt(i,H(n.slice(3))),t),0}}throw new a(`Usage: mcp-use client ${e} <tools|resources|prompts|auth> ...`)}finally{await l.disconnect()}}async function de(e,n,t,r){let o=t[0];if(o===void 0)throw new a(`Usage: mcp-use client ${n} tools call <tool> [args]`);let{values:s,positionals:c}=b({args:[...t.slice(1)],allowPositionals:!0,strict:!0,options:{timeout:{type:"string",default:"30000"},json:{type:"boolean"}}}),u=F(s.timeout,"--timeout"),l=await e.callTool(o,H(c),{timeout:u});if(l.isError===!0)throw new Error(`Tool ${o} returned an error: ${JSON.stringify(l)}`);return p(l,r),0}async function $(e,n,t,r,o=process.stdin.isTTY?"ask":"never"){let{createOAuthProvider:s,MCPClient:c}=await D(),u=O(e),l=n.oauth?await s(n.url,{baseDir:u,authTimeoutMs:r,storageKeyPrefix:`mcp-use-cli:${e}`,openBrowser:async f=>{process.stderr.write(`Open this URL to authenticate:
32
+ ${f}
33
+ `),o!=="never"&&(o==="ask"&&!await S("Open in browser?",{yes:!1,json:!1})||U(f))}}):void 0,i=n.protocol==="auto"?"auto":{pin:n.protocol};return new c({mcpServers:{[e]:{url:n.url,...t.headers!==void 0?{headers:t.headers}:{},...l!==void 0?{authProvider:l}:{oauth:!1},protocolNegotiation:i}}}).connect(e)}async function Ae(e,n=3e5){let r=(await C()).servers[e];if(r===void 0)throw new a(`Unknown saved server: ${e}`);let o=await k(x(e),{});return $(e,r,o,n)}async function xe(e,n){return $("screenshot",{url:e,oauth:!1,protocol:"auto"},{headers:n},3e5)}function H(e){if(e.length===0)return{};if(e.length===1&&e[0]?.trimStart().startsWith("{")){let t=JSON.parse(e[0]);if(t===null||Array.isArray(t)||typeof t!="object")throw new a("The JSON argument must be an object.");return t}let n={};for(let t of e){let r=t.indexOf(":="),o=t.indexOf("="),s=r>=0?r:o,c=r>=0?2:1;if(s<=0)throw new a(`Expected key=value or key:=<json>, received: ${t}`);let u=t.slice(0,s).replace(/^--/,""),l=t.slice(s+c);n[u]=r>=0?JSON.parse(l):l}return n}function me(e){return e.json||e.noOpen||!process.stdin.isTTY?"never":e.open?"always":"ask"}function fe(e){let n={};for(let t of e){let r=t.indexOf(":");if(r<=0)throw new a(`Invalid header: ${t}`);n[t.slice(0,r).trim()]=t.slice(r+1).trim()}return n}function we(e){if(e!=="auto"&&e!=="2026-07-28"&&e!=="2025-11-25")throw new a(`Invalid protocol: ${e}`);return e}function F(e,n){let t=Number(e);if(!Number.isInteger(t)||t<=0)throw new a(`${n} must be a positive integer.`);return t}function he(e){if(!/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/.test(e))throw new a("Server names must be 1-64 filesystem-safe letters, numbers, dots, dashes, or underscores.")}async function C(){return k(_,{servers:{}})}function A(e){return P(B,"credentials",ie("sha256").update(e).digest("hex"))}function x(e){return P(A(e),"credentials.json")}function O(e){return P(A(e),"oauth")}function v(e){b({args:[...e],allowPositionals:!1,strict:!0,options:{json:{type:"boolean"}}})}function T(e,n){if(e.length!==1)throw new a(`Usage: ${n}`);return e[0]}export{_e as a,Ae as b,xe as c,H as d};
@@ -0,0 +1 @@
1
+ function s(t,n){return r(new URL(t.url).pathname,n)}function r(t,n){let e=`${n}/inspector`;return t===e||t.startsWith(`${e}/`)}export{s as a,r as b};
@@ -0,0 +1,2 @@
1
+ import{createRequire as P}from"module";import{readFileSync as A}from"fs";import C,{resolve as O}from"path";import{fileURLToPath as j}from"url";import b from"readline";var F=Object.create,E=Object.defineProperty,U=Object.getOwnPropertyDescriptor,M=Object.getOwnPropertyNames,$=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty,ee=(t,o)=>()=>(t&&(o=t(t=0)),o),y=(t,o)=>()=>(o||(t((o={exports:{}}).exports,o),t=null),o.exports),te=(t,o)=>{let n={};for(var l in t)E(n,l,{get:t[l],enumerable:!0});return o||E(n,Symbol.toStringTag,{value:"Module"}),n},R=(t,o,n,l)=>{if(o&&typeof o=="object"||typeof o=="function")for(var c=M(o),B=0,x=c.length,i;B<x;B++)i=c[B],!h.call(t,i)&&i!==n&&E(t,i,{get:(d=>o[d]).bind(null,i),enumerable:!(l=U(o,i))||l.enumerable});return t},k=(t,o,n)=>(n=t!=null?F($(t)):{},R(o||!t||!t.__esModule?E(n,"default",{value:t,enumerable:!0}):n,t)),re=t=>h.call(t,"module.exports")?t["module.exports"]:R(E({},"__esModule",{value:!0}),t),oe=P(import.meta.url),V=y(((t,o)=>{let n=process||{},l=n.argv||[],c=n.env||{},B=!(c.NO_COLOR||l.includes("--no-color"))&&(!!c.FORCE_COLOR||l.includes("--color")||n.platform==="win32"||(n.stdout||{}).isTTY&&c.TERM!=="dumb"||!!c.CI),x=(m,e,g=m)=>u=>{let r=""+u,s=r.indexOf(e,m.length);return~s?m+i(r,e,g,s)+e:m+r+e},i=(m,e,g,u)=>{let r="",s=0;do r+=m.substring(s,u)+g,s=u+e.length,u=m.indexOf(e,s);while(~u);return r+m.substring(s)},d=(m=B)=>{let e=m?x:()=>String;return{isColorSupported:m,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};o.exports=d(),o.exports.createColors=d})),{version:W}=JSON.parse(A(new URL("../../package.json",new URL("../../../src/node/constants.ts",import.meta.url))).toString()),se=["options","buildStart","buildEnd","renderStart","renderError","renderChunk","writeBundle","generateBundle","banner","footer","augmentChunkHash","outputOptions","intro","outro","closeBundle","closeWatcher","load","moduleParsed","watchChange","resolveDynamicImport","resolveId","transform","onLog"],ne=W,v=["browser","module","jsnext:main","jsnext"],ae=Object.freeze(v),le=Object.freeze(v.filter(t=>t!=="browser")),Y="development|production",L=["module","browser","node",Y],ce=Object.freeze(L.filter(t=>t!=="node")),me=Object.freeze(L.filter(t=>t!=="browser")),ie=Object.freeze(["node","module-sync"]),ue=[".mjs",".js",".mts",".ts",".jsx",".tsx",".json"],Be=["chrome111","edge111","firefox114","safari16.4","ios16.4"],_e=["vite.config.js","vite.config.mjs","vite.config.ts","vite.config.cjs","vite.config.mts","vite.config.cts"],xe=/\.(?:j|t)sx?$|\.mjs$/,de=/\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)(?:$|\?)/,fe=/\.[cm]?[jt]s$/,ge=/[?&](?:worker|sharedworker|raw|url)\b/,Ee="/@fs/",pe="/@vite/client",Ie="/@vite/env",N=O(j(new URL("../../../src/node/constants.ts",import.meta.url)),"../../.."),G=O(N,"dist/client/client.mjs"),Oe=O(N,"dist/client/env.mjs"),be=C.dirname(G),H=["apng","bmp","png","jpe?g","jfif","pjpeg","pjp","gif","svg","ico","webp","avif","cur","jxl","mp4","webm","ogg","mp3","wav","flac","aac","opus","mov","m4a","vtt","woff2?","eot","ttf","otf","webmanifest","pdf","txt"],Se=new RegExp("\\.("+H.join("|")+")(\\?.*)?$","i"),Te=/[?&](v=[\w.-]+)\b/,we=new Set(["localhost","127.0.0.1","::1","0000:0000:0000:0000:0000:0000:0000:0001"]),he=new Set(["0.0.0.0","::","0000:0000:0000:0000:0000:0000:0000:0000"]),Re=5173,ve=4173,Le=4096,Ne=/^https?:\/\/(?:(?:[^:]+\.)?localhost|127\.0\.0\.1|\[::1\])(?::\d+)?$/,De="_metadata.json",Pe="ERR_OPTIMIZE_DEPS_PROCESSING_ERROR",Ae="ERR_FILE_NOT_FOUND_IN_OPTIMIZED_DEP_DIR",a=k(V(),1),p={silent:0,error:1,warn:2,info:3},S,T,I=0;function z(){let t=process.stdout.rows-2,o=t>0?`
2
+ `.repeat(t):"";console.log(o),b.cursorTo(process.stdout,0,0),b.clearScreenDown(process.stdout)}var w;function Z(){return w??=new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"numeric",second:"numeric"}),w}function Ce(t="info",o={}){if(o.customLogger)return o.customLogger;let n=new WeakSet,{prefix:l="[vite]",allowClearScreen:c=!0,console:B=globalThis.console}=o,x=p[t],i=c&&process.stdout.isTTY&&!process.env.CI,d=i?z:()=>{};function m(r,s,_={}){if(_.timestamp){let f="";r==="info"?f=a.default.cyan(a.default.bold(l)):r==="warn"?f=a.default.yellow(a.default.bold(l)):f=a.default.red(a.default.bold(l));let D=_.environment?_.environment+" ":"";return`${a.default.dim(Z().format(new Date))} ${f} ${D}${s}`}else return s}function e(r,s,_={}){if(x>=p[r]){let f=r==="info"?"log":r;_.error&&n.add(_.error),i?r===S&&s===T?(I++,d(),B[f](m(r,s,_),a.default.yellow(`(x${I+1})`))):(I=0,T=s,S=r,_.clear&&d(),B[f](m(r,s,_))):B[f](m(r,s,_))}}let g=new Set,u={hasWarned:!1,info(r,s){e("info",r,s)},warn(r,s){u.hasWarned=!0,e("warn",r,s)},warnOnce(r,s){g.has(r)||(u.hasWarned=!0,e("warn",r,s),g.add(r))},error(r,s){u.hasWarned=!0,e("error",r,s)},clearScreen(r){x>=p[r]&&d()},hasErrorLogged(r){return n.has(r)}};return u}function je(t,o,n){let l=c=>a.default.cyan(c.replace(/:(\d+)\//,(B,x)=>`:${a.default.bold(x)}/`));for(let c of t.local)n(` ${a.default.green("\u279C")} ${a.default.bold("Local")}: ${l(c)}`);for(let c of t.network)n(` ${a.default.green("\u279C")} ${a.default.bold("Network")}: ${l(c)}`);t.network.length===0&&o===void 0&&n(a.default.dim(` ${a.default.green("\u279C")} ${a.default.bold("Network")}: use `)+a.default.bold("--host")+a.default.dim(" to expose"))}export{ee as a,y as b,te as c,k as d,re as e,oe as f,V as g,se as h,ne as i,ae as j,le as k,Y as l,ce as m,me as n,ie as o,ue as p,Be as q,_e as r,xe as s,de as t,fe as u,ge as v,Ee as w,pe as x,Ie as y,N as z,G as A,Oe as B,be as C,H as D,Se as E,Te as F,we as G,he as H,Re as I,ve as J,Le as K,Ne as L,De as M,Pe as N,Ae as O,p as P,Ce as Q,je as R};