Skip to content

Commit 01adbe5

Browse files
olaservoclaude
andcommitted
Merge branch 'main' into ksinder/main
Resolved conflicts in ToolsTab.tsx by combining: - Error alert display from main - Description styling improvements from PR #823 (whitespace-pre-wrap, max-h-48, overflow-y-auto) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
2 parents 5bec008 + b025bff commit 01adbe5

24 files changed

+1763
-606
lines changed

cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@modelcontextprotocol/inspector-cli",
3-
"version": "0.16.8",
3+
"version": "0.17.0",
44
"description": "CLI for the Model Context Protocol inspector",
55
"license": "MIT",
66
"author": "Anthropic, PBC (https://anthropic.com)",

cli/src/index.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env node
22

3+
import * as fs from "fs";
34
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
45
import { Command } from "commander";
56
import {
@@ -99,16 +100,27 @@ function createTransportOptions(
99100
}
100101

101102
async function callMethod(args: Args): Promise<void> {
103+
// Read package.json to get name and version for client identity
104+
const pathA = "../package.json"; // We're in package @modelcontextprotocol/inspector-cli
105+
const pathB = "../../package.json"; // We're in package @modelcontextprotocol/inspector
106+
let packageJson: { name: string; version: string };
107+
let packageJsonData = await import(fs.existsSync(pathA) ? pathA : pathB, {
108+
with: { type: "json" },
109+
});
110+
packageJson = packageJsonData.default;
111+
102112
const transportOptions = createTransportOptions(
103113
args.target,
104114
args.transport,
105115
args.headers,
106116
);
107117
const transport = createTransport(transportOptions);
108-
const client = new Client({
109-
name: "inspector-cli",
110-
version: "0.5.1",
111-
});
118+
119+
const [, name = packageJson.name] = packageJson.name.split("/");
120+
const version = packageJson.version;
121+
const clientIdentity = { name, version };
122+
123+
const client = new Client(clientIdentity);
112124

113125
try {
114126
await connect(client, transport);

client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@modelcontextprotocol/inspector-client",
3-
"version": "0.16.8",
3+
"version": "0.17.0",
44
"description": "Client-side application for the Model Context Protocol inspector",
55
"license": "MIT",
66
"author": "Anthropic, PBC (https://anthropic.com)",

client/src/App.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ import { SESSION_KEYS, getServerSpecificKey } from "./lib/constants";
2222
import { AuthDebuggerState, EMPTY_DEBUGGER_STATE } from "./lib/auth-types";
2323
import { OAuthStateMachine } from "./lib/oauth-state-machine";
2424
import { cacheToolOutputSchemas } from "./utils/schemaUtils";
25+
import { cleanParams } from "./utils/paramUtils";
26+
import type { JsonSchemaType } from "./utils/jsonUtils";
2527
import React, {
2628
Suspense,
2729
useCallback,
@@ -162,12 +164,12 @@ const App = () => {
162164
return migrateFromLegacyAuth(legacyToken, legacyHeaderName);
163165
}
164166

165-
// Default to Authorization: Bearer as the most common case
167+
// Default to empty array
166168
return [
167169
{
168170
name: "Authorization",
169171
value: "Bearer ",
170-
enabled: true,
172+
enabled: false,
171173
},
172174
];
173175
});
@@ -777,12 +779,18 @@ const App = () => {
777779
lastToolCallOriginTabRef.current = currentTabRef.current;
778780

779781
try {
782+
// Find the tool schema to clean parameters properly
783+
const tool = tools.find((t) => t.name === name);
784+
const cleanedParams = tool?.inputSchema
785+
? cleanParams(params, tool.inputSchema as JsonSchemaType)
786+
: params;
787+
780788
const response = await sendMCPRequest(
781789
{
782790
method: "tools/call" as const,
783791
params: {
784792
name,
785-
arguments: params,
793+
arguments: cleanedParams,
786794
_meta: {
787795
progressToken: progressTokenRef.current++,
788796
},
@@ -793,6 +801,8 @@ const App = () => {
793801
);
794802

795803
setToolResult(response);
804+
// Clear any validation errors since tool execution completed
805+
setErrors((prev) => ({ ...prev, tools: null }));
796806
} catch (e) {
797807
const toolResult: CompatibilityCallToolResult = {
798808
content: [
@@ -804,6 +814,8 @@ const App = () => {
804814
isError: true,
805815
};
806816
setToolResult(toolResult);
817+
// Clear validation errors - tool execution errors are shown in ToolResults
818+
setErrors((prev) => ({ ...prev, tools: null }));
807819
}
808820
};
809821

0 commit comments

Comments
 (0)