diff --git a/cli/src/client/connection.ts b/cli/src/client/connection.ts index 931f803d..dcbe8e51 100644 --- a/cli/src/client/connection.ts +++ b/cli/src/client/connection.ts @@ -18,6 +18,12 @@ export async function connect( ): Promise { try { await client.connect(transport); + + if (client.getServerCapabilities()?.logging) { + // default logging level is undefined in the spec, but the user of the + // inspector most likely wants debug. + await client.setLoggingLevel("debug"); + } } catch (error) { throw new Error( `Failed to connect to MCP server: ${error instanceof Error ? error.message : String(error)}`, diff --git a/client/package.json b/client/package.json index 2e725a60..cbb7d8b6 100644 --- a/client/package.json +++ b/client/package.json @@ -49,19 +49,19 @@ "serve-handler": "^6.1.6", "tailwind-merge": "^2.5.3", "tailwindcss-animate": "^1.0.7", - "zod": "^3.23.8" + "zod": "^3.25.76" }, "devDependencies": { "@eslint/js": "^9.11.1", "@testing-library/jest-dom": "^6.6.3", "@testing-library/react": "^16.2.0", "@types/jest": "^29.5.14", - "@types/node": "^22.7.5", + "@types/node": "^22.17.0", "@types/prismjs": "^1.26.5", - "@types/react": "^18.3.10", + "@types/react": "^18.3.23", "@types/react-dom": "^18.3.0", "@types/serve-handler": "^6.1.4", - "@vitejs/plugin-react": "^4.3.2", + "@vitejs/plugin-react": "^4.7.0", "autoprefixer": "^10.4.20", "co": "^4.6.0", "eslint": "^9.11.1", @@ -70,11 +70,11 @@ "globals": "^15.9.0", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", - "postcss": "^8.4.47", + "postcss": "^8.5.6", "tailwindcss": "^3.4.13", - "ts-jest": "^29.2.6", + "ts-jest": "^29.4.0", "typescript": "^5.5.3", - "typescript-eslint": "^8.7.0", - "vite": "^6.3.0" + "typescript-eslint": "^8.38.0", + "vite": "^6.3.5" } } diff --git a/client/src/App.tsx b/client/src/App.tsx index 3836aa9b..537f80bf 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -260,6 +260,7 @@ const App = () => { window.location.hash = "elicitations"; }, getRoots: () => rootsRef.current, + defaultLoggingLevel: logLevel, }); useEffect(() => { diff --git a/client/src/components/ToolResults.tsx b/client/src/components/ToolResults.tsx index a3cecf55..6479b5fb 100644 --- a/client/src/components/ToolResults.tsx +++ b/client/src/components/ToolResults.tsx @@ -154,6 +154,14 @@ const ToolResults = ({ )} + {structuredResult._meta && ( +
+
Meta:
+
+ +
+
+ )} {!structuredResult.structuredContent && validationResult && !validationResult.isValid && ( diff --git a/client/src/components/ToolsTab.tsx b/client/src/components/ToolsTab.tsx index 3c7db84e..2eb682e5 100644 --- a/client/src/components/ToolsTab.tsx +++ b/client/src/components/ToolsTab.tsx @@ -19,6 +19,10 @@ import ListPane from "./ListPane"; import JsonView from "./JsonView"; import ToolResults from "./ToolResults"; +// Type guard to safely detect the optional _meta field without using `any` +const hasMeta = (tool: Tool): tool is Tool & { _meta: unknown } => + typeof (tool as { _meta?: unknown })._meta !== "undefined"; + const ToolsTab = ({ tools, listTools, @@ -46,6 +50,7 @@ const ToolsTab = ({ const [params, setParams] = useState>({}); const [isToolRunning, setIsToolRunning] = useState(false); const [isOutputSchemaExpanded, setIsOutputSchemaExpanded] = useState(false); + const [isMetaExpanded, setIsMetaExpanded] = useState(false); useEffect(() => { const params = Object.entries( @@ -245,6 +250,40 @@ const ToolsTab = ({ )} + {selectedTool && + hasMeta(selectedTool) && + selectedTool._meta && ( +
+
+

Meta:

+ +
+
+ +
+
+ )}