Compare commits
32 Commits
0.11.0-ame
...
0.12.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
24e8861a88 | ||
|
|
2731b5f7fa | ||
|
|
7083c7c9f2 | ||
|
|
6223839251 | ||
|
|
e33a6b806d | ||
|
|
fe9ab40994 | ||
|
|
f7b936e102 | ||
|
|
3e41520688 | ||
|
|
a57e707a0b | ||
|
|
73a8e2dee6 | ||
|
|
f05c27f6ab | ||
|
|
2609996ce6 | ||
|
|
b00b271d65 | ||
|
|
7a1fb0cfd9 | ||
|
|
63cb034943 | ||
|
|
04e24916b1 | ||
|
|
c9d2f0761e | ||
|
|
f19b382e72 | ||
|
|
9998298dfe | ||
|
|
5393f2e04c | ||
|
|
f9cbfbe822 | ||
|
|
b7ec3829d4 | ||
|
|
8b38d6b18f | ||
|
|
ae87292d7c | ||
|
|
3b090d02e4 | ||
|
|
358f276b9b | ||
|
|
70016bf3b6 | ||
|
|
4d98b4a8bd | ||
|
|
5ad2c3c146 | ||
|
|
dd6f5287ca | ||
|
|
59cc89dbe9 | ||
|
|
79a09f8316 |
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@modelcontextprotocol/inspector-cli",
|
"name": "@modelcontextprotocol/inspector-cli",
|
||||||
"version": "0.11.0",
|
"version": "0.12.0",
|
||||||
"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.10.2",
|
"@modelcontextprotocol/sdk": "^1.11.0",
|
||||||
"commander": "^13.1.0",
|
"commander": "^13.1.0",
|
||||||
"spawn-rx": "^5.1.2"
|
"spawn-rx": "^5.1.2"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,10 +9,34 @@ 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) => {
|
||||||
return handler(request, response, {
|
const handlerOptions = {
|
||||||
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;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@modelcontextprotocol/inspector-client",
|
"name": "@modelcontextprotocol/inspector-client",
|
||||||
"version": "0.11.0",
|
"version": "0.12.0",
|
||||||
"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.10.2",
|
"@modelcontextprotocol/sdk": "^1.11.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",
|
||||||
|
|||||||
@@ -575,11 +575,24 @@ 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
|
||||||
|
capabilities
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
<PingTab
|
||||||
|
onPingClick={() => {
|
||||||
|
void sendMCPRequest(
|
||||||
|
{
|
||||||
|
method: "ping" as const,
|
||||||
|
},
|
||||||
|
EmptyResultSchema,
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<ResourcesTab
|
<ResourcesTab
|
||||||
|
|||||||
@@ -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 "@/hooks/use-toast";
|
import { useToast } from "@/lib/hooks/useToast";
|
||||||
import { getDataType, tryParseJson } from "@/utils/jsonUtils";
|
import { getDataType, tryParseJson } from "@/utils/jsonUtils";
|
||||||
|
|
||||||
interface JsonViewProps {
|
interface JsonViewProps {
|
||||||
|
|||||||
@@ -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 "@/hooks/use-toast.ts";
|
import { useToast } from "@/lib/hooks/useToast";
|
||||||
import {
|
import {
|
||||||
generateOAuthErrorDescription,
|
generateOAuthErrorDescription,
|
||||||
parseOAuthCallbackParams,
|
parseOAuthCallbackParams,
|
||||||
|
|||||||
@@ -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 "@/hooks/use-toast";
|
import { useToast } from "@/lib/hooks/useToast";
|
||||||
import { JsonSchemaType, JsonValue } from "@/utils/jsonUtils";
|
import { JsonSchemaType, JsonValue } from "@/utils/jsonUtils";
|
||||||
|
|
||||||
export type SamplingRequestProps = {
|
export type SamplingRequestProps = {
|
||||||
|
|||||||
@@ -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/useTheme";
|
import useTheme from "../lib/hooks/useTheme";
|
||||||
import { version } from "../../../package.json";
|
import { version } from "../../../package.json";
|
||||||
import {
|
import {
|
||||||
Tooltip,
|
Tooltip,
|
||||||
|
|||||||
@@ -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/useTheme", () => ({
|
jest.mock("../../lib/hooks/useTheme", () => ({
|
||||||
__esModule: true,
|
__esModule: true,
|
||||||
default: () => ["light", jest.fn()],
|
default: () => ["light", jest.fn()],
|
||||||
}));
|
}));
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useToast } from "@/hooks/use-toast";
|
import { useToast } from "@/lib/hooks/useToast";
|
||||||
import {
|
import {
|
||||||
Toast,
|
Toast,
|
||||||
ToastClose,
|
ToastClose,
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ jest.mock("@modelcontextprotocol/sdk/client/auth.js", () => ({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
// Mock the toast hook
|
// Mock the toast hook
|
||||||
jest.mock("@/hooks/use-toast", () => ({
|
jest.mock("@/lib/hooks/useToast", () => ({
|
||||||
useToast: () => ({
|
useToast: () => ({
|
||||||
toast: jest.fn(),
|
toast: jest.fn(),
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -2,8 +2,12 @@ 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 { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
import {
|
||||||
|
StreamableHTTPClientTransport,
|
||||||
|
StreamableHTTPClientTransportOptions,
|
||||||
|
} from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
||||||
import {
|
import {
|
||||||
ClientNotification,
|
ClientNotification,
|
||||||
ClientRequest,
|
ClientRequest,
|
||||||
@@ -27,7 +31,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 "@/hooks/use-toast";
|
import { useToast } from "@/lib/hooks/useToast";
|
||||||
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";
|
||||||
@@ -279,29 +283,6 @@ 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
|
||||||
@@ -320,7 +301,19 @@ export function useConnection({
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create appropriate transport
|
// Create appropriate transport
|
||||||
const transportOptions = {
|
let transportOptions:
|
||||||
|
| StreamableHTTPClientTransportOptions
|
||||||
|
| SSEClientTransportOptions;
|
||||||
|
|
||||||
|
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));
|
||||||
|
transportOptions = {
|
||||||
|
authProvider: serverAuthProvider,
|
||||||
eventSourceInit: {
|
eventSourceInit: {
|
||||||
fetch: (
|
fetch: (
|
||||||
url: string | URL | globalThis.Request,
|
url: string | URL | globalThis.Request,
|
||||||
@@ -331,10 +324,59 @@ export function useConnection({
|
|||||||
headers,
|
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);
|
||||||
|
|
||||||
|
|||||||
2823
package-lock.json
generated
2823
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
12
package.json
12
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@modelcontextprotocol/inspector",
|
"name": "@modelcontextprotocol/inspector",
|
||||||
"version": "0.11.0",
|
"version": "0.12.0",
|
||||||
"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,6 +26,7 @@
|
|||||||
"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",
|
||||||
@@ -39,10 +40,10 @@
|
|||||||
"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.11.0",
|
"@modelcontextprotocol/inspector-cli": "^0.12.0",
|
||||||
"@modelcontextprotocol/inspector-client": "^0.11.0",
|
"@modelcontextprotocol/inspector-client": "^0.12.0",
|
||||||
"@modelcontextprotocol/inspector-server": "^0.11.0",
|
"@modelcontextprotocol/inspector-server": "^0.12.0",
|
||||||
"@modelcontextprotocol/sdk": "^1.10.2",
|
"@modelcontextprotocol/sdk": "^1.11.0",
|
||||||
"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",
|
||||||
@@ -55,6 +56,7 @@
|
|||||||
"@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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@modelcontextprotocol/inspector-server",
|
"name": "@modelcontextprotocol/inspector-server",
|
||||||
"version": "0.11.0",
|
"version": "0.12.0",
|
||||||
"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.10.2",
|
"@modelcontextprotocol/sdk": "^1.11.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",
|
||||||
|
|||||||
Reference in New Issue
Block a user