Compare commits

..

1 Commits

Author SHA1 Message Date
Cliff Hall
4fc742b01d Revert "Bump version to 0.11.0" 2025-04-30 12:38:15 -04:00
18 changed files with 363 additions and 2672 deletions

View File

@@ -58,6 +58,8 @@ jobs:
# - run: npm ci # - run: npm ci
- run: npm install --no-package-lock - run: npm install --no-package-lock
- run: npm run build
# TODO: Add --provenance once the repo is public # TODO: Add --provenance once the repo is public
- run: npm run publish-all - run: npm run publish-all
env: env:

View File

@@ -1,6 +1,6 @@
{ {
"name": "@modelcontextprotocol/inspector-cli", "name": "@modelcontextprotocol/inspector-cli",
"version": "0.12.0", "version": "0.10.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.11.0", "@modelcontextprotocol/sdk": "^1.10.0",
"commander": "^13.1.0", "commander": "^13.1.0",
"spawn-rx": "^5.1.2" "spawn-rx": "^5.1.2"
} }

View File

@@ -9,34 +9,10 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
const distPath = join(__dirname, "../dist"); const distPath = join(__dirname, "../dist");
const server = http.createServer((request, response) => { const server = http.createServer((request, response) => {
const handlerOptions = { return handler(request, response, {
public: distPath, public: distPath,
rewrites: [{ source: "/**", destination: "/index.html" }], rewrites: [{ source: "/**", destination: "/index.html" }],
headers: [ });
{
// Ensure index.html is never cached
source: "index.html",
headers: [
{
key: "Cache-Control",
value: "no-cache, no-store, max-age=0",
},
],
},
{
// Allow long-term caching for hashed assets
source: "assets/**",
headers: [
{
key: "Cache-Control",
value: "public, max-age=31536000, immutable",
},
],
},
],
};
return handler(request, response, handlerOptions);
}); });
const port = process.env.PORT || 6274; const port = process.env.PORT || 6274;

View File

@@ -1,6 +1,6 @@
{ {
"name": "@modelcontextprotocol/inspector-client", "name": "@modelcontextprotocol/inspector-client",
"version": "0.12.0", "version": "0.10.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)",
@@ -23,7 +23,7 @@
"test:watch": "jest --config jest.config.cjs --watch" "test:watch": "jest --config jest.config.cjs --watch"
}, },
"dependencies": { "dependencies": {
"@modelcontextprotocol/sdk": "^1.11.0", "@modelcontextprotocol/sdk": "^1.10.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

@@ -575,24 +575,11 @@ const App = () => {
{!serverCapabilities?.resources && {!serverCapabilities?.resources &&
!serverCapabilities?.prompts && !serverCapabilities?.prompts &&
!serverCapabilities?.tools ? ( !serverCapabilities?.tools ? (
<> <div className="flex items-center justify-center p-4">
<div className="flex items-center justify-center p-4"> <p className="text-lg text-gray-500">
<p className="text-lg text-gray-500"> The connected server does not support any MCP capabilities
The connected server does not support any MCP </p>
capabilities </div>
</p>
</div>
<PingTab
onPingClick={() => {
void sendMCPRequest(
{
method: "ping" as const,
},
EmptyResultSchema,
);
}}
/>
</>
) : ( ) : (
<> <>
<ResourcesTab <ResourcesTab

View File

@@ -3,7 +3,7 @@ import type { JsonValue } from "@/utils/jsonUtils";
import clsx from "clsx"; import clsx from "clsx";
import { Copy, CheckCheck } from "lucide-react"; import { Copy, CheckCheck } from "lucide-react";
import { Button } from "@/components/ui/button"; import { Button } from "@/components/ui/button";
import { useToast } from "@/lib/hooks/useToast"; import { useToast } from "@/hooks/use-toast";
import { getDataType, tryParseJson } from "@/utils/jsonUtils"; import { getDataType, tryParseJson } from "@/utils/jsonUtils";
interface JsonViewProps { interface JsonViewProps {

View File

@@ -2,7 +2,7 @@ import { useEffect, useRef } from "react";
import { InspectorOAuthClientProvider } from "../lib/auth"; import { InspectorOAuthClientProvider } from "../lib/auth";
import { SESSION_KEYS } from "../lib/constants"; import { SESSION_KEYS } from "../lib/constants";
import { auth } from "@modelcontextprotocol/sdk/client/auth.js"; import { auth } from "@modelcontextprotocol/sdk/client/auth.js";
import { useToast } from "@/lib/hooks/useToast"; import { useToast } from "@/hooks/use-toast.ts";
import { import {
generateOAuthErrorDescription, generateOAuthErrorDescription,
parseOAuthCallbackParams, parseOAuthCallbackParams,

View File

@@ -7,7 +7,7 @@ import {
} from "@modelcontextprotocol/sdk/types.js"; } from "@modelcontextprotocol/sdk/types.js";
import { PendingRequest } from "./SamplingTab"; import { PendingRequest } from "./SamplingTab";
import DynamicJsonForm from "./DynamicJsonForm"; import DynamicJsonForm from "./DynamicJsonForm";
import { useToast } from "@/lib/hooks/useToast"; import { useToast } from "@/hooks/use-toast";
import { JsonSchemaType, JsonValue } from "@/utils/jsonUtils"; import { JsonSchemaType, JsonValue } from "@/utils/jsonUtils";
export type SamplingRequestProps = { export type SamplingRequestProps = {

View File

@@ -29,7 +29,7 @@ import {
} from "@modelcontextprotocol/sdk/types.js"; } from "@modelcontextprotocol/sdk/types.js";
import { InspectorConfig } from "@/lib/configurationTypes"; import { InspectorConfig } from "@/lib/configurationTypes";
import { ConnectionStatus } from "@/lib/constants"; import { ConnectionStatus } from "@/lib/constants";
import useTheme from "../lib/hooks/useTheme"; import useTheme from "../lib/useTheme";
import { version } from "../../../package.json"; import { version } from "../../../package.json";
import { import {
Tooltip, Tooltip,

View File

@@ -7,7 +7,7 @@ import { InspectorConfig } from "@/lib/configurationTypes";
import { TooltipProvider } from "@/components/ui/tooltip"; import { TooltipProvider } from "@/components/ui/tooltip";
// Mock theme hook // Mock theme hook
jest.mock("../../lib/hooks/useTheme", () => ({ jest.mock("../../lib/useTheme", () => ({
__esModule: true, __esModule: true,
default: () => ["light", jest.fn()], default: () => ["light", jest.fn()],
})); }));

View File

@@ -1,4 +1,4 @@
import { useToast } from "@/lib/hooks/useToast"; import { useToast } from "@/hooks/use-toast";
import { import {
Toast, Toast,
ToastClose, ToastClose,

View File

@@ -37,7 +37,7 @@ jest.mock("@modelcontextprotocol/sdk/client/auth.js", () => ({
})); }));
// Mock the toast hook // Mock the toast hook
jest.mock("@/lib/hooks/useToast", () => ({ jest.mock("@/hooks/use-toast", () => ({
useToast: () => ({ useToast: () => ({
toast: jest.fn(), toast: jest.fn(),
}), }),

View File

@@ -2,12 +2,8 @@ import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { import {
SSEClientTransport, SSEClientTransport,
SseError, SseError,
SSEClientTransportOptions,
} from "@modelcontextprotocol/sdk/client/sse.js"; } from "@modelcontextprotocol/sdk/client/sse.js";
import { import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
StreamableHTTPClientTransport,
StreamableHTTPClientTransportOptions,
} from "@modelcontextprotocol/sdk/client/streamableHttp.js";
import { import {
ClientNotification, ClientNotification,
ClientRequest, ClientRequest,
@@ -31,7 +27,7 @@ import {
} from "@modelcontextprotocol/sdk/types.js"; } from "@modelcontextprotocol/sdk/types.js";
import { RequestOptions } from "@modelcontextprotocol/sdk/shared/protocol.js"; import { RequestOptions } from "@modelcontextprotocol/sdk/shared/protocol.js";
import { useState } from "react"; import { useState } from "react";
import { useToast } from "@/lib/hooks/useToast"; import { useToast } from "@/hooks/use-toast";
import { z } from "zod"; import { z } from "zod";
import { ConnectionStatus } from "../constants"; import { ConnectionStatus } from "../constants";
import { Notification, StdErrNotificationSchema } from "../notificationTypes"; import { Notification, StdErrNotificationSchema } from "../notificationTypes";
@@ -283,6 +279,29 @@ export function useConnection({
setConnectionStatus("error-connecting-to-proxy"); setConnectionStatus("error-connecting-to-proxy");
return; return;
} }
let mcpProxyServerUrl;
switch (transportType) {
case "stdio":
mcpProxyServerUrl = new URL(`${getMCPProxyAddress(config)}/stdio`);
mcpProxyServerUrl.searchParams.append("command", command);
mcpProxyServerUrl.searchParams.append("args", args);
mcpProxyServerUrl.searchParams.append("env", JSON.stringify(env));
break;
case "sse":
mcpProxyServerUrl = new URL(`${getMCPProxyAddress(config)}/sse`);
mcpProxyServerUrl.searchParams.append("url", sseUrl);
break;
case "streamable-http":
mcpProxyServerUrl = new URL(`${getMCPProxyAddress(config)}/mcp`);
mcpProxyServerUrl.searchParams.append("url", sseUrl);
break;
}
(mcpProxyServerUrl as URL).searchParams.append(
"transportType",
transportType,
);
try { try {
// Inject auth manually instead of using SSEClientTransport, because we're // Inject auth manually instead of using SSEClientTransport, because we're
@@ -301,82 +320,21 @@ export function useConnection({
} }
// Create appropriate transport // Create appropriate transport
let transportOptions: const transportOptions = {
| StreamableHTTPClientTransportOptions eventSourceInit: {
| SSEClientTransportOptions; fetch: (
url: string | URL | globalThis.Request,
let mcpProxyServerUrl; init: RequestInit | undefined,
switch (transportType) { ) => fetch(url, { ...init, headers }),
case "stdio": },
mcpProxyServerUrl = new URL(`${getMCPProxyAddress(config)}/stdio`); requestInit: {
mcpProxyServerUrl.searchParams.append("command", command); headers,
mcpProxyServerUrl.searchParams.append("args", args); },
mcpProxyServerUrl.searchParams.append("env", JSON.stringify(env)); };
transportOptions = {
authProvider: serverAuthProvider,
eventSourceInit: {
fetch: (
url: string | URL | globalThis.Request,
init: RequestInit | undefined,
) => fetch(url, { ...init, headers }),
},
requestInit: {
headers,
},
};
break;
case "sse":
mcpProxyServerUrl = new URL(`${getMCPProxyAddress(config)}/sse`);
mcpProxyServerUrl.searchParams.append("url", sseUrl);
transportOptions = {
authProvider: serverAuthProvider,
eventSourceInit: {
fetch: (
url: string | URL | globalThis.Request,
init: RequestInit | undefined,
) => fetch(url, { ...init, headers }),
},
requestInit: {
headers,
},
};
break;
case "streamable-http":
mcpProxyServerUrl = new URL(`${getMCPProxyAddress(config)}/mcp`);
mcpProxyServerUrl.searchParams.append("url", sseUrl);
transportOptions = {
authProvider: serverAuthProvider,
eventSourceInit: {
fetch: (
url: string | URL | globalThis.Request,
init: RequestInit | undefined,
) => fetch(url, { ...init, headers }),
},
requestInit: {
headers,
},
// TODO these should be configurable...
reconnectionOptions: {
maxReconnectionDelay: 30000,
initialReconnectionDelay: 1000,
reconnectionDelayGrowFactor: 1.5,
maxRetries: 2,
},
};
break;
}
(mcpProxyServerUrl as URL).searchParams.append(
"transportType",
transportType,
);
const clientTransport = const clientTransport =
transportType === "streamable-http" transportType === "streamable-http"
? new StreamableHTTPClientTransport(mcpProxyServerUrl as URL, { ? new StreamableHTTPClientTransport(mcpProxyServerUrl as URL, {
sessionId: undefined, sessionId: undefined,
...transportOptions,
}) })
: new SSEClientTransport(mcpProxyServerUrl as URL, transportOptions); : new SSEClientTransport(mcpProxyServerUrl as URL, transportOptions);

2829
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{ {
"name": "@modelcontextprotocol/inspector", "name": "@modelcontextprotocol/inspector",
"version": "0.12.0", "version": "0.10.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)",
@@ -26,7 +26,6 @@
"build-server": "cd server && npm run build", "build-server": "cd server && npm run build",
"build-client": "cd client && npm run build", "build-client": "cd client && npm run build",
"build-cli": "cd cli && npm run build", "build-cli": "cd cli && npm run build",
"clean": "rimraf ./node_modules ./client/node_modules ./cli/node_modules ./build ./client/dist ./server/build ./cli/build ./package-lock.json && npm install",
"dev": "concurrently \"cd client && npm run dev\" \"cd server && npm run dev\"", "dev": "concurrently \"cd client && npm run dev\" \"cd server && npm run dev\"",
"dev:windows": "concurrently \"cd client && npm run dev\" \"cd server && npm run dev:windows\"", "dev:windows": "concurrently \"cd client && npm run dev\" \"cd server && npm run dev:windows\"",
"start": "node client/bin/start.js", "start": "node client/bin/start.js",
@@ -36,14 +35,13 @@
"test-cli": "cd cli && npm run test", "test-cli": "cd cli && npm run test",
"prettier-fix": "prettier --write .", "prettier-fix": "prettier --write .",
"prettier-check": "prettier --check .", "prettier-check": "prettier --check .",
"prepare": "npm run build",
"publish-all": "npm publish --workspaces --access public && npm publish --access public" "publish-all": "npm publish --workspaces --access public && npm publish --access public"
}, },
"dependencies": { "dependencies": {
"@modelcontextprotocol/inspector-cli": "^0.12.0", "@modelcontextprotocol/inspector-cli": "^0.10.2",
"@modelcontextprotocol/inspector-client": "^0.12.0", "@modelcontextprotocol/inspector-client": "^0.10.2",
"@modelcontextprotocol/inspector-server": "^0.12.0", "@modelcontextprotocol/inspector-server": "^0.10.2",
"@modelcontextprotocol/sdk": "^1.11.0", "@modelcontextprotocol/sdk": "^1.10.2",
"concurrently": "^9.0.1", "concurrently": "^9.0.1",
"shell-quote": "^1.8.2", "shell-quote": "^1.8.2",
"spawn-rx": "^5.1.2", "spawn-rx": "^5.1.2",
@@ -56,7 +54,6 @@
"@types/shell-quote": "^1.7.5", "@types/shell-quote": "^1.7.5",
"jest-fixed-jsdom": "^0.0.9", "jest-fixed-jsdom": "^0.0.9",
"prettier": "3.3.3", "prettier": "3.3.3",
"rimraf": "^6.0.1",
"typescript": "^5.4.2" "typescript": "^5.4.2"
} }
} }

View File

@@ -1,6 +1,6 @@
{ {
"name": "@modelcontextprotocol/inspector-server", "name": "@modelcontextprotocol/inspector-server",
"version": "0.12.0", "version": "0.10.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.11.0", "@modelcontextprotocol/sdk": "^1.10.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",