@mcpjam/inspector 0.2.3 → 0.3.0

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/cli/build/cli.js CHANGED
@@ -6,6 +6,14 @@ import { dirname, resolve } from "path";
6
6
  import { spawnPromise } from "spawn-rx";
7
7
  import { fileURLToPath } from "url";
8
8
  const __dirname = dirname(fileURLToPath(import.meta.url));
9
+ const MCP_BANNER = `
10
+ ███╗ ███╗ ██████╗██████╗ ██╗ █████╗ ███╗ ███╗
11
+ ████╗ ████║██╔════╝██╔══██╗ ██║██╔══██╗████╗ ████║
12
+ ██╔████╔██║██║ ██████╔╝ ██║███████║██╔████╔██║
13
+ ██║╚██╔╝██║██║ ██╔═══╝██ ██║██╔══██║██║╚██╔╝██║
14
+ ██║ ╚═╝ ██║╚██████╗██║ ╚█████╔╝██║ ██║██║ ╚═╝ ██║
15
+ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
16
+ `;
9
17
  function handleError(error) {
10
18
  let message;
11
19
  if (error instanceof Error) {
@@ -17,7 +25,7 @@ function handleError(error) {
17
25
  else {
18
26
  message = "Unknown error";
19
27
  }
20
- console.error(message);
28
+ console.error("\x1b[31m%s\x1b[0m", "❌ Error:", message); // Red color
21
29
  process.exit(1);
22
30
  }
23
31
  function delay(ms) {
@@ -29,12 +37,16 @@ async function runWebClient(args) {
29
37
  const inspectorClientPath = resolve(__dirname, "../../", "client", "bin", "client.js");
30
38
  const CLIENT_PORT = process.env.CLIENT_PORT ?? "6274";
31
39
  const SERVER_PORT = process.env.SERVER_PORT ?? "6277";
32
- console.log("Starting MCP inspector...");
40
+ // Clear console and display banner
41
+ console.clear();
42
+ console.log("\x1b[36m%s\x1b[0m", MCP_BANNER); // Cyan color
43
+ console.log("\x1b[33m%s\x1b[0m", "🚀 Launching MCP Inspector...\n"); // Yellow color
33
44
  const abort = new AbortController();
34
45
  let cancelled = false;
35
46
  process.on("SIGINT", () => {
36
47
  cancelled = true;
37
48
  abort.abort();
49
+ console.log("\n\x1b[31m%s\x1b[0m", "⚠️ Shutting down MCP Inspector..."); // Red color
38
50
  });
39
51
  let server;
40
52
  let serverOk;
@@ -55,9 +67,19 @@ async function runWebClient(args) {
55
67
  // Make sure server started before starting client
56
68
  serverOk = await Promise.race([server, delay(2 * 1000)]);
57
69
  }
58
- catch (error) { }
70
+ catch (error) {
71
+ console.log("\x1b[31m%s\x1b[0m", "❌ Server initialization failed"); // Red color
72
+ }
59
73
  if (serverOk) {
60
74
  try {
75
+ console.log("\x1b[32m%s\x1b[0m", "✅ Server initialized successfully"); // Green color
76
+ console.log("\x1b[36m%s\x1b[0m", `🌐 Opening browser at http://127.0.0.1:${CLIENT_PORT}`);
77
+ if (process.env.MCP_AUTO_OPEN_ENABLED !== "false") {
78
+ // Note: We need to import 'open' if we want to auto-open browser
79
+ // import open from "open";
80
+ // open(`http://127.0.0.1:${CLIENT_PORT}`);
81
+ }
82
+ console.log("\x1b[33m%s\x1b[0m", "🖥️ Starting client interface...");
61
83
  await spawnPromise("node", [inspectorClientPath], {
62
84
  env: { ...process.env, PORT: CLIENT_PORT },
63
85
  signal: abort.signal,
@@ -7,11 +7,25 @@ import { fileURLToPath } from "url";
7
7
 
8
8
  const __dirname = dirname(fileURLToPath(import.meta.url));
9
9
 
10
+ const MCP_BANNER = `
11
+ ███╗ ███╗ ██████╗██████╗ ██╗ █████╗ ███╗ ███╗
12
+ ████╗ ████║██╔════╝██╔══██╗ ██║██╔══██╗████╗ ████║
13
+ ██╔████╔██║██║ ██████╔╝ ██║███████║██╔████╔██║
14
+ ██║╚██╔╝██║██║ ██╔═══╝██ ██║██╔══██║██║╚██╔╝██║
15
+ ██║ ╚═╝ ██║╚██████╗██║ ╚█████╔╝██║ ██║██║ ╚═╝ ██║
16
+ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
17
+ `;
18
+
10
19
  function delay(ms) {
11
20
  return new Promise((resolve) => setTimeout(resolve, ms, true));
12
21
  }
13
22
 
14
23
  async function main() {
24
+ // Clear console and display banner
25
+ console.clear();
26
+ console.log("\x1b[36m%s\x1b[0m", MCP_BANNER); // Cyan color
27
+ console.log("\x1b[33m%s\x1b[0m", "🚀 Launching MCP Inspector...\n"); // Yellow color
28
+
15
29
  // Parse command line arguments
16
30
  const args = process.argv.slice(2);
17
31
  const envVars = {};
@@ -65,14 +79,13 @@ async function main() {
65
79
  const CLIENT_PORT = process.env.CLIENT_PORT ?? "6274";
66
80
  const SERVER_PORT = process.env.SERVER_PORT ?? "6277";
67
81
 
68
- console.log("Starting MCP inspector...");
69
-
70
82
  const abort = new AbortController();
71
83
 
72
84
  let cancelled = false;
73
85
  process.on("SIGINT", () => {
74
86
  cancelled = true;
75
87
  abort.abort();
88
+ console.log("\n\x1b[31m%s\x1b[0m", "⚠️ Shutting down MCP Inspector..."); // Red color
76
89
  });
77
90
  let server, serverOk;
78
91
  try {
@@ -96,13 +109,24 @@ async function main() {
96
109
 
97
110
  // Make sure server started before starting client
98
111
  serverOk = await Promise.race([server, delay(2 * 1000)]);
99
- } catch (error) {}
112
+ } catch (error) {
113
+ console.log("\x1b[31m%s\x1b[0m", "❌ Server initialization failed"); // Red color
114
+ }
100
115
 
101
116
  if (serverOk) {
102
117
  try {
118
+ console.log("\x1b[32m%s\x1b[0m", "✅ Server initialized successfully"); // Green color
119
+ console.log(
120
+ "\x1b[36m%s\x1b[0m",
121
+ `🌐 Opening browser at http://127.0.0.1:${CLIENT_PORT}`,
122
+ );
123
+
103
124
  if (process.env.MCP_AUTO_OPEN_ENABLED !== "false") {
104
125
  open(`http://127.0.0.1:${CLIENT_PORT}`);
105
126
  }
127
+
128
+ console.log("\x1b[33m%s\x1b[0m", "🖥️ Starting client interface...");
129
+
106
130
  await spawnPromise("node", [inspectorClientPath], {
107
131
  env: { ...process.env, PORT: CLIENT_PORT },
108
132
  signal: abort.signal,
@@ -119,6 +143,6 @@ async function main() {
119
143
  main()
120
144
  .then((_) => process.exit(0))
121
145
  .catch((e) => {
122
- console.error(e);
146
+ console.error("\x1b[31m%s\x1b[0m", "❌ Error:", e); // Red color
123
147
  process.exit(1);
124
148
  });
@@ -1,4 +1,4 @@
1
- import { u as useToast, r as reactExports, j as jsxRuntimeExports, S as SESSION_KEYS, I as InspectorOAuthClientProvider, a as auth } from "./index-CHsLKjnG.js";
1
+ import { u as useToast, r as reactExports, j as jsxRuntimeExports, S as SESSION_KEYS, I as InspectorOAuthClientProvider, a as auth } from "./index-CdlQwnmd.js";
2
2
  import { p as parseOAuthCallbackParams, g as generateOAuthErrorDescription } from "./oauthUtils-DTcoXpSP.js";
3
3
  const OAuthCallback = ({ onConnect }) => {
4
4
  const { toast } = useToast();
@@ -1,4 +1,4 @@
1
- import { r as reactExports, S as SESSION_KEYS, j as jsxRuntimeExports } from "./index-CHsLKjnG.js";
1
+ import { r as reactExports, S as SESSION_KEYS, j as jsxRuntimeExports } from "./index-CdlQwnmd.js";
2
2
  import { p as parseOAuthCallbackParams, g as generateOAuthErrorDescription } from "./oauthUtils-DTcoXpSP.js";
3
3
  const OAuthDebugCallback = ({ onConnect }) => {
4
4
  reactExports.useEffect(() => {