@modelcontextprotocol/inspector 0.8.1 → 0.8.2
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
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The MCP inspector is a developer tool for testing and debugging MCP servers.
|
|
4
4
|
|
|
5
|
-

|
|
5
|
+

|
|
6
6
|
|
|
7
7
|
## Running the Inspector
|
|
8
8
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as reactExports, j as jsxRuntimeExports, S as SESSION_KEYS, a as auth, b as authProvider } from "./index-
|
|
1
|
+
import { r as reactExports, j as jsxRuntimeExports, S as SESSION_KEYS, a as auth, b as authProvider } from "./index-Bm3GdP0M.js";
|
|
2
2
|
const OAuthCallback = () => {
|
|
3
3
|
const hasProcessedRef = reactExports.useRef(false);
|
|
4
4
|
reactExports.useEffect(() => {
|
|
@@ -15471,6 +15471,10 @@ const ServerCapabilitiesSchema = z.object({
|
|
|
15471
15471
|
* Present if the server supports sending log messages to the client.
|
|
15472
15472
|
*/
|
|
15473
15473
|
logging: z.optional(z.object({}).passthrough()),
|
|
15474
|
+
/**
|
|
15475
|
+
* Present if the server supports sending completions to the client.
|
|
15476
|
+
*/
|
|
15477
|
+
completions: z.optional(z.object({}).passthrough()),
|
|
15474
15478
|
/**
|
|
15475
15479
|
* Present if the server offers any prompt templates.
|
|
15476
15480
|
*/
|
|
@@ -15743,6 +15747,17 @@ const ImageContentSchema = z.object({
|
|
|
15743
15747
|
*/
|
|
15744
15748
|
mimeType: z.string()
|
|
15745
15749
|
}).passthrough();
|
|
15750
|
+
const AudioContentSchema = z.object({
|
|
15751
|
+
type: z.literal("audio"),
|
|
15752
|
+
/**
|
|
15753
|
+
* The base64-encoded audio data.
|
|
15754
|
+
*/
|
|
15755
|
+
data: z.string().base64(),
|
|
15756
|
+
/**
|
|
15757
|
+
* The MIME type of the audio. Different providers may support different audio types.
|
|
15758
|
+
*/
|
|
15759
|
+
mimeType: z.string()
|
|
15760
|
+
}).passthrough();
|
|
15746
15761
|
const EmbeddedResourceSchema = z.object({
|
|
15747
15762
|
type: z.literal("resource"),
|
|
15748
15763
|
resource: z.union([TextResourceContentsSchema, BlobResourceContentsSchema])
|
|
@@ -15752,6 +15767,7 @@ const PromptMessageSchema = z.object({
|
|
|
15752
15767
|
content: z.union([
|
|
15753
15768
|
TextContentSchema,
|
|
15754
15769
|
ImageContentSchema,
|
|
15770
|
+
AudioContentSchema,
|
|
15755
15771
|
EmbeddedResourceSchema
|
|
15756
15772
|
])
|
|
15757
15773
|
}).passthrough();
|
|
@@ -15789,7 +15805,7 @@ const ListToolsResultSchema = PaginatedResultSchema.extend({
|
|
|
15789
15805
|
tools: z.array(ToolSchema)
|
|
15790
15806
|
});
|
|
15791
15807
|
const CallToolResultSchema = ResultSchema.extend({
|
|
15792
|
-
content: z.array(z.union([TextContentSchema, ImageContentSchema, EmbeddedResourceSchema])),
|
|
15808
|
+
content: z.array(z.union([TextContentSchema, ImageContentSchema, AudioContentSchema, EmbeddedResourceSchema])),
|
|
15793
15809
|
isError: z.boolean().default(false).optional()
|
|
15794
15810
|
});
|
|
15795
15811
|
const CompatibilityCallToolResultSchema = CallToolResultSchema.or(ResultSchema.extend({
|
|
@@ -15867,7 +15883,7 @@ const ModelPreferencesSchema = z.object({
|
|
|
15867
15883
|
}).passthrough();
|
|
15868
15884
|
const SamplingMessageSchema = z.object({
|
|
15869
15885
|
role: z.enum(["user", "assistant"]),
|
|
15870
|
-
content: z.union([TextContentSchema, ImageContentSchema])
|
|
15886
|
+
content: z.union([TextContentSchema, ImageContentSchema, AudioContentSchema])
|
|
15871
15887
|
}).passthrough();
|
|
15872
15888
|
const CreateMessageRequestSchema = RequestSchema.extend({
|
|
15873
15889
|
method: z.literal("sampling/createMessage"),
|
|
@@ -15909,7 +15925,8 @@ const CreateMessageResultSchema = ResultSchema.extend({
|
|
|
15909
15925
|
role: z.enum(["user", "assistant"]),
|
|
15910
15926
|
content: z.discriminatedUnion("type", [
|
|
15911
15927
|
TextContentSchema,
|
|
15912
|
-
ImageContentSchema
|
|
15928
|
+
ImageContentSchema,
|
|
15929
|
+
AudioContentSchema
|
|
15913
15930
|
])
|
|
15914
15931
|
});
|
|
15915
15932
|
const ResourceReferenceSchema = z.object({
|
|
@@ -16064,12 +16081,13 @@ class Protocol {
|
|
|
16064
16081
|
(_request) => ({})
|
|
16065
16082
|
);
|
|
16066
16083
|
}
|
|
16067
|
-
_setupTimeout(messageId, timeout, maxTotalTimeout, onTimeout) {
|
|
16084
|
+
_setupTimeout(messageId, timeout, maxTotalTimeout, onTimeout, resetTimeoutOnProgress = false) {
|
|
16068
16085
|
this._timeoutInfo.set(messageId, {
|
|
16069
16086
|
timeoutId: setTimeout(onTimeout, timeout),
|
|
16070
16087
|
startTime: Date.now(),
|
|
16071
16088
|
timeout,
|
|
16072
16089
|
maxTotalTimeout,
|
|
16090
|
+
resetTimeoutOnProgress,
|
|
16073
16091
|
onTimeout
|
|
16074
16092
|
});
|
|
16075
16093
|
}
|
|
@@ -16197,7 +16215,8 @@ class Protocol {
|
|
|
16197
16215
|
return;
|
|
16198
16216
|
}
|
|
16199
16217
|
const responseHandler = this._responseHandlers.get(messageId);
|
|
16200
|
-
|
|
16218
|
+
const timeoutInfo = this._timeoutInfo.get(messageId);
|
|
16219
|
+
if (timeoutInfo && responseHandler && timeoutInfo.resetTimeoutOnProgress) {
|
|
16201
16220
|
try {
|
|
16202
16221
|
this._resetTimeout(messageId);
|
|
16203
16222
|
} catch (error) {
|
|
@@ -16241,7 +16260,7 @@ class Protocol {
|
|
|
16241
16260
|
*/
|
|
16242
16261
|
request(request, resultSchema, options) {
|
|
16243
16262
|
return new Promise((resolve, reject) => {
|
|
16244
|
-
var _a, _b, _c, _d;
|
|
16263
|
+
var _a, _b, _c, _d, _e2;
|
|
16245
16264
|
if (!this._transport) {
|
|
16246
16265
|
reject(new Error("Not connected"));
|
|
16247
16266
|
return;
|
|
@@ -16299,7 +16318,7 @@ class Protocol {
|
|
|
16299
16318
|
});
|
|
16300
16319
|
const timeout = (_d = options === null || options === void 0 ? void 0 : options.timeout) !== null && _d !== void 0 ? _d : DEFAULT_REQUEST_TIMEOUT_MSEC;
|
|
16301
16320
|
const timeoutHandler = () => cancel(new McpError(ErrorCode.RequestTimeout, "Request timed out", { timeout }));
|
|
16302
|
-
this._setupTimeout(messageId, timeout, options === null || options === void 0 ? void 0 : options.maxTotalTimeout, timeoutHandler);
|
|
16321
|
+
this._setupTimeout(messageId, timeout, options === null || options === void 0 ? void 0 : options.maxTotalTimeout, timeoutHandler, (_e2 = options === null || options === void 0 ? void 0 : options.resetTimeoutOnProgress) !== null && _e2 !== void 0 ? _e2 : false);
|
|
16303
16322
|
this._transport.send(jsonrpcRequest).catch((error) => {
|
|
16304
16323
|
this._cleanupTimeout(messageId);
|
|
16305
16324
|
reject(error);
|
|
@@ -16396,7 +16415,7 @@ class Client extends Protocol {
|
|
|
16396
16415
|
throw new Error(`Server does not support ${capability} (required for ${method})`);
|
|
16397
16416
|
}
|
|
16398
16417
|
}
|
|
16399
|
-
async connect(transport) {
|
|
16418
|
+
async connect(transport, options) {
|
|
16400
16419
|
await super.connect(transport);
|
|
16401
16420
|
try {
|
|
16402
16421
|
const result = await this.request({
|
|
@@ -16406,7 +16425,7 @@ class Client extends Protocol {
|
|
|
16406
16425
|
capabilities: this._capabilities,
|
|
16407
16426
|
clientInfo: this._clientInfo
|
|
16408
16427
|
}
|
|
16409
|
-
}, InitializeResultSchema);
|
|
16428
|
+
}, InitializeResultSchema, options);
|
|
16410
16429
|
if (result === void 0) {
|
|
16411
16430
|
throw new Error(`Server sent invalid initialize result: ${result}`);
|
|
16412
16431
|
}
|
|
@@ -16475,8 +16494,8 @@ class Client extends Protocol {
|
|
|
16475
16494
|
}
|
|
16476
16495
|
break;
|
|
16477
16496
|
case "completion/complete":
|
|
16478
|
-
if (!((_e2 = this._serverCapabilities) === null || _e2 === void 0 ? void 0 : _e2.
|
|
16479
|
-
throw new Error(`Server does not support
|
|
16497
|
+
if (!((_e2 = this._serverCapabilities) === null || _e2 === void 0 ? void 0 : _e2.completions)) {
|
|
16498
|
+
throw new Error(`Server does not support completions (required for ${method})`);
|
|
16480
16499
|
}
|
|
16481
16500
|
break;
|
|
16482
16501
|
}
|
|
@@ -16915,24 +16934,24 @@ function getBaseURL() {
|
|
|
16915
16934
|
}
|
|
16916
16935
|
let crypto;
|
|
16917
16936
|
crypto = globalThis.crypto;
|
|
16918
|
-
function getRandomValues(size2) {
|
|
16919
|
-
return crypto.getRandomValues(new Uint8Array(size2));
|
|
16937
|
+
async function getRandomValues(size2) {
|
|
16938
|
+
return (await crypto).getRandomValues(new Uint8Array(size2));
|
|
16920
16939
|
}
|
|
16921
|
-
function random(size2) {
|
|
16940
|
+
async function random(size2) {
|
|
16922
16941
|
const mask = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~";
|
|
16923
16942
|
let result = "";
|
|
16924
|
-
const randomUints = getRandomValues(size2);
|
|
16943
|
+
const randomUints = await getRandomValues(size2);
|
|
16925
16944
|
for (let i = 0; i < size2; i++) {
|
|
16926
16945
|
const randomIndex = randomUints[i] % mask.length;
|
|
16927
16946
|
result += mask[randomIndex];
|
|
16928
16947
|
}
|
|
16929
16948
|
return result;
|
|
16930
16949
|
}
|
|
16931
|
-
function generateVerifier(length) {
|
|
16932
|
-
return random(length);
|
|
16950
|
+
async function generateVerifier(length) {
|
|
16951
|
+
return await random(length);
|
|
16933
16952
|
}
|
|
16934
16953
|
async function generateChallenge(code_verifier) {
|
|
16935
|
-
const buffer = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(code_verifier));
|
|
16954
|
+
const buffer = await (await crypto).subtle.digest("SHA-256", new TextEncoder().encode(code_verifier));
|
|
16936
16955
|
return btoa(String.fromCharCode(...new Uint8Array(buffer))).replace(/\//g, "_").replace(/\+/g, "-").replace(/=/g, "");
|
|
16937
16956
|
}
|
|
16938
16957
|
async function pkceChallenge(length) {
|
|
@@ -16941,7 +16960,7 @@ async function pkceChallenge(length) {
|
|
|
16941
16960
|
if (length < 43 || length > 128) {
|
|
16942
16961
|
throw `Expected a length between 43 and 128. Received ${length}.`;
|
|
16943
16962
|
}
|
|
16944
|
-
const verifier = generateVerifier(length);
|
|
16963
|
+
const verifier = await generateVerifier(length);
|
|
16945
16964
|
const challenge = await generateChallenge(verifier);
|
|
16946
16965
|
return {
|
|
16947
16966
|
code_verifier: verifier,
|
|
@@ -17040,7 +17059,8 @@ async function auth(provider, { serverUrl, authorizationCode }) {
|
|
|
17040
17059
|
metadata,
|
|
17041
17060
|
clientInformation,
|
|
17042
17061
|
authorizationCode,
|
|
17043
|
-
codeVerifier: codeVerifier2
|
|
17062
|
+
codeVerifier: codeVerifier2,
|
|
17063
|
+
redirectUri: provider.redirectUrl
|
|
17044
17064
|
});
|
|
17045
17065
|
await provider.saveTokens(tokens2);
|
|
17046
17066
|
return "AUTHORIZED";
|
|
@@ -17118,7 +17138,7 @@ async function startAuthorization(serverUrl, { metadata, clientInformation, redi
|
|
|
17118
17138
|
authorizationUrl.searchParams.set("redirect_uri", String(redirectUrl));
|
|
17119
17139
|
return { authorizationUrl, codeVerifier };
|
|
17120
17140
|
}
|
|
17121
|
-
async function exchangeAuthorization(serverUrl, { metadata, clientInformation, authorizationCode, codeVerifier }) {
|
|
17141
|
+
async function exchangeAuthorization(serverUrl, { metadata, clientInformation, authorizationCode, codeVerifier, redirectUri }) {
|
|
17122
17142
|
const grantType = "authorization_code";
|
|
17123
17143
|
let tokenUrl;
|
|
17124
17144
|
if (metadata) {
|
|
@@ -17133,7 +17153,8 @@ async function exchangeAuthorization(serverUrl, { metadata, clientInformation, a
|
|
|
17133
17153
|
grant_type: grantType,
|
|
17134
17154
|
client_id: clientInformation.client_id,
|
|
17135
17155
|
code: authorizationCode,
|
|
17136
|
-
code_verifier: codeVerifier
|
|
17156
|
+
code_verifier: codeVerifier,
|
|
17157
|
+
redirect_uri: String(redirectUri)
|
|
17137
17158
|
});
|
|
17138
17159
|
if (clientInformation.client_secret) {
|
|
17139
17160
|
params2.set("client_secret", clientInformation.client_secret);
|
|
@@ -17435,7 +17456,7 @@ class InspectorOAuthClientProvider {
|
|
|
17435
17456
|
}
|
|
17436
17457
|
}
|
|
17437
17458
|
const authProvider = new InspectorOAuthClientProvider();
|
|
17438
|
-
const version$1 = "0.8.
|
|
17459
|
+
const version$1 = "0.8.2";
|
|
17439
17460
|
const packageJson = {
|
|
17440
17461
|
version: version$1
|
|
17441
17462
|
};
|
|
@@ -25126,7 +25147,7 @@ const useTheme = () => {
|
|
|
25126
25147
|
}, []);
|
|
25127
25148
|
return reactExports.useMemo(() => [theme, setThemeWithSideEffect], [theme]);
|
|
25128
25149
|
};
|
|
25129
|
-
const version = "0.8.
|
|
25150
|
+
const version = "0.8.2";
|
|
25130
25151
|
var [createTooltipContext, createTooltipScope] = createContextScope("Tooltip", [
|
|
25131
25152
|
createPopperScope
|
|
25132
25153
|
]);
|
|
@@ -29052,7 +29073,7 @@ const App = () => {
|
|
|
29052
29073
|
};
|
|
29053
29074
|
if (window.location.pathname === "/oauth/callback") {
|
|
29054
29075
|
const OAuthCallback = React$1.lazy(
|
|
29055
|
-
() => __vitePreload(() => import("./OAuthCallback-
|
|
29076
|
+
() => __vitePreload(() => import("./OAuthCallback-CsnPYikN.js"), true ? [] : void 0)
|
|
29056
29077
|
);
|
|
29057
29078
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(OAuthCallback, {}) });
|
|
29058
29079
|
}
|
package/client/dist/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
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-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-Bm3GdP0M.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/index-CRtFq5fi.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modelcontextprotocol/inspector",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"description": "Model Context Protocol inspector",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Anthropic, PBC (https://anthropic.com)",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"publish-all": "npm publish --workspaces --access public && npm publish --access public"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@modelcontextprotocol/inspector-client": "^0.8.
|
|
40
|
-
"@modelcontextprotocol/inspector-server": "^0.8.
|
|
39
|
+
"@modelcontextprotocol/inspector-client": "^0.8.2",
|
|
40
|
+
"@modelcontextprotocol/inspector-server": "^0.8.2",
|
|
41
41
|
"concurrently": "^9.0.1",
|
|
42
42
|
"shell-quote": "^1.8.2",
|
|
43
43
|
"spawn-rx": "^5.1.2",
|