Skip to content

Commit f453366

Browse files
Consistent MCP Client() name from package
Make both clients use name from package.json for consistency and protocol clarity - web client changes `mcp-inspector` -> `inspector-client` (package.json) - cli client remains `inspector-cli` (package.json)
1 parent 3655d45 commit f453366

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

cli/src/index.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,12 @@ function createTransportOptions(
8989
async function callMethod(args: Args): Promise<void> {
9090
const transportOptions = createTransportOptions(args.target, args.transport);
9191
const transport = createTransport(transportOptions);
92-
const client = new Client({
93-
name: "inspector-cli",
94-
version: packageJson.version,
95-
});
92+
93+
const [_, name = packageJson.name] = packageJson.name.split("/");
94+
const version = packageJson.version;
95+
const clientIdentity = { name, version };
96+
97+
const client = new Client(clientIdentity);
9698

9799
try {
98100
await connect(client, transport);

client/src/lib/hooks/useConnection.ts

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -287,19 +287,22 @@ export function useConnection({
287287
};
288288

289289
const connect = async (_e?: unknown, retryCount: number = 0) => {
290-
const client = new Client<Request, Notification, Result>(
291-
{
292-
name: "mcp-inspector",
293-
version: packageJson.version,
294-
},
295-
{
296-
capabilities: {
297-
sampling: {},
298-
roots: {
299-
listChanged: true,
300-
},
290+
const [, name = packageJson.name] = packageJson.name.split("/");
291+
const version = packageJson.version;
292+
const clientIdentity = { name, version };
293+
294+
const clientCapabilities = {
295+
capabilities: {
296+
sampling: {},
297+
roots: {
298+
listChanged: true,
301299
},
302300
},
301+
};
302+
303+
const client = new Client<Request, Notification, Result>(
304+
clientIdentity,
305+
clientCapabilities,
303306
);
304307

305308
try {

0 commit comments

Comments
 (0)