@mcp-use/cli 1.0.11 → 1.0.14

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 (2) hide show
  1. package/dist/cli.js +100 -58
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -225853,11 +225853,11 @@ var require_react_jsx_runtime_development = __commonJS({
225853
225853
  return jsxWithValidation(type, props, key, false);
225854
225854
  }
225855
225855
  }
225856
- var jsx10 = jsxWithValidationDynamic;
225857
- var jsxs7 = jsxWithValidationStatic;
225856
+ var jsx11 = jsxWithValidationDynamic;
225857
+ var jsxs8 = jsxWithValidationStatic;
225858
225858
  exports2.Fragment = REACT_FRAGMENT_TYPE;
225859
- exports2.jsx = jsx10;
225860
- exports2.jsxs = jsxs7;
225859
+ exports2.jsx = jsx11;
225860
+ exports2.jsxs = jsxs8;
225861
225861
  })();
225862
225862
  }
225863
225863
  }
@@ -279681,7 +279681,7 @@ var MCPConfigService = class {
279681
279681
  success: false,
279682
279682
  message: `Server(s) already exist: ${conflicts.join(
279683
279683
  ", "
279684
- )}. Please use different names.`
279684
+ )}. Please use different names. If you want to connect to it, use /server connect <name>.`
279685
279685
  };
279686
279686
  }
279687
279687
  for (const [name, serverConfig] of Object.entries(servers)) {
@@ -279703,7 +279703,10 @@ var MCPConfigService = class {
279703
279703
  success: true,
279704
279704
  message: `Configured ${serverNames.length} server(s)!
279705
279705
 
279706
- ${serverList}`,
279706
+ ${serverList}
279707
+
279708
+
279709
+ Use /server connect <name> to connect to it.`,
279707
279710
  data: {
279708
279711
  serversAdded: true,
279709
279712
  serverNames
@@ -280909,6 +280912,13 @@ Connected servers: ${connectedServers.join(
280909
280912
  };
280910
280913
  }
280911
280914
  }
280915
+ /**
280916
+ * Returns the command registry.
280917
+ * @returns The map of registered commands
280918
+ */
280919
+ getCommandRegistry() {
280920
+ return this.commandRegistry;
280921
+ }
280912
280922
  };
280913
280923
  var cliService = new CLIService();
280914
280924
 
@@ -283098,8 +283108,29 @@ var Footer = ({
283098
283108
  );
283099
283109
  };
283100
283110
 
283101
- // source/app.tsx
283111
+ // source/components/CommandSuggestions.tsx
283102
283112
  var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
283113
+ function CommandSuggestions({
283114
+ suggestions,
283115
+ query
283116
+ }) {
283117
+ const filteredSuggestions = suggestions.filter(
283118
+ ([command]) => command.startsWith(query)
283119
+ );
283120
+ if (filteredSuggestions.length === 0) {
283121
+ return null;
283122
+ }
283123
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Box_default, { flexDirection: "column", marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Box_default, { borderStyle: "round", paddingX: 1, flexDirection: "column", children: [
283124
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { bold: true, children: "COMMANDS" }),
283125
+ filteredSuggestions.map(([command, { description }]) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Box_default, { flexDirection: "row", children: [
283126
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Box_default, { width: 20, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { children: command }) }),
283127
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { children: description })
283128
+ ] }, command))
283129
+ ] }) });
283130
+ }
283131
+
283132
+ // source/app.tsx
283133
+ var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
283103
283134
  function App2() {
283104
283135
  const [messages2, setMessages] = (0, import_react26.useState)([]);
283105
283136
  const [input, setInput] = (0, import_react26.useState)("");
@@ -283117,6 +283148,7 @@ function App2() {
283117
283148
  const [inputHistory, setInputHistory] = (0, import_react26.useState)([]);
283118
283149
  const [historyIndex, setHistoryIndex] = (0, import_react26.useState)(-1);
283119
283150
  const [tempInput, setTempInput] = (0, import_react26.useState)("");
283151
+ const [commandSuggestions, setCommandSuggestions] = (0, import_react26.useState)([]);
283120
283152
  const { stdout } = use_stdout_default();
283121
283153
  (0, import_react26.useEffect)(() => {
283122
283154
  const initializeMCP = async () => {
@@ -283130,6 +283162,7 @@ function App2() {
283130
283162
  model,
283131
283163
  connectedServers: servers
283132
283164
  });
283165
+ setCommandSuggestions([...cliService.getCommandRegistry().entries()]);
283133
283166
  setCurrentModel(model);
283134
283167
  setConnectedServers(servers);
283135
283168
  setShowInput(true);
@@ -283466,13 +283499,13 @@ function App2() {
283466
283499
  setIsLoading(false);
283467
283500
  }
283468
283501
  };
283469
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Box_default, { flexDirection: "column", minHeight: stdout.rows || 24, children: [
283470
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Box_default, { flexDirection: "column", flexGrow: 1, paddingX: 1, children: [
283471
- initializationError && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Box_default, { marginBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Text, { color: "red", children: [
283502
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Box_default, { flexDirection: "column", minHeight: stdout.rows || 24, children: [
283503
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Box_default, { flexDirection: "column", flexGrow: 1, paddingX: 1, children: [
283504
+ initializationError && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Box_default, { marginBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Text, { color: "red", children: [
283472
283505
  "\u274C ",
283473
283506
  initializationError
283474
283507
  ] }) }),
283475
- !initializationError && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
283508
+ !initializationError && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
283476
283509
  Box_default,
283477
283510
  {
283478
283511
  marginBottom: 1,
@@ -283481,61 +283514,70 @@ function App2() {
283481
283514
  borderColor: "blue",
283482
283515
  padding: 2,
283483
283516
  children: [
283484
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(AsciiLogo, {}),
283485
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { color: "gray", children: "Welcome to MCP-Use CLI!" }),
283486
- currentModel.includes("No") ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Box_default, { flexDirection: "column", children: [
283487
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { color: "yellow", children: currentModel }),
283488
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { color: "gray", children: "Choose a model to get started - the CLI will help you set up the API key." }),
283489
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { color: "cyan", children: "Try: /model openai gpt-4o-mini" }),
283490
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { color: "gray", children: "Or use /models to see all options, /help for commands." })
283491
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Box_default, { flexDirection: "column", children: [
283492
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { color: "gray", children: "Type your message and press Enter to start chatting." }),
283493
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { color: "gray", children: "Use slash commands like /help, /model, or /status for configuration." })
283517
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(AsciiLogo, {}),
283518
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text, { color: "gray", children: "Welcome to MCP-Use CLI!" }),
283519
+ currentModel.includes("No") ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Box_default, { flexDirection: "column", children: [
283520
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text, { color: "yellow", children: currentModel }),
283521
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text, { color: "gray", children: "Choose a model to get started - the CLI will help you set up the API key." }),
283522
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text, { color: "cyan", children: "Try: /model openai gpt-4o-mini" }),
283523
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text, { color: "gray", children: "Or use /models to see all options, /help for commands." })
283524
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Box_default, { flexDirection: "column", children: [
283525
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text, { color: "gray", children: "Type your message and press Enter to start chatting." }),
283526
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text, { color: "gray", children: "Use slash commands like /help, /model, or /status for configuration." })
283494
283527
  ] }),
283495
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { color: "gray", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(dist_default5, { name: "vice", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { children: "To support us check out https://mcp-use.com \u2764\uFE0F \u2B50" }) }) }) })
283528
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text, { color: "gray", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(dist_default5, { name: "vice", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text, { children: "To support us check out https://mcp-use.com \u2764\uFE0F \u2B50" }) }) }) })
283496
283529
  ]
283497
283530
  }
283498
283531
  ),
283499
- !initializationError && messages2.length === 0 && isLoading && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Box_default, { marginBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { color: "blue", children: "\u{1F504} Initializing MCP service..." }) }),
283500
- messages2.map((message) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(MessageRenderer, { message })),
283501
- isLoading && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Box_default, { marginBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Box_default, { marginRight: 1, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { color: "blue", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Spinner_default, { type: "mcpuse" }) }) }) })
283532
+ !initializationError && messages2.length === 0 && isLoading && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Box_default, { marginBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text, { color: "blue", children: "\u{1F504} Initializing MCP service..." }) }),
283533
+ messages2.map((message) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(MessageRenderer, { message })),
283534
+ isLoading && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Box_default, { marginBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Box_default, { marginRight: 1, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text, { color: "blue", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Spinner_default, { type: "mcpuse" }) }) }) })
283502
283535
  ] }),
283503
- showInput && !initializationError && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Box_default, { flexDirection: "column", marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
283504
- Box_default,
283505
- {
283506
- borderStyle: "round",
283507
- borderColor: isWaitingForApiKey ? "yellow" : isWaitingForServerConfig ? "blue" : "gray",
283508
- minHeight: 3,
283509
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Box_default, { flexDirection: "row", width: "100%", children: [
283510
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Box_default, { marginRight: 1, alignSelf: "flex-start", flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
283511
- Text,
283512
- {
283513
- color: isWaitingForApiKey ? "yellow" : isWaitingForServerConfig ? "blue" : "green",
283514
- bold: true,
283515
- children: isWaitingForApiKey ? "\u{1F511}" : isWaitingForServerConfig ? "\u{1F527}" : "\u276F"
283516
- }
283517
- ) }),
283518
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
283519
- InputPrompt,
283520
- {
283521
- value: input,
283522
- onChange: setInput,
283523
- onSubmit: handleSubmit,
283524
- onHistoryUp: handleHistoryUp,
283525
- onHistoryDown: handleHistoryDown,
283526
- placeholder: isWaitingForApiKey ? `Enter ${pendingProvider.toUpperCase()} API key...` : isWaitingForServerConfig ? "Enter server configuration..." : "Type your message...",
283527
- mask: isWaitingForApiKey ? "*" : void 0
283528
- }
283529
- )
283530
- ] })
283531
- }
283532
- ) }),
283533
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Footer, { servers: connectedServers, modelSlug: currentModel })
283536
+ showInput && !initializationError && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
283537
+ input.startsWith("/") && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
283538
+ CommandSuggestions,
283539
+ {
283540
+ suggestions: commandSuggestions,
283541
+ query: input
283542
+ }
283543
+ ),
283544
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
283545
+ Box_default,
283546
+ {
283547
+ borderStyle: "round",
283548
+ borderColor: isWaitingForApiKey ? "yellow" : isWaitingForServerConfig ? "blue" : "gray",
283549
+ minHeight: 3,
283550
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Box_default, { flexDirection: "row", width: "100%", children: [
283551
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Box_default, { marginRight: 1, alignSelf: "flex-start", flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
283552
+ Text,
283553
+ {
283554
+ color: isWaitingForApiKey ? "yellow" : isWaitingForServerConfig ? "blue" : "green",
283555
+ bold: true,
283556
+ children: isWaitingForApiKey ? "\u{1F511}" : isWaitingForServerConfig ? "\u{1F527}" : "\u276F"
283557
+ }
283558
+ ) }),
283559
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
283560
+ InputPrompt,
283561
+ {
283562
+ value: input,
283563
+ onChange: setInput,
283564
+ onSubmit: handleSubmit,
283565
+ onHistoryUp: handleHistoryUp,
283566
+ onHistoryDown: handleHistoryDown,
283567
+ placeholder: isWaitingForApiKey ? `Enter ${pendingProvider.toUpperCase()} API key...` : isWaitingForServerConfig ? "Enter server configuration..." : "Type your message...",
283568
+ mask: isWaitingForApiKey ? "*" : void 0
283569
+ }
283570
+ )
283571
+ ] })
283572
+ }
283573
+ )
283574
+ ] }),
283575
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Footer, { servers: connectedServers, modelSlug: currentModel })
283534
283576
  ] });
283535
283577
  }
283536
283578
 
283537
283579
  // source/cli.tsx
283538
- var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
283580
+ var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
283539
283581
  meow_default(
283540
283582
  `
283541
283583
  Usage
@@ -283567,7 +283609,7 @@ meow_default(
283567
283609
  }
283568
283610
  }
283569
283611
  );
283570
- render_default(/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(App2, {}));
283612
+ render_default(/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(App2, {}));
283571
283613
  /*! Bundled license information:
283572
283614
 
283573
283615
  react/cjs/react.production.min.js:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcp-use/cli",
3
- "version": "1.0.11",
3
+ "version": "1.0.14",
4
4
  "license": "MIT",
5
5
  "description": "CLI for interacting with Model Context Protocol servers via natural language",
6
6
  "keywords": [