@modelcontextprotocol/inspector 0.15.0 → 0.16.1
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/README.md +9 -3
- package/cli/build/cli.js +5 -32
- package/client/bin/client.js +11 -6
- package/client/bin/start.js +64 -28
- package/client/dist/assets/{OAuthCallback-CaW3Hcqw.js → OAuthCallback-CaDIOg8Q.js} +1 -1
- package/client/dist/assets/{OAuthDebugCallback-DiBt_oxh.js → OAuthDebugCallback-Ccjj44Wa.js} +1 -1
- package/client/dist/assets/{index-C1MLjTGf.css → index-BwWj6LL9.css} +0 -4
- package/client/dist/assets/{index-BNqYF5Na.js → index-CPgI0-gs.js} +442 -169
- package/client/dist/index.html +3 -3
- package/package.json +10 -4
- package/server/build/index.js +8 -12
- package/server/build/mcpProxy.js +4 -3
package/client/dist/index.html
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/mcp.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>MCP 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-CPgI0-gs.js"></script>
|
|
9
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BwWj6LL9.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
|
12
|
-
<div id="root"></div>
|
|
12
|
+
<div id="root" class="w-full"></div>
|
|
13
13
|
</body>
|
|
14
14
|
</html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modelcontextprotocol/inspector",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.1",
|
|
4
4
|
"description": "Model Context Protocol inspector",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Anthropic, PBC (https://anthropic.com)",
|
|
@@ -29,6 +29,9 @@
|
|
|
29
29
|
"clean": "rimraf ./node_modules ./client/node_modules ./cli/node_modules ./build ./client/dist ./server/build ./cli/build ./package-lock.json && npm install",
|
|
30
30
|
"dev": "node client/bin/start.js --dev",
|
|
31
31
|
"dev:windows": "node client/bin/start.js --dev",
|
|
32
|
+
"dev:sdk": "npm run link:sdk && concurrently \"npm run dev\" \"cd sdk && npm run build:esm:w\"",
|
|
33
|
+
"link:sdk": "(test -d sdk || ln -sf ${MCP_SDK:-$PWD/../typescript-sdk} sdk) && (cd sdk && npm link && (test -d node_modules || npm i)) && npm link @modelcontextprotocol/sdk",
|
|
34
|
+
"unlink:sdk": "(cd sdk && npm unlink -g) && rm sdk && npm unlink @modelcontextprotocol/sdk",
|
|
32
35
|
"start": "node client/bin/start.js",
|
|
33
36
|
"start-server": "cd server && npm run start",
|
|
34
37
|
"start-client": "cd client && npm run preview",
|
|
@@ -44,9 +47,9 @@
|
|
|
44
47
|
"check-version": "node scripts/check-version-consistency.js"
|
|
45
48
|
},
|
|
46
49
|
"dependencies": {
|
|
47
|
-
"@modelcontextprotocol/inspector-cli": "^0.
|
|
48
|
-
"@modelcontextprotocol/inspector-client": "^0.
|
|
49
|
-
"@modelcontextprotocol/inspector-server": "^0.
|
|
50
|
+
"@modelcontextprotocol/inspector-cli": "^0.16.1",
|
|
51
|
+
"@modelcontextprotocol/inspector-client": "^0.16.1",
|
|
52
|
+
"@modelcontextprotocol/inspector-server": "^0.16.1",
|
|
50
53
|
"@modelcontextprotocol/sdk": "^1.13.1",
|
|
51
54
|
"concurrently": "^9.0.1",
|
|
52
55
|
"open": "^10.1.0",
|
|
@@ -64,5 +67,8 @@
|
|
|
64
67
|
"prettier": "3.3.3",
|
|
65
68
|
"rimraf": "^6.0.1",
|
|
66
69
|
"typescript": "^5.4.2"
|
|
70
|
+
},
|
|
71
|
+
"engines": {
|
|
72
|
+
"node": ">=22.7.5"
|
|
67
73
|
}
|
|
68
74
|
}
|
package/server/build/index.js
CHANGED
|
@@ -11,6 +11,7 @@ import express from "express";
|
|
|
11
11
|
import { findActualExecutable } from "spawn-rx";
|
|
12
12
|
import mcpProxy from "./mcpProxy.js";
|
|
13
13
|
import { randomUUID, randomBytes, timingSafeEqual } from "node:crypto";
|
|
14
|
+
const DEFAULT_MCP_PROXY_LISTEN_PORT = "6277";
|
|
14
15
|
const SSE_HEADERS_PASSTHROUGH = ["authorization"];
|
|
15
16
|
const STREAMABLE_HTTP_HEADERS_PASSTHROUGH = [
|
|
16
17
|
"authorization",
|
|
@@ -73,11 +74,10 @@ const originValidationMiddleware = (req, res, next) => {
|
|
|
73
74
|
const origin = req.headers.origin;
|
|
74
75
|
// Default origins based on CLIENT_PORT or use environment variable
|
|
75
76
|
const clientPort = process.env.CLIENT_PORT || "6274";
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
const defaultOrigin = `http://localhost:${clientPort}`;
|
|
78
|
+
const allowedOrigins = process.env.ALLOWED_ORIGINS?.split(",") || [
|
|
79
|
+
defaultOrigin,
|
|
79
80
|
];
|
|
80
|
-
const allowedOrigins = process.env.ALLOWED_ORIGINS?.split(",") || defaultOrigins;
|
|
81
81
|
if (origin && !allowedOrigins.includes(origin)) {
|
|
82
82
|
console.error(`Invalid origin: ${origin}`);
|
|
83
83
|
res.status(403).json({
|
|
@@ -405,18 +405,14 @@ app.get("/config", originValidationMiddleware, authMiddleware, (req, res) => {
|
|
|
405
405
|
res.status(500).json(error);
|
|
406
406
|
}
|
|
407
407
|
});
|
|
408
|
-
const PORT = parseInt(process.env.
|
|
409
|
-
const HOST = process.env.HOST || "
|
|
408
|
+
const PORT = parseInt(process.env.SERVER_PORT || DEFAULT_MCP_PROXY_LISTEN_PORT, 10);
|
|
409
|
+
const HOST = process.env.HOST || "localhost";
|
|
410
410
|
const server = app.listen(PORT, HOST);
|
|
411
411
|
server.on("listening", () => {
|
|
412
412
|
console.log(`⚙️ Proxy server listening on ${HOST}:${PORT}`);
|
|
413
413
|
if (!authDisabled) {
|
|
414
|
-
console.log(`🔑 Session token: ${sessionToken}`
|
|
415
|
-
|
|
416
|
-
// Display clickable URL with pre-filled token
|
|
417
|
-
const clientPort = process.env.CLIENT_PORT || "6274";
|
|
418
|
-
const clientUrl = `http://localhost:${clientPort}/?MCP_PROXY_AUTH_TOKEN=${sessionToken}`;
|
|
419
|
-
console.log(`\n🔗 Open inspector with token pre-filled:\n ${clientUrl}\n`);
|
|
414
|
+
console.log(`🔑 Session token: ${sessionToken}\n ` +
|
|
415
|
+
`Use this token to authenticate requests or set DANGEROUSLY_OMIT_AUTH=true to disable auth`);
|
|
420
416
|
}
|
|
421
417
|
else {
|
|
422
418
|
console.log(`⚠️ WARNING: Authentication is disabled. This is not recommended.`);
|
package/server/build/mcpProxy.js
CHANGED
|
@@ -3,11 +3,12 @@ function onClientError(error) {
|
|
|
3
3
|
console.error("Error from inspector client:", error);
|
|
4
4
|
}
|
|
5
5
|
function onServerError(error) {
|
|
6
|
-
if (
|
|
7
|
-
error.message.includes("Error POSTing to endpoint (HTTP 404)")) ||
|
|
8
|
-
(error?.cause && JSON.stringify(error.cause).includes("ECONNREFUSED"))) {
|
|
6
|
+
if (error?.cause && JSON.stringify(error.cause).includes("ECONNREFUSED")) {
|
|
9
7
|
console.error("Connection refused. Is the MCP server running?");
|
|
10
8
|
}
|
|
9
|
+
else if (error.message && error.message.includes("404")) {
|
|
10
|
+
console.error("Error accessing endpoint (HTTP 404)");
|
|
11
|
+
}
|
|
11
12
|
else {
|
|
12
13
|
console.error("Error from MCP server:", error);
|
|
13
14
|
}
|