@modelcontextprotocol/inspector 0.1.5 → 0.1.7

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/bin/cli.js CHANGED
@@ -16,14 +16,35 @@ const inspectorClientPath = join(__dirname, "../client/bin/cli.js");
16
16
 
17
17
  console.log("Starting MCP inspector...");
18
18
 
19
+ function escapeArg(arg) {
20
+ if (arg.includes(" ") || arg.includes("'") || arg.includes('"')) {
21
+ return `\\"${arg.replace(/"/g, '\\\\\\"')}\\"`;
22
+ }
23
+ return arg;
24
+ }
25
+
26
+ const serverCommand = [
27
+ `node`,
28
+ inspectorServerPath,
29
+ command ? `--env ${escapeArg(command)}` : "",
30
+ mcpServerArgs.length
31
+ ? `--args="${mcpServerArgs.map(escapeArg).join(" ")}"`
32
+ : "",
33
+ ]
34
+ .filter(Boolean)
35
+ .join(" ");
36
+
37
+ const CLIENT_PORT = process.env.CLIENT_PORT ?? "";
38
+ const SERVER_PORT = process.env.SERVER_PORT ?? "";
39
+
19
40
  const { result } = concurrently(
20
41
  [
21
42
  {
22
- command: `node ${inspectorServerPath}${command ? ` --env ${command}` : ""}${mcpServerArgs.length ? ` --args "${mcpServerArgs.join(" ")}"` : ""}`,
43
+ command: `PORT=${SERVER_PORT} ${serverCommand}`,
23
44
  name: "server",
24
45
  },
25
46
  {
26
- command: `node ${inspectorClientPath}`,
47
+ command: `PORT=${CLIENT_PORT} node ${inspectorClientPath}`,
27
48
  name: "client",
28
49
  },
29
50
  ],
@@ -34,6 +55,10 @@ const { result } = concurrently(
34
55
  },
35
56
  );
36
57
 
58
+ console.log(
59
+ `\nšŸ” MCP Inspector is up and running at http://localhost:${CLIENT_PORT || 5173} šŸš€`,
60
+ );
61
+
37
62
  result.catch((err) => {
38
63
  console.error("An error occurred:", err);
39
64
  process.exit(1);
package/client/bin/cli.js CHANGED
@@ -13,6 +13,4 @@ const server = http.createServer((request, response) => {
13
13
  });
14
14
 
15
15
  const port = process.env.PORT || 5173;
16
- server.listen(port, () => {
17
- console.log(`MCP inspector client running at http://localhost:${port}`);
18
- });
16
+ server.listen(port, () => {});