Skip to content

Commit f942df7

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 d7b020f commit f942df7

File tree

2 files changed

+21
-16
lines changed

2 files changed

+21
-16
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: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -347,20 +347,23 @@ export function useConnection({
347347
};
348348

349349
const connect = async (_e?: unknown, retryCount: number = 0) => {
350-
const client = new Client<Request, Notification, Result>(
351-
{
352-
name: "mcp-inspector",
353-
version: packageJson.version,
354-
},
355-
{
356-
capabilities: {
357-
sampling: {},
358-
elicitation: {},
359-
roots: {
360-
listChanged: true,
361-
},
350+
const [, name = packageJson.name] = packageJson.name.split("/");
351+
const version = packageJson.version;
352+
const clientIdentity = { name, version };
353+
354+
const clientCapabilities = {
355+
capabilities: {
356+
sampling: {},
357+
elicitation: {},
358+
roots: {
359+
listChanged: true,
362360
},
363361
},
362+
};
363+
364+
const client = new Client<Request, Notification, Result>(
365+
clientIdentity,
366+
clientCapabilities,
364367
);
365368

366369
try {

0 commit comments

Comments
 (0)