Merge branch 'main' into routing-fragment-cleanup

This commit is contained in:
Ola Hungerford 2025-07-26 10:48:10 -07:00 • committed by GitHub
commit 098a0e5a79
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 45 additions and 26 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "@modelcontextprotocol/inspector-cli", "name": "@modelcontextprotocol/inspector-cli",
"version": "0.16.1", "version": "0.16.2",
"description": "CLI for the Model Context Protocol inspector", "description": "CLI for the Model Context Protocol inspector",
"license": "MIT", "license": "MIT",
"author": "Anthropic, PBC (https://anthropic.com)", "author": "Anthropic, PBC (https://anthropic.com)",
@ -21,7 +21,7 @@
}, },
"devDependencies": {}, "devDependencies": {},
"dependencies": { "dependencies": {
"@modelcontextprotocol/sdk": "^1.13.1", "@modelcontextprotocol/sdk": "^1.17.0",
"commander": "^13.1.0", "commander": "^13.1.0",
"spawn-rx": "^5.1.2" "spawn-rx": "^5.1.2"
} }

View file

@ -1,6 +1,6 @@
{ {
"name": "@modelcontextprotocol/inspector-client", "name": "@modelcontextprotocol/inspector-client",
"version": "0.16.1", "version": "0.16.2",
"description": "Client-side application for the Model Context Protocol inspector", "description": "Client-side application for the Model Context Protocol inspector",
"license": "MIT", "license": "MIT",
"author": "Anthropic, PBC (https://anthropic.com)", "author": "Anthropic, PBC (https://anthropic.com)",
@ -25,7 +25,7 @@
"cleanup:e2e": "node e2e/global-teardown.js" "cleanup:e2e": "node e2e/global-teardown.js"
}, },
"dependencies": { "dependencies": {
"@modelcontextprotocol/sdk": "^1.14.0", "@modelcontextprotocol/sdk": "^1.17.0",
"@radix-ui/react-checkbox": "^1.1.4", "@radix-ui/react-checkbox": "^1.1.4",
"@radix-ui/react-dialog": "^1.1.3", "@radix-ui/react-dialog": "^1.1.3",
"@radix-ui/react-icons": "^1.3.0", "@radix-ui/react-icons": "^1.3.0",

View file

@ -48,6 +48,7 @@ const PromptsTab = ({
ref: PromptReference | ResourceReference, ref: PromptReference | ResourceReference,
argName: string, argName: string,
value: string, value: string,
context?: Record<string, string>,
) => Promise<string[]>; ) => Promise<string[]>;
completionsSupported: boolean; completionsSupported: boolean;
promptContent: string; promptContent: string;
@ -73,6 +74,7 @@ const PromptsTab = ({
}, },
argName, argName,
value, value,
promptArgs,
); );
} }
}; };

View file

@ -52,6 +52,7 @@ const ResourcesTab = ({
ref: ResourceReference | PromptReference, ref: ResourceReference | PromptReference,
argName: string, argName: string,
value: string, value: string,
context?: Record<string, string>,
) => Promise<string[]>; ) => Promise<string[]>;
completionsSupported: boolean; completionsSupported: boolean;
resourceContent: string; resourceContent: string;
@ -94,6 +95,7 @@ const ResourcesTab = ({
}, },
key, key,
value, value,
templateValues,
); );
} }
}; };

View file

@ -28,6 +28,7 @@ export function useCompletionState(
ref: ResourceReference | PromptReference, ref: ResourceReference | PromptReference,
argName: string, argName: string,
value: string, value: string,
context?: Record<string, string>,
signal?: AbortSignal, signal?: AbortSignal,
) => Promise<string[]>, ) => Promise<string[]>,
completionsSupported: boolean = true, completionsSupported: boolean = true,
@ -66,6 +67,7 @@ export function useCompletionState(
ref: ResourceReference | PromptReference, ref: ResourceReference | PromptReference,
argName: string, argName: string,
value: string, value: string,
context?: Record<string, string>,
) => { ) => {
if (!completionsSupported) { if (!completionsSupported) {
return; return;
@ -82,10 +84,15 @@ export function useCompletionState(
})); }));
try { try {
if (context !== undefined) {
delete context[argName];
}
const values = await handleCompletion( const values = await handleCompletion(
ref, ref,
argName, argName,
value, value,
context,
abortController.signal, abortController.signal,
); );
@ -97,6 +104,7 @@ export function useCompletionState(
})); }));
} }
} catch { } catch {
console.error("completion failed");
if (!abortController.signal.aborted) { if (!abortController.signal.aborted) {
setState((prev) => ({ setState((prev) => ({
...prev, ...prev,

View file

@ -198,6 +198,7 @@ export function useConnection({
ref: ResourceReference | PromptReference, ref: ResourceReference | PromptReference,
argName: string, argName: string,
value: string, value: string,
context?: Record<string, string>,
signal?: AbortSignal, signal?: AbortSignal,
): Promise<string[]> => { ): Promise<string[]> => {
if (!mcpClient || !completionsSupported) { if (!mcpClient || !completionsSupported) {
@ -215,6 +216,12 @@ export function useConnection({
}, },
}; };
if (context) {
request["params"]["context"] = {
arguments: context,
};
}
try { try {
const response = await makeRequest(request, CompleteResultSchema, { const response = await makeRequest(request, CompleteResultSchema, {
signal, signal,

30
package-lock.json generated
View file

@ -1,12 +1,12 @@
{ {
"name": "@modelcontextprotocol/inspector", "name": "@modelcontextprotocol/inspector",
"version": "0.16.1", "version": "0.16.2",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@modelcontextprotocol/inspector", "name": "@modelcontextprotocol/inspector",
"version": "0.16.1", "version": "0.16.2",
"license": "MIT", "license": "MIT",
"workspaces": [ "workspaces": [
"client", "client",
@ -14,10 +14,10 @@
"cli" "cli"
], ],
"dependencies": { "dependencies": {
"@modelcontextprotocol/inspector-cli": "^0.16.1", "@modelcontextprotocol/inspector-cli": "^0.16.2",
"@modelcontextprotocol/inspector-client": "^0.16.1", "@modelcontextprotocol/inspector-client": "^0.16.2",
"@modelcontextprotocol/inspector-server": "^0.16.1", "@modelcontextprotocol/inspector-server": "^0.16.2",
"@modelcontextprotocol/sdk": "^1.14.0", "@modelcontextprotocol/sdk": "^1.17.0",
"concurrently": "^9.0.1", "concurrently": "^9.0.1",
"open": "^10.1.0", "open": "^10.1.0",
"shell-quote": "^1.8.2", "shell-quote": "^1.8.2",
@ -44,10 +44,10 @@
}, },
"cli": { "cli": {
"name": "@modelcontextprotocol/inspector-cli", "name": "@modelcontextprotocol/inspector-cli",
"version": "0.16.1", "version": "0.16.2",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@modelcontextprotocol/sdk": "^1.13.1", "@modelcontextprotocol/sdk": "^1.17.0",
"commander": "^13.1.0", "commander": "^13.1.0",
"spawn-rx": "^5.1.2" "spawn-rx": "^5.1.2"
}, },
@ -67,10 +67,10 @@
}, },
"client": { "client": {
"name": "@modelcontextprotocol/inspector-client", "name": "@modelcontextprotocol/inspector-client",
"version": "0.16.1", "version": "0.16.2",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@modelcontextprotocol/sdk": "^1.14.0", "@modelcontextprotocol/sdk": "^1.17.0",
"@radix-ui/react-checkbox": "^1.1.4", "@radix-ui/react-checkbox": "^1.1.4",
"@radix-ui/react-dialog": "^1.1.3", "@radix-ui/react-dialog": "^1.1.3",
"@radix-ui/react-icons": "^1.3.0", "@radix-ui/react-icons": "^1.3.0",
@ -2009,9 +2009,9 @@
"link": true "link": true
}, },
"node_modules/@modelcontextprotocol/sdk": { "node_modules/@modelcontextprotocol/sdk": {
"version": "1.15.0", "version": "1.17.0",
"resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.15.0.tgz", "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.17.0.tgz",
"integrity": "sha512-67hnl/ROKdb03Vuu0YOr+baKTvf1/5YBHBm9KnZdjdAh8hjt4FRCPD5ucwxGB237sBpzlqQsLy1PFu7z/ekZ9Q==", "integrity": "sha512-qFfbWFA7r1Sd8D697L7GkTd36yqDuTkvz0KfOGkgXR8EUhQn3/EDNIR/qUdQNMT8IjmasBvHWuXeisxtXTQT2g==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"ajv": "^6.12.6", "ajv": "^6.12.6",
@ -10989,10 +10989,10 @@
}, },
"server": { "server": {
"name": "@modelcontextprotocol/inspector-server", "name": "@modelcontextprotocol/inspector-server",
"version": "0.16.1", "version": "0.16.2",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@modelcontextprotocol/sdk": "^1.13.1", "@modelcontextprotocol/sdk": "^1.17.0",
"cors": "^2.8.5", "cors": "^2.8.5",
"express": "^5.1.0", "express": "^5.1.0",
"ws": "^8.18.0", "ws": "^8.18.0",

View file

@ -1,6 +1,6 @@
{ {
"name": "@modelcontextprotocol/inspector", "name": "@modelcontextprotocol/inspector",
"version": "0.16.1", "version": "0.16.2",
"description": "Model Context Protocol inspector", "description": "Model Context Protocol inspector",
"license": "MIT", "license": "MIT",
"author": "Anthropic, PBC (https://anthropic.com)", "author": "Anthropic, PBC (https://anthropic.com)",
@ -47,10 +47,10 @@
"check-version": "node scripts/check-version-consistency.js" "check-version": "node scripts/check-version-consistency.js"
}, },
"dependencies": { "dependencies": {
"@modelcontextprotocol/inspector-cli": "^0.16.1", "@modelcontextprotocol/inspector-cli": "^0.16.2",
"@modelcontextprotocol/inspector-client": "^0.16.1", "@modelcontextprotocol/inspector-client": "^0.16.2",
"@modelcontextprotocol/inspector-server": "^0.16.1", "@modelcontextprotocol/inspector-server": "^0.16.2",
"@modelcontextprotocol/sdk": "^1.14.0", "@modelcontextprotocol/sdk": "^1.17.0",
"concurrently": "^9.0.1", "concurrently": "^9.0.1",
"open": "^10.1.0", "open": "^10.1.0",
"shell-quote": "^1.8.2", "shell-quote": "^1.8.2",

View file

@ -1,6 +1,6 @@
{ {
"name": "@modelcontextprotocol/inspector-server", "name": "@modelcontextprotocol/inspector-server",
"version": "0.16.1", "version": "0.16.2",
"description": "Server-side application for the Model Context Protocol inspector", "description": "Server-side application for the Model Context Protocol inspector",
"license": "MIT", "license": "MIT",
"author": "Anthropic, PBC (https://anthropic.com)", "author": "Anthropic, PBC (https://anthropic.com)",
@ -27,7 +27,7 @@
"typescript": "^5.6.2" "typescript": "^5.6.2"
}, },
"dependencies": { "dependencies": {
"@modelcontextprotocol/sdk": "^1.13.1", "@modelcontextprotocol/sdk": "^1.17.0",
"cors": "^2.8.5", "cors": "^2.8.5",
"express": "^5.1.0", "express": "^5.1.0",
"ws": "^8.18.0", "ws": "^8.18.0",