@mcp-use/cli 4.0.2-canary.3 → 4.0.2-canary.5
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/bin.js +1 -1
- package/dist/{chunk-JHCVAC2M.js → chunk-2E4ZVDXN.js} +1 -1
- package/dist/chunk-Q6AC7LJS.js +11 -0
- package/dist/{chunk-F22D552R.js → chunk-SVICUITV.js} +1 -1
- package/dist/chunk-TSMDTAVA.js +4 -0
- package/dist/commands/build.js +1 -1
- package/dist/commands/client.js +1 -1
- package/dist/commands/deploy.js +1 -1
- package/dist/commands/deployments.js +1 -1
- package/dist/commands/dev.js +25 -25
- package/dist/commands/identity.js +1 -1
- package/dist/commands/organizations.js +1 -1
- package/dist/commands/screenshot.js +1 -1
- package/dist/commands/servers.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-DODFSHJ5.js +0 -11
- package/dist/chunk-JRCSP5WH.js +0 -4
- /package/dist/{chunk-23BW3OXH.js → chunk-Q53LTBGS.js} +0 -0
package/dist/bin.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as o}from"./chunk-
|
|
2
|
+
import{a as o}from"./chunk-Q53LTBGS.js";import"./chunk-RXKUVCL7.js";import"./chunk-WOT6VMZA.js";import{readFileSync as i}from"fs";import{createRequire as a}from"module";import{dirname as t,join as c,parse as m}from"path";function p(){try{let e=a(import.meta.url).resolve("mcp-use"),n=t(e),s=m(n).root;for(;n!==s;){try{let r=JSON.parse(i(c(n,"package.json"),"utf8"));if(r.name==="mcp-use"&&typeof r.version=="string")return r.version}catch{}n=t(n)}}catch{}}o(process.argv.slice(2),{frameworkVersion:p()??"4.0.2-canary.5"}).then(e=>{process.exitCode=e},e=>{console.error(e instanceof Error?e.message:String(e)),process.exitCode=1});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as a,j as w,k as h,l as _,m as C}from"./chunk-
|
|
1
|
+
import{b as a,j as w,k as h,l as _,m as C}from"./chunk-Q6AC7LJS.js";import{join as O}from"path";var y=O(C,"config.json");function g(){return(process.env.MCP_USE_CLOUD_API_URL??process.env.MCP_API_URL??"https://cloud.manufact.com/api/v1").replace(/\/+$/,"").replace(/\/api\/v1$/,"")+"/api/v1"}function j(){return(process.env.MCP_USE_CLOUD_WEB_URL??"https://manufact.com").replace(/\/+$/,"")}function R(){return g().replace(/\/api\/v1$/,"")}async function I(){return w(y,{})}async function T(t){await h(y,t)}async function E(){await _(y)}function k(t,n){let e=t.filter(i=>i.id===n||i.slug===n);if(e.length!==1)throw new a(e.length===0?"organization_not_found":"organization_ambiguous",`Organization not found: ${n}`);return e[0]}var c=class t{#n;#e;constructor(n,e){this.#n=n,this.#e=e}static async create(n){let e=await I(),i=process.env.MCP_USE_API_KEY??e.apiKey;if(i===void 0||i==="")throw new a("not_authenticated","Not logged in. Run `mcp-use login`.");return new t(i,n??e.orgId)}static withApiKey(n){return new t(n)}async request(n,e={}){let i=b(this.#n,e),r=e.organizationId??this.#e,o=await fetch(`${g()}${n}`,{...e,headers:{Accept:"application/json","x-api-key":this.#n,...r!==void 0?{"x-profile-id":r}:{},...e.body!==void 0?{"Content-Type":"application/json"}:{},...e.headers}}),d=await o.text(),s;try{s=d===""?void 0:JSON.parse(d)}catch{s=d}if(!o.ok)throw A(n,o.status,f(s,i));return s}async multipartRequest(n,e,i={}){let r=v(this.#n,e),o=new AbortController,d=setTimeout(()=>o.abort(),i.timeoutMs??12e4);try{let s=await fetch(`${g()}${n}`,{method:i.method??"POST",headers:{Accept:"application/json","x-api-key":this.#n,...this.#e!==void 0?{"x-profile-id":this.#e}:{}},body:e,signal:o.signal}),l=await s.text(),u;try{u=l===""?void 0:JSON.parse(l)}catch{u=l}if(!s.ok)throw A(n,s.status,f(u,r));return u}catch(s){throw s instanceof Error&&s.name==="AbortError"?new a("cloud_api_timeout",`Cloud upload timed out after ${(i.timeoutMs??12e4)/1e3} seconds.`):s}finally{clearTimeout(d)}}async identity(){let n=await this.request("/test-auth");return{userId:n.user_id,email:n.email,organizations:n.profiles.map(e=>({id:e.id,name:e.profile_name,slug:e.slug,role:e.role})),defaultOrganizationId:n.default_profile_id}}async setDefaultOrganization(n){await this.request(`/organizations/${n}/set-default`,{method:"POST"})}};async function U(t){let n=await I(),e=await(await c.create()).identity(),i=t!==void 0?k(e.organizations,t):e.organizations.find(r=>r.id===(n.orgId??e.defaultOrganizationId));if(i===void 0)throw new a("organization_required","No active organization. Run `mcp-use org use <id-or-slug>`.");return{api:await c.create(i.id),organizationId:i.id}}function P(t){if(typeof t=="string"&&t!=="")return t;if(!(t===null||typeof t!="object"))for(let n of["message","error","detail"]){let e=t[n];if(typeof e=="string"&&e!=="")return e}}function A(t,n,e){let i=P(e)??`Cloud API request failed (${n}).`,r={status:n,...z(e)!==void 0?{validation:z(e)}:{}};if(n===401)return new a("not_authenticated",i,r);if(n===403)return new a("forbidden",i,r);if(n===404&&/^\/servers(?:\/|$)/.test(t))return new a("server_not_found",i,r);if(n===404&&/^\/deployments(?:\/|$)/.test(t))return new a("deployment_not_found",i,r);let o=t.match(/^\/deployments\/([^/]+)\/stop$/);if(o!==null){let d=decodeURIComponent(o[1]??"");return new a("deployment_stop_failed",i,{...r,nextSteps:[{description:"Inspect the deployment state",command:`mcp-use deployments get ${d} --json`},{description:"Delete the deployment instead",command:`mcp-use deployments delete ${d} --yes --json`}]})}return n===400||n===422?new a("validation_error",i,r):new a("cloud_api_error",i,r)}function z(t){if(t===null||typeof t!="object")return;let n=t.details;if(!(n===null||typeof n!="object"&&!Array.isArray(n)))return n}function b(t,n){let e=new Set([t]),i=new Headers(n.headers);for(let r of["authorization","x-api-key"]){let o=i.get(r);o!==null&&e.add(o)}if(typeof n.body=="string")try{p(JSON.parse(n.body),e)}catch{}return e}function v(t,n){let e=new Set([t]);for(let[i,r]of n.entries())if(typeof r=="string")if(/^(?:env|environment|environmentVariables)$/i.test(i))try{m(JSON.parse(r),e)}catch{e.add(r)}else S(i)&&e.add(r);return e}function p(t,n,e=!1){if(typeof t=="string"){e&&n.add(t);return}if(Array.isArray(t)){for(let i of t)p(i,n,e);return}if(!(t===null||typeof t!="object"))for(let[i,r]of Object.entries(t)){let o=e||S(i)||/^(?:env|environment|environmentVariables)$/i.test(i);p(r,n,o)}}function m(t,n){if(typeof t=="string")n.add(t);else if(Array.isArray(t))for(let e of t)m(e,n);else if(t!==null&&typeof t=="object")for(let e of Object.values(t))m(e,n)}function S(t){return/(?:authorization|api[-_]?key|password|secret|token|value)/i.test(t)}function f(t,n){if(typeof t=="string"){let e=t;for(let i of n)i!==""&&(e=e.replaceAll(i,"[REDACTED]"));return e}return Array.isArray(t)?t.map(e=>f(e,n)):t===null||typeof t!="object"?t:Object.fromEntries(Object.entries(t).map(([e,i])=>[e,f(i,n)]))}export{j as a,R as b,I as c,T as d,E as e,k as f,c as g,U as h};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{a as c}from"./chunk-S3WHXP7I.js";import{constants as l}from"fs";import{access as m,chmod as d,mkdir as w,readFile as y,rename as x,rm as g,writeFile as $}from"fs/promises";import{homedir as S}from"os";import{basename as b,dirname as k,join as u}from"path";import{createInterface as N}from"readline/promises";var r=class extends Error{exitCode=2},s=class extends Error{code;details;constructor(e,t,o){super(t),this.code=e,this.details=o}},p=class extends s{exitCode=2};function _(n){return n.includes("--json")}function v(n,e,t){e?process.stdout.write(`${JSON.stringify(n)}
|
|
2
|
+
`):t!==void 0?process.stdout.write(`${t}
|
|
3
|
+
`):typeof n=="string"?process.stdout.write(`${n}
|
|
4
|
+
`):process.stdout.write(`${JSON.stringify(n,null,2)}
|
|
5
|
+
`)}function A(n,e){let t=n instanceof r||n instanceof s&&"exitCode"in n&&n.exitCode===2,o=n instanceof s,f=o?n.code:t?"usage_error":"command_failed",i=n instanceof Error?n.message:String(n);if(e)process.stderr.write(`${JSON.stringify({error:{code:f,message:i,...o&&n.details!==void 0?{details:n.details}:{}}})}
|
|
6
|
+
`);else if(process.stderr.write(`${i}
|
|
7
|
+
`),o&&J(n.details))for(let a of n.details.nextSteps)process.stderr.write(`
|
|
8
|
+
${a.description}:
|
|
9
|
+
${a.command}
|
|
10
|
+
`);return t?2:1}function J(n){if(n===null||typeof n!="object")return!1;let e=n.nextSteps;return Array.isArray(e)&&e.every(t=>t!==null&&typeof t=="object"&&typeof t.description=="string"&&typeof t.command=="string")}async function B(n,e){if(e.yes)return!0;if(e.json||!process.stdin.isTTY)throw new r(`${n} Pass --yes to confirm.`);let t=N({input:process.stdin,output:process.stdout});try{return(await t.question(`${n} [y/N] `)).trim().toLowerCase()==="y"}finally{t.close()}}function C(n){c(n)}async function F(n){try{return await m(n,l.F_OK),!0}catch{return!1}}async function L(n,e){try{return JSON.parse(await y(n,"utf8"))}catch(t){if(t.code==="ENOENT")return e;throw new s("invalid_state",`Could not read ${n}.`,{cause:t instanceof Error?t.message:String(t)})}}async function D(n,e){let t=k(n);await w(t,{recursive:!0,mode:448}),await d(t,448);let o=u(t,`.${b(n)}.${process.pid}.${Date.now()}.tmp`);await $(o,`${JSON.stringify(e,null,2)}
|
|
11
|
+
`,{mode:384}),await x(o,n),await d(n,384)}async function I(n){await g(n,{force:!0})}var R=u(S(),".mcp-use");export{r as a,s as b,p as c,_ as d,v as e,A as f,B as g,C as h,F as i,L as j,D as k,I as l,R as m};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a,b as g,d as z,e as f,f as F,g as G,h as K,i as b,j as x,k as P,m as _}from"./chunk-
|
|
1
|
+
import{a,b as g,d as z,e as f,f as F,g as G,h as K,i as b,j as x,k as P,m as _}from"./chunk-Q6AC7LJS.js";import{createHash as ke}from"crypto";import{rm as ee}from"fs/promises";import{join as A}from"path";import{createInterface as Oe}from"readline/promises";import{parseArgs as E}from"util";var d=["-h, --help","Show this help"],h=["--json","Emit machine-readable JSON (accepted anywhere after client)"],S=new Map;function m(e,t){S.set(e,t)}m("",{usage:"mcp-use client <command>",summary:"Connect to and invoke saved HTTP(S) MCP servers.",commands:[["connect <name> <url>","Connect and save a server"],["list","List saved servers"],["remove <name>","Remove a saved server"],["<name>","Invoke a saved server"]],options:[d]});m("connect",{usage:"mcp-use client connect <name> <url> [options]",summary:"Connect to and save an HTTP(S) MCP server.",options:[['-H, --header <"Key: Value">',"Static header (repeatable)"],["--no-oauth","Skip OAuth on authorization challenges"],["--auth-timeout <ms>","OAuth wait timeout (default: 300000)"],["--protocol <auto|legacy|modern>","Protocol mode (default: auto; modern is stateless/sessionless)"],["--no-open","Print the OAuth URL without opening a browser"],h,d],notes:["JSON mode never opens a browser or prints an OAuth URL/state. If new consent is required, it returns oauth_interaction_required with an interactive retry command."]});m("list",{usage:"mcp-use client list [options]",summary:"List saved MCP servers.",options:[h,d]});m("remove",{usage:"mcp-use client remove <name> [options]",summary:"Immediately remove a saved server and its credentials.",options:[h,d]});m("<name>",{usage:"mcp-use client <name> <command>",summary:"Invoke a saved MCP server.",commands:[["tools","List, describe, or call tools"],["resources","List or read resources"],["prompts","List or get prompts"],["auth","Inspect or clear saved OAuth state"]],options:[d]});m("<name> tools",{usage:"mcp-use client <name> tools <command>",summary:"Use tools on a saved MCP server.",commands:[["list","List tools"],["describe <tool>","Show a tool definition"],["call <tool> [args...]","Call a tool"]],options:[d]});m("<name> tools list",{usage:"mcp-use client <name> tools list [options]",summary:"List tools on a saved MCP server.",options:[h,d]});m("<name> tools describe",{usage:"mcp-use client <name> tools describe <tool> [options]",summary:"Show one tool definition.",options:[h,d]});m("<name> tools call",{usage:"mcp-use client <name> tools call <tool> [args...] [options]",summary:"Call a tool on a saved MCP server.",options:[["--timeout <ms>","Call timeout (default: 30000)"],h,d],notes:["Arguments are one JSON object or key=value/key:=<json> pairs; do not mix forms."]});m("<name> resources",{usage:"mcp-use client <name> resources <command>",summary:"Use resources on a saved MCP server.",commands:[["list","List resources"],["read <uri>","Read a resource"]],options:[d]});m("<name> resources list",{usage:"mcp-use client <name> resources list [options]",summary:"List resources on a saved MCP server.",options:[h,d]});m("<name> resources read",{usage:"mcp-use client <name> resources read <uri> [options]",summary:"Read one resource.",options:[h,d]});m("<name> prompts",{usage:"mcp-use client <name> prompts <command>",summary:"Use prompts on a saved MCP server.",commands:[["list","List prompts"],["get <prompt> [args...]","Get a prompt"]],options:[d]});m("<name> prompts list",{usage:"mcp-use client <name> prompts list [options]",summary:"List prompts on a saved MCP server.",options:[h,d]});m("<name> prompts get",{usage:"mcp-use client <name> prompts get <prompt> [args...] [options]",summary:"Get a prompt from a saved MCP server.",options:[h,d],notes:["Arguments are one JSON object or key=value/key:=<json> pairs; do not mix forms."]});m("<name> auth",{usage:"mcp-use client <name> auth <command>",summary:"Manage saved OAuth state.",commands:[["status","Show OAuth status"],["logout","Delete saved OAuth credentials"]],options:[d]});m("<name> auth status",{usage:"mcp-use client <name> auth status [options]",summary:"Show saved OAuth status.",options:[h,d]});m("<name> auth logout",{usage:"mcp-use client <name> auth logout [options]",summary:"Delete saved OAuth credentials but keep the server.",options:[["--yes","Skip the confirmation prompt"],h,d]});function V(e){let t=e.filter(u=>u!=="--help"&&u!=="-h"&&u!=="--json"),n=t[0];if(n===void 0)return{text:k(S.get(""))};if(n==="connect"||n==="list"||n==="remove")return{text:k(S.get(n))};let o=t[1];if(o===void 0)return{text:k(S.get("<name>"))};if(!["tools","resources","prompts","auth"].includes(o))return{error:`Unknown client command family: ${o}`};let r=t[2],s=`<name> ${o}`;if(r===void 0)return{text:k(S.get(s))};let i=`${s} ${r}`,l=S.get(i);return l===void 0?{error:`Unknown client ${o} command: ${r}`}:{text:k(l)}}function k(e){let t=[`Usage: ${e.usage}`,e.summary];return e.commands!==void 0&&t.push(W("Commands",e.commands)),e.options!==void 0&&t.push(W("Options",e.options)),e.notes!==void 0&&t.push(e.notes.join(`
|
|
2
2
|
`)),t.join(`
|
|
3
3
|
|
|
4
4
|
`)}function W(e,t){let n=Math.max(...t.map(([o])=>o.length));return`${e}:
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{a as f,b as l,d as m}from"./chunk-OMRWADFK.js";import{existsSync as I}from"fs";import{join as h}from"path";import{fileURLToPath as E}from"url";var D=["vite.config.ts","vite.config.js","vite.config.mts","vite.config.cjs"];function C(t){for(let e of D){let i=h(t,e);if(I(i))return i}return!1}function O(){return E(import.meta.resolve("tailwindcss/index.css"))}import{join as s}from"path";var x=".mcp-use",P="manifest.json";function k(t){let e=s(t,x),i=s(e,"build");return{projectRoot:t,workspace:e,build:i,generated:s(e,"generated"),cache:s(e,"cache"),state:s(e,"state"),cloud:s(e,"cloud"),buildManifest:s(i,P),tunnel:s(e,"state","tunnel.json")}}import{existsSync as g,readdirSync as R}from"fs";import{isAbsolute as d,join as y,relative as S,resolve as v,sep as B}from"path";import T from"@vitejs/plugin-react";var A="views",a="virtual:mcp-use/views/",c=`\0${a}`;function w(t,e){let i=e??A;return d(i)?i:v(t,i)}function K(t,e){let i=w(t,e);if(!g(i))return[];let n=[];for(let r of R(i,{withFileTypes:!0})){if(!r.isDirectory())continue;let o=y(i,r.name,"view.tsx");g(o)&&n.push({name:r.name,entryPath:o})}return n.sort((r,o)=>r.name.localeCompare(o.name)),n}function Z(t){return`${a}${t}`}function M(t){return`/@id/__x00__${a}${t}`}function q(t,e,i){let n=w(e,i),r=S(n,v(t));return r===""||!r.startsWith("..")&&!d(r)}function H(t){let e={};for(let i of t)e[i.name]={kind:"external",entry:M(i.name),css:[],scripts:["/@vite/client"]};return e}async function Q(t,e,i){let{createServer:n}=await import("vite");return n({root:t,configFile:i,envDir:!1,logLevel:"warn",cacheDir:e,resolve:{tsconfigPaths:!0,alias:f(t)},oxc:{jsx:{runtime:"automatic"}},plugins:[m(t),T()],server:{middlewareMode:!0,hmr:!1,ws:!1},ssr:{...l(t)}})}var u="virtual:mcp-use/tailwind.css",V=`\0${u}`,p="virtual:mcp-use/csp-runtime",_=`\0${p}`,b=["react","react-dom"],U={exclude:["mcp-use/react"],include:["react","react-dom","react-dom/client"]};function te(t){return{name:"mcp-use-views",config(){return{resolve:{dedupe:b},optimizeDeps:U}},applyToEnvironment(e){return e.name==="client"},resolveId(e){if(e===p)return _;if(e===u)return V;if(e.startsWith(a))return`\0${e}`},load(e){if(e===_)return["globalThis.__zod_globalConfig ??= {};","globalThis.__zod_globalConfig.jitless = true;",""].join(`
|
|
2
|
+
`);if(e===V)return['@import "tailwindcss";',"@custom-variant dark (&:where(.dark, .dark *, [data-theme=dark], [data-theme=dark] *));"].join(`
|
|
3
|
+
`);if(!e.startsWith(c))return;let i=e.slice(c.length),n=t.getViews().find(o=>o.name===i);if(n===void 0)return;let r=[];return r.push(`import ${JSON.stringify(p)};`),t.dev?.reactRefresh===!0&&r.push('import "@vitejs/plugin-react/preamble";'),r.push(`import ${JSON.stringify(u)};`),r.push('import { bootstrapView } from "mcp-use/react";',`import * as viewModule from ${JSON.stringify(n.entryPath)};`,"bootstrapView(viewModule);"),t.dev!==void 0&&r.push("if (import.meta.hot) {"," import.meta.hot.accept();","}"),r.push(""),r.join(`
|
|
4
|
+
`)}}}export{C as a,O as b,k as c,w as d,K as e,Z as f,q as g,H as h,Q as i,b as j,U as k,te as l};
|
package/dist/commands/build.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as L,b as U,c as O,d as R,e as j,f as I,i as A,l as T}from"../chunk-
|
|
1
|
+
import{a as L,b as U,c as O,d as R,e as j,f as I,i as A,l as T}from"../chunk-TSMDTAVA.js";import{a as P,b as S,c as N,d as _}from"../chunk-OMRWADFK.js";import{a as D,b as C}from"../chunk-LUVZUL5C.js";import"../chunk-WOT6VMZA.js";import{randomBytes as z}from"crypto";import{existsSync as q}from"fs";import{cp as te,mkdir as M,rm as ne,writeFile as V}from"fs/promises";import{join as m,relative as y,resolve as se}from"path";import ae from"@tailwindcss/vite";import oe from"@vitejs/plugin-react";import{build as x}from"vite";import{createServerModuleRunner as k}from"vite";var ee="/mcp",F="http://localhost:3000";async function re(e,r){let n=k(e,{hmr:!1,sourcemapInterceptor:"node"}),i=process.env.MCP_URL;try{i===void 0&&(process.env.MCP_URL=F);let t=(await n.import(r)).default;if(t===null||typeof t!="object")throw new Error("The server entry must default-export the MCPServer instance.");return t.basePath??ee}finally{i===void 0?delete process.env.MCP_URL:process.env.MCP_URL=i,await n.close()}}async function J(e,r){return re(e,r)}async function B(e,r,n){let i=k(e,{hmr:!1,sourcemapInterceptor:"node"}),s=process.env.MCP_URL;try{s===void 0&&(process.env.MCP_URL=F);let c=(await i.import(r)).default;if(c===null||typeof c!="object")throw new Error("The server entry must default-export the MCPServer instance.");if(typeof c.__primeViews!="function")throw new Error("The entry's default export does not support __primeViews.");c.__primeViews(n),c.__mount()}finally{s===void 0?delete process.env.MCP_URL:process.env.MCP_URL=s,await i.close()}}function W(e){return e.replace(/\/+$/,"")}function ie(e,r){let n=r.replace(/^\/+/,"");return e==="/"?`/${n}`:`${e}/${n}`}function E(e,r){return`${ie(e,`_mcp-use/views/${r}`)}/`}var w="index.js",ce="entry-wrapper.ts",ue=100*1024*1024;async function Y(e,r){let n=m(e,"public");q(n)&&await te(n,r,{recursive:!0})}async function H(e,r,n){let i=m(e,ce);await M(e,{recursive:!0});let s=JSON.stringify(n);return await V(i,[`import server from ${JSON.stringify(r)};`,'import { registerViews } from "mcp-use";',`server[registerViews](${s});`,"export default server;",""].join(`
|
|
2
2
|
`)),i}function le(){let e=process.env.MCP_ASSETS_URL;if(!(e===void 0||e.trim()===""))try{return W(new URL(e).href.replace(/\/$/,""))}catch{return}}function $(e,r,n,i){let s=e.replace(/^\/+/,"");return`${n}${E(i,r)}${s}`}function de(e,r,n,i){return e.kind!=="external"?e:{...e,entry:$(e.entry,r,n,i),css:e.css.map(s=>$(s,r,n,i)),...e.scripts!==void 0&&{scripts:e.scripts.map(s=>$(s,r,n,i))}}}async function fe(e,r){let n=m(r.viewsOutDir,e.name),i=await x({root:r.cwd,configFile:r.userViteConfig,envDir:!1,publicDir:!1,logLevel:"warn",cacheDir:r.cacheDir,resolve:{tsconfigPaths:!0,alias:{tailwindcss:U()}},oxc:{jsx:{runtime:"automatic"}},plugins:[ae(),oe(),T({getViews:()=>[e]})],build:{outDir:n,emptyOutDir:!0,write:!r.inline,target:"es2022",sourcemap:r.inline?!1:r.sourceMaps,minify:!0,cssCodeSplit:!1,chunkSizeWarningLimit:1e3,assetsInlineLimit:ue,rollupOptions:{input:{[e.name]:I(e.name)},output:{format:"es",codeSplitting:!r.inline,entryFileNames:"assets/[name]-[hash].js",chunkFileNames:"assets/[name]-[hash].js",assetFileNames:"assets/[name]-[hash][extname]"}}},base:"./"}),s=Array.isArray(i)?i[0]:i;if(s===void 0||!("output"in s))throw new Error(`Client build for view "${e.name}" produced no output.`);let t=s.output,c=Array.isArray(t)?t:Object.values(t),l,p,d,f=[];for(let o of c){if(typeof o!="object"||o===null||!("fileName"in o)||typeof o.fileName!="string")continue;let a=o;a.type==="chunk"&&a.isEntry===!0?(l=a.fileName,d=a.code):a.type==="asset"&&a.fileName.endsWith(".css")&&(p=a.fileName,typeof a.source=="string"?f.push(a.source):a.source instanceof Uint8Array&&f.push(new TextDecoder().decode(a.source)))}if(l===void 0)throw new Error(`Client build produced no entry chunk for view "${e.name}".`);if(r.inline){if(d===void 0)throw new Error(`Client build produced no entry source for view "${e.name}".`);return{kind:"inline",js:d,css:f.join(`
|
|
3
3
|
`)}}return{kind:"external",entry:l.replace(/^\/+/,""),css:p!==void 0?[p.replace(/^\/+/,"")]:[]}}async function me(e){let r=performance.now();N(e.cwd,"production");let n=e.mcpDir===void 0?e.cwd:se(e.cwd,e.mcpDir),i=e.entry===void 0?D(n):D(e.cwd,e.entry),s=await C(e.cwd,i);(s==="created"||s==="updated")&&console.log(`[mcp-use] ${s} mcp-env.d.ts`);let t=O(e.cwd),c=e.viewsDir??(e.mcpDir===void 0?void 0:m(e.mcpDir,"views"));q(R(e.cwd,c))||console.log("[mcp-use] views directory not configured.");let l=j(e.cwd,c),p=L(e.cwd),d=e.sourceMaps===!0,f=e.inline===!0,o;if(l.length===0){o??=await A(e.cwd,t.cache,!1);try{await B(o.environments.ssr,i,{});let Z=await H(t.cache,i,{});await x({root:e.cwd,configFile:!1,envDir:!1,publicDir:!1,logLevel:"warn",cacheDir:t.cache,resolve:{tsconfigPaths:!0,alias:P(e.cwd)},plugins:[_(e.cwd)],build:{ssr:Z,outDir:t.build,emptyOutDir:!0,target:"node22",sourcemap:d,minify:!1,rollupOptions:{output:{format:"es",entryFileNames:w}}},ssr:{...S(e.cwd),target:"node"}})}finally{await o?.close()}await Y(e.cwd,m(t.build,"views/public"));let u={buildId:z(8).toString("hex"),entryPoint:w,createdAt:new Date().toISOString(),views:{}};await M(t.build,{recursive:!0}),await V(t.buildManifest,`${JSON.stringify(u,null,2)}
|
|
4
4
|
`);let g=Math.round(performance.now()-r);console.log(`[mcp-use] built ${y(e.cwd,i)} \u2192 ${y(e.cwd,t.build)}/${w} (${g}ms)`);return}await ne(t.build,{recursive:!0,force:!0});let v=m(t.build,"views");await M(v,{recursive:!0}),o??=await A(e.cwd,t.cache,!1);let a,h={},b=le();try{a=await J(o.environments.ssr,i);for(let u of l){let g=await fe(u,{cwd:e.cwd,cacheDir:t.cache,viewsOutDir:v,userViteConfig:p,sourceMaps:d,inline:f});b!==void 0&&!f&&(g=de(g,u.name,b,a)),h[u.name]=g}if(b!==void 0&&!f){let u=`${b}${E(a,"<view-name>")}`;console.log(`[mcp-use] MCP_ASSETS_URL set \u2014 publish ${y(e.cwd,v)}/ at ${u}`),a!=="/mcp"&&console.log(`[mcp-use] CDN manifest uses basePath ${a} from server entry`)}await Y(e.cwd,m(v,"public")),await B(o.environments.ssr,i,h)}finally{await o.close()}let G=await H(t.cache,i,h);await x({root:e.cwd,configFile:!1,envDir:!1,publicDir:!1,logLevel:"warn",cacheDir:t.cache,resolve:{tsconfigPaths:!0,alias:P(e.cwd)},oxc:{jsx:{runtime:"automatic"}},plugins:[_(e.cwd)],build:{ssr:G,outDir:t.build,emptyOutDir:!1,target:"node22",sourcemap:d,minify:!1,rollupOptions:{output:{format:"es",entryFileNames:w}}},ssr:{...S(e.cwd),target:"node"}});let K={buildId:z(8).toString("hex"),entryPoint:w,createdAt:new Date().toISOString(),views:h};await M(t.build,{recursive:!0}),await V(t.buildManifest,`${JSON.stringify(K,null,2)}
|
package/dist/commands/client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d}from"../chunk-
|
|
1
|
+
import{a,b,c,d}from"../chunk-SVICUITV.js";import"../chunk-Q6AC7LJS.js";import"../chunk-S3WHXP7I.js";import"../chunk-WOT6VMZA.js";export{c as openDirectConnection,b as openSavedConnection,d as parseMcpArguments,a as runClient};
|
package/dist/commands/deploy.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as N,h as K}from"../chunk-
|
|
1
|
+
import{a as N,h as K}from"../chunk-2E4ZVDXN.js";import{a as h,b as p,c as v,d as M,e as J,f as F,g as V,h as Y,i as E,j as W,k as U}from"../chunk-Q6AC7LJS.js";import"../chunk-S3WHXP7I.js";import"../chunk-WOT6VMZA.js";import{execFile as Se}from"child_process";import{createReadStream as Ce}from"fs";import{appendFile as re,lstat as Ie,opendir as je,readFile as T,writeFile as $e}from"fs/promises";import{basename as se,isAbsolute as Z,join as k,relative as _e,resolve as ae}from"path";import{createInterface as ce}from"readline/promises";import{parseArgs as Re,promisify as Ge}from"util";import{createGzip as Ee}from"zlib";var de=Ge(Se),X=80*1024*1024,Ae=new Set([".git","node_modules","dist","build",".next",".turbo",".vercel",".cache",".parcel-cache",".pytest_cache",".ruff_cache",".mypy_cache","__pycache__",".venv","venv","coverage",".nyc_output",".output","out","target",".mcp-use"]),De=`Deploy an MCP server to Manufact Cloud.
|
|
2
2
|
|
|
3
3
|
Usage:
|
|
4
4
|
mcp-use deploy [path] [options]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h as m}from"../chunk-
|
|
1
|
+
import{h as m}from"../chunk-2E4ZVDXN.js";import{a as u,d as h,e as a,f as w,g as b}from"../chunk-Q6AC7LJS.js";import"../chunk-S3WHXP7I.js";import"../chunk-WOT6VMZA.js";import{parseArgs as E}from"util";var A=`Usage: mcp-use deployments <command> [options]
|
|
2
2
|
|
|
3
3
|
Manage cloud deployments and logs.
|
|
4
4
|
|