@mcpjam/inspector 0.1.5 → 0.2.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/LICENSE +200 -21
- package/README.md +39 -8
- package/client/dist/assets/{OAuthCallback-CHBqWOc7.js → OAuthCallback-Bn78Q1TF.js} +1 -1
- package/client/dist/assets/{OAuthDebugCallback-BuULQ2Jc.js → OAuthDebugCallback-BqpNnC48.js} +1 -1
- package/client/dist/assets/{index-DfXL7p_B.css → index-CGJXsF8q.css} +190 -26
- package/client/dist/assets/{index-DCuo5o9C.js → index-DJQtmX5A.js} +26243 -23903
- package/client/dist/index.html +2 -2
- package/package.json +5 -5
- package/server/build/index.js +42 -11
package/client/dist/index.html
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/mcp_jam.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>MCPJam Inspector</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
9
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-DJQtmX5A.js"></script>
|
|
9
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CGJXsF8q.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
|
12
12
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcpjam/inspector",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "MCPJam inspector",
|
|
5
|
-
"license": "
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
6
|
"author": "MCPJam (https://mcpjam.com)",
|
|
7
7
|
"homepage": "https://mcpjam.com",
|
|
8
8
|
"bugs": "https://github.com/mcpjam/inspector/issues",
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@anthropic-ai/sdk": "^0.52.0",
|
|
44
|
-
"@mcpjam/inspector-cli": "^0.1.
|
|
45
|
-
"@mcpjam/inspector-client": "^0.1.
|
|
46
|
-
"@mcpjam/inspector-server": "^0.1.
|
|
44
|
+
"@mcpjam/inspector-cli": "^0.1.6",
|
|
45
|
+
"@mcpjam/inspector-client": "^0.1.6",
|
|
46
|
+
"@mcpjam/inspector-server": "^0.1.6",
|
|
47
47
|
"@modelcontextprotocol/sdk": "^1.12.0",
|
|
48
48
|
"concurrently": "^9.0.1",
|
|
49
49
|
"dotenv": "^16.5.0",
|
package/server/build/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import cors from "cors";
|
|
3
3
|
import { parseArgs } from "node:util";
|
|
4
4
|
import { parse as shellParseArgs } from "shell-quote";
|
|
5
|
+
import { createServer } from "node:net";
|
|
5
6
|
import { SSEClientTransport, SseError, } from "@modelcontextprotocol/sdk/client/sse.js";
|
|
6
7
|
import { StdioClientTransport, getDefaultEnvironment, } from "@modelcontextprotocol/sdk/client/stdio.js";
|
|
7
8
|
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
|
@@ -284,17 +285,47 @@ app.get("/config", (req, res) => {
|
|
|
284
285
|
res.status(500).json(error);
|
|
285
286
|
}
|
|
286
287
|
});
|
|
288
|
+
// Function to find an available port
|
|
289
|
+
const findAvailablePort = async (startPort) => {
|
|
290
|
+
return new Promise((resolve, reject) => {
|
|
291
|
+
const server = createServer();
|
|
292
|
+
server.listen(startPort, () => {
|
|
293
|
+
const port = server.address()?.port;
|
|
294
|
+
server.close(() => {
|
|
295
|
+
resolve(port);
|
|
296
|
+
});
|
|
297
|
+
});
|
|
298
|
+
server.on('error', (err) => {
|
|
299
|
+
if (err.code === 'EADDRINUSE') {
|
|
300
|
+
// Port is in use, try the next one
|
|
301
|
+
findAvailablePort(startPort + 1).then(resolve).catch(reject);
|
|
302
|
+
}
|
|
303
|
+
else {
|
|
304
|
+
reject(err);
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
});
|
|
308
|
+
};
|
|
287
309
|
const PORT = process.env.PORT || 6277;
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
server.
|
|
293
|
-
|
|
294
|
-
|
|
310
|
+
// Start server with dynamic port finding
|
|
311
|
+
const startServer = async () => {
|
|
312
|
+
try {
|
|
313
|
+
const availablePort = await findAvailablePort(Number(PORT));
|
|
314
|
+
const server = app.listen(availablePort);
|
|
315
|
+
server.on("listening", () => {
|
|
316
|
+
if (availablePort !== Number(PORT)) {
|
|
317
|
+
console.log(`⚠️ Port ${PORT} was in use, using available port ${availablePort} instead`);
|
|
318
|
+
}
|
|
319
|
+
console.log(`⚙️ Proxy server listening on port ${availablePort}`);
|
|
320
|
+
});
|
|
321
|
+
server.on("error", (err) => {
|
|
322
|
+
console.error(`❌ Server error: ${err.message}`);
|
|
323
|
+
process.exit(1);
|
|
324
|
+
});
|
|
295
325
|
}
|
|
296
|
-
|
|
297
|
-
console.error(
|
|
326
|
+
catch (error) {
|
|
327
|
+
console.error(`❌ Failed to start server: ${error}`);
|
|
328
|
+
process.exit(1);
|
|
298
329
|
}
|
|
299
|
-
|
|
300
|
-
|
|
330
|
+
};
|
|
331
|
+
startServer();
|