@modelcontextprotocol/inspector 0.4.1 → 0.5.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 +12 -5
- package/client/bin/cli.js +4 -1
- package/client/dist/assets/{OAuthCallback-DCSQTqKf.js → OAuthCallback-DmuQ-LZN.js} +8 -7
- package/client/dist/assets/{index-eOhPEcGC.css → index-BC_1zPdU.css} +427 -0
- package/client/dist/assets/{index-DVugRvpa.js → index-mKSHihrk.js} +9991 -5960
- package/client/dist/index.html +2 -2
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ The MCP inspector is a developer tool for testing and debugging MCP servers.
|
|
|
11
11
|
To inspect an MCP server implementation, there's no need to clone this repo. Instead, use `npx`. For example, if your server is built at `build/index.js`:
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
npx @modelcontextprotocol/inspector build/index.js
|
|
14
|
+
npx @modelcontextprotocol/inspector node build/index.js
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
You can pass both arguments and environment variables to your MCP server. Arguments are passed directly to your server, while environment variables can be set using the `-e` flag:
|
|
@@ -21,19 +21,19 @@ You can pass both arguments and environment variables to your MCP server. Argume
|
|
|
21
21
|
npx @modelcontextprotocol/inspector build/index.js arg1 arg2
|
|
22
22
|
|
|
23
23
|
# Pass environment variables only
|
|
24
|
-
npx @modelcontextprotocol/inspector -e KEY=value -e KEY2=$VALUE2 build/index.js
|
|
24
|
+
npx @modelcontextprotocol/inspector -e KEY=value -e KEY2=$VALUE2 node build/index.js
|
|
25
25
|
|
|
26
26
|
# Pass both environment variables and arguments
|
|
27
|
-
npx @modelcontextprotocol/inspector -e KEY=value -e KEY2=$VALUE2 build/index.js arg1 arg2
|
|
27
|
+
npx @modelcontextprotocol/inspector -e KEY=value -e KEY2=$VALUE2 node build/index.js arg1 arg2
|
|
28
28
|
|
|
29
29
|
# Use -- to separate inspector flags from server arguments
|
|
30
|
-
npx @modelcontextprotocol/inspector -e KEY=$VALUE -- build/index.js -e server-flag
|
|
30
|
+
npx @modelcontextprotocol/inspector -e KEY=$VALUE -- node build/index.js -e server-flag
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
The inspector runs both a client UI (default port 5173) and an MCP proxy server (default port 3000). Open the client UI in your browser to use the inspector. You can customize the ports if needed:
|
|
34
34
|
|
|
35
35
|
```bash
|
|
36
|
-
CLIENT_PORT=8080 SERVER_PORT=9000 npx @modelcontextprotocol/inspector build/index.js
|
|
36
|
+
CLIENT_PORT=8080 SERVER_PORT=9000 npx @modelcontextprotocol/inspector node build/index.js
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
For more details on ways to use the inspector, see the [Inspector section of the MCP docs site](https://modelcontextprotocol.io/docs/tools/inspector). For help with debugging, see the [Debugging guide](https://modelcontextprotocol.io/docs/tools/debugging).
|
|
@@ -48,6 +48,13 @@ Development mode:
|
|
|
48
48
|
npm run dev
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
+
> **Note for Windows users:**
|
|
52
|
+
> On Windows, use the following command instead:
|
|
53
|
+
>
|
|
54
|
+
> ```bash
|
|
55
|
+
> npm run dev:windows
|
|
56
|
+
> ```
|
|
57
|
+
|
|
51
58
|
Production mode:
|
|
52
59
|
|
|
53
60
|
```bash
|
package/client/bin/cli.js
CHANGED
|
@@ -9,7 +9,10 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
|
9
9
|
const distPath = join(__dirname, "../dist");
|
|
10
10
|
|
|
11
11
|
const server = http.createServer((request, response) => {
|
|
12
|
-
return handler(request, response, {
|
|
12
|
+
return handler(request, response, {
|
|
13
|
+
public: distPath,
|
|
14
|
+
rewrites: [{ source: "/**", destination: "/index.html" }],
|
|
15
|
+
});
|
|
13
16
|
});
|
|
14
17
|
|
|
15
18
|
const port = process.env.PORT || 5173;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as reactExports, j as jsxRuntimeExports, S as SESSION_KEYS,
|
|
1
|
+
import { r as reactExports, j as jsxRuntimeExports, S as SESSION_KEYS, a as auth, b as authProvider } from "./index-mKSHihrk.js";
|
|
2
2
|
const OAuthCallback = () => {
|
|
3
3
|
const hasProcessedRef = reactExports.useRef(false);
|
|
4
4
|
reactExports.useEffect(() => {
|
|
@@ -16,12 +16,13 @@ const OAuthCallback = () => {
|
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
18
|
try {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
const result = await auth(authProvider, {
|
|
20
|
+
serverUrl,
|
|
21
|
+
authorizationCode: code
|
|
22
|
+
});
|
|
23
|
+
if (result !== "AUTHORIZED") {
|
|
24
|
+
throw new Error(
|
|
25
|
+
`Expected to be authorized after providing auth code, got: ${result}`
|
|
25
26
|
);
|
|
26
27
|
}
|
|
27
28
|
window.location.href = `/?serverUrl=${encodeURIComponent(serverUrl)}`;
|