@modelcontextprotocol/inspector 0.1.5 → 0.1.6

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/bin/cli.js +21 -1
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -16,10 +16,30 @@ 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
+ console.log(serverCommand);
38
+
19
39
  const { result } = concurrently(
20
40
  [
21
41
  {
22
- command: `node ${inspectorServerPath}${command ? ` --env ${command}` : ""}${mcpServerArgs.length ? ` --args "${mcpServerArgs.join(" ")}"` : ""}`,
42
+ command: serverCommand,
23
43
  name: "server",
24
44
  },
25
45
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modelcontextprotocol/inspector",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Model Context Protocol inspector",
5
5
  "license": "MIT",
6
6
  "author": "Anthropic, PBC (https://anthropic.com)",