@mcpjam/inspector 0.2.4 → 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 +25 -3
- package/client/dist/assets/{OAuthCallback-DkLMDxkx.js → OAuthCallback-CdxuZKBm.js} +1 -1
- package/client/dist/assets/{OAuthDebugCallback-DaNmVTKt.js → OAuthDebugCallback-BJaIMNT8.js} +1 -1
- package/client/dist/assets/{index-CLxTHffA.js → index-CdlQwnmd.js} +1281 -536
- package/client/dist/assets/{index-ebsMqCvj.css → index-De3JSks9.css} +136 -2
- package/client/dist/index.html +2 -2
- package/package.json +2 -1
- package/server/build/index.js +63 -40
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
|
|
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,
|
|
@@ -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-
|
|
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();
|
package/client/dist/assets/{OAuthDebugCallback-DaNmVTKt.js → OAuthDebugCallback-BJaIMNT8.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as reactExports, S as SESSION_KEYS, j as jsxRuntimeExports } from "./index-
|
|
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(() => {
|